expo-backend-types 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +12 -21
- package/src/auth/dto/login.dto.ts +22 -0
- package/src/auth/dto/register.dto.ts +16 -0
- package/src/cuenta/dto/cuenta.dto.ts +28 -0
- package/{dist/types/dto.d.ts → types/dto.ts} +1 -1
- package/types/index.d.ts +2 -0
- package/types/prisma-schema/default.d.ts +1 -0
- package/types/prisma-schema/default.js +1 -0
- package/types/prisma-schema/edge.d.ts +1 -0
- package/types/prisma-schema/edge.js +306 -0
- package/types/prisma-schema/index-browser.js +298 -0
- package/types/prisma-schema/index.d.ts +16638 -0
- package/types/prisma-schema/index.js +327 -0
- package/types/prisma-schema/package.json +84 -0
- package/types/prisma-schema/query_engine-windows.dll.node +0 -0
- package/types/prisma-schema/runtime/edge-esm.js +28 -0
- package/types/prisma-schema/runtime/edge.js +28 -0
- package/types/prisma-schema/runtime/index-browser.d.ts +365 -0
- package/types/prisma-schema/runtime/index-browser.js +13 -0
- package/types/prisma-schema/runtime/library.d.ts +3193 -0
- package/types/prisma-schema/runtime/library.js +140 -0
- package/types/prisma-schema/runtime/react-native.js +77 -0
- package/types/prisma-schema/runtime/wasm.js +29 -0
- package/types/prisma-schema/schema.prisma +170 -0
- package/types/prisma-schema/wasm.d.ts +1 -0
- package/types/prisma-schema/wasm.js +298 -0
- package/{dist/types → types}/schema.d.ts +15 -0
- package/dist/src/auth/dto/login.dto.d.ts +0 -170
- package/dist/src/auth/dto/login.dto.js +0 -29
- package/dist/src/auth/dto/login.dto.js.map +0 -1
- package/dist/src/auth/dto/register.dto.d.ts +0 -73
- package/dist/src/auth/dto/register.dto.js +0 -20
- package/dist/src/auth/dto/register.dto.js.map +0 -1
- package/dist/src/auth/exports.d.ts +0 -2
- package/dist/src/auth/exports.js +0 -19
- package/dist/src/auth/exports.js.map +0 -1
- package/dist/src/cuenta/dto/cuenta.dto.d.ts +0 -60
- package/dist/src/cuenta/dto/cuenta.dto.js +0 -31
- package/dist/src/cuenta/dto/cuenta.dto.js.map +0 -1
- package/dist/src/cuenta/exports.d.ts +0 -1
- package/dist/src/cuenta/exports.js +0 -18
- package/dist/src/cuenta/exports.js.map +0 -1
- package/dist/src/exports.d.ts +0 -2
- package/dist/src/exports.js +0 -19
- package/dist/src/exports.js.map +0 -1
- package/dist/types/dto.js +0 -18
- package/dist/types/dto.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.js +0 -19
- package/dist/types/index.js.map +0 -1
- package/dist/types/schema.js +0 -3
- package/dist/types/schema.js.map +0 -1
- package/tsconfig.json +0 -27
@@ -0,0 +1,3193 @@
|
|
1
|
+
/**
|
2
|
+
* @param this
|
3
|
+
*/
|
4
|
+
declare function $extends(this: Client, extension: ExtensionArgs | ((client: Client) => Client)): Client;
|
5
|
+
|
6
|
+
declare type AccelerateEngineConfig = {
|
7
|
+
inlineSchema: EngineConfig['inlineSchema'];
|
8
|
+
inlineSchemaHash: EngineConfig['inlineSchemaHash'];
|
9
|
+
env: EngineConfig['env'];
|
10
|
+
generator?: {
|
11
|
+
previewFeatures: string[];
|
12
|
+
};
|
13
|
+
inlineDatasources: EngineConfig['inlineDatasources'];
|
14
|
+
overrideDatasources: EngineConfig['overrideDatasources'];
|
15
|
+
clientVersion: EngineConfig['clientVersion'];
|
16
|
+
engineVersion: EngineConfig['engineVersion'];
|
17
|
+
logEmitter: EngineConfig['logEmitter'];
|
18
|
+
logQueries?: EngineConfig['logQueries'];
|
19
|
+
logLevel?: EngineConfig['logLevel'];
|
20
|
+
tracingHelper: EngineConfig['tracingHelper'];
|
21
|
+
accelerateUtils?: EngineConfig['accelerateUtils'];
|
22
|
+
};
|
23
|
+
|
24
|
+
export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw';
|
25
|
+
|
26
|
+
export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum';
|
27
|
+
|
28
|
+
export declare type AllModelsToStringIndex<TypeMap extends TypeMapDef, Args extends Record<string, any>, K extends PropertyKey> = Args extends {
|
29
|
+
[P in K]: {
|
30
|
+
$allModels: infer AllModels;
|
31
|
+
};
|
32
|
+
} ? {
|
33
|
+
[P in K]: Record<TypeMap['meta']['modelProps'], AllModels>;
|
34
|
+
} : {};
|
35
|
+
|
36
|
+
declare class AnyNull extends NullTypesEnumValue {
|
37
|
+
}
|
38
|
+
|
39
|
+
export declare type Args<T, F extends Operation> = T extends {
|
40
|
+
[K: symbol]: {
|
41
|
+
types: {
|
42
|
+
operations: {
|
43
|
+
[K in F]: {
|
44
|
+
args: any;
|
45
|
+
};
|
46
|
+
};
|
47
|
+
};
|
48
|
+
};
|
49
|
+
} ? T[symbol]['types']['operations'][F]['args'] : any;
|
50
|
+
|
51
|
+
export declare type Args_3<T, F extends Operation> = Args<T, F>;
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Attributes is a map from string to attribute values.
|
55
|
+
*
|
56
|
+
* Note: only the own enumerable keys are counted as valid attribute keys.
|
57
|
+
*/
|
58
|
+
declare interface Attributes {
|
59
|
+
[attributeKey: string]: AttributeValue | undefined;
|
60
|
+
}
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Attribute values may be any non-nullish primitive value except an object.
|
64
|
+
*
|
65
|
+
* null or undefined attribute values are invalid and will result in undefined behavior.
|
66
|
+
*/
|
67
|
+
declare type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
|
68
|
+
|
69
|
+
export declare type BaseDMMF = Pick<DMMF.Document, 'datamodel'>;
|
70
|
+
|
71
|
+
declare type BatchArgs = {
|
72
|
+
queries: BatchQuery[];
|
73
|
+
transaction?: {
|
74
|
+
isolationLevel?: IsolationLevel;
|
75
|
+
};
|
76
|
+
};
|
77
|
+
|
78
|
+
declare type BatchInternalParams = {
|
79
|
+
requests: RequestParams[];
|
80
|
+
customDataProxyFetch?: CustomDataProxyFetch;
|
81
|
+
};
|
82
|
+
|
83
|
+
declare type BatchQuery = {
|
84
|
+
model: string | undefined;
|
85
|
+
operation: string;
|
86
|
+
args: JsArgs | RawQueryArgs;
|
87
|
+
};
|
88
|
+
|
89
|
+
declare type BatchQueryEngineResult<T> = QueryEngineResult<T> | Error;
|
90
|
+
|
91
|
+
declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise<any>;
|
92
|
+
|
93
|
+
declare type BatchQueryOptionsCbArgs = {
|
94
|
+
args: BatchArgs;
|
95
|
+
query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise<unknown[]>;
|
96
|
+
__internalParams: BatchInternalParams;
|
97
|
+
};
|
98
|
+
|
99
|
+
declare type BatchTransactionOptions = {
|
100
|
+
isolationLevel?: Transaction_2.IsolationLevel;
|
101
|
+
};
|
102
|
+
|
103
|
+
declare interface BinaryTargetsEnvValue {
|
104
|
+
fromEnvVar: string | null;
|
105
|
+
value: string;
|
106
|
+
native?: boolean;
|
107
|
+
}
|
108
|
+
|
109
|
+
export declare type Call<F extends Fn, P> = (F & {
|
110
|
+
params: P;
|
111
|
+
})['returns'];
|
112
|
+
|
113
|
+
declare interface CallSite {
|
114
|
+
getLocation(): LocationInFile | null;
|
115
|
+
}
|
116
|
+
|
117
|
+
export declare type Cast<A, W> = A extends W ? A : W;
|
118
|
+
|
119
|
+
declare type Client = ReturnType<typeof getPrismaClient> extends new () => infer T ? T : never;
|
120
|
+
|
121
|
+
export declare type ClientArg = {
|
122
|
+
[MethodName in string]: unknown;
|
123
|
+
};
|
124
|
+
|
125
|
+
export declare type ClientArgs = {
|
126
|
+
client: ClientArg;
|
127
|
+
};
|
128
|
+
|
129
|
+
export declare type ClientBuiltInProp = keyof DynamicClientExtensionThisBuiltin<never, never, never>;
|
130
|
+
|
131
|
+
declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum];
|
132
|
+
|
133
|
+
declare const ColumnTypeEnum: {
|
134
|
+
readonly Int32: 0;
|
135
|
+
readonly Int64: 1;
|
136
|
+
readonly Float: 2;
|
137
|
+
readonly Double: 3;
|
138
|
+
readonly Numeric: 4;
|
139
|
+
readonly Boolean: 5;
|
140
|
+
readonly Character: 6;
|
141
|
+
readonly Text: 7;
|
142
|
+
readonly Date: 8;
|
143
|
+
readonly Time: 9;
|
144
|
+
readonly DateTime: 10;
|
145
|
+
readonly Json: 11;
|
146
|
+
readonly Enum: 12;
|
147
|
+
readonly Bytes: 13;
|
148
|
+
readonly Set: 14;
|
149
|
+
readonly Uuid: 15;
|
150
|
+
readonly Int32Array: 64;
|
151
|
+
readonly Int64Array: 65;
|
152
|
+
readonly FloatArray: 66;
|
153
|
+
readonly DoubleArray: 67;
|
154
|
+
readonly NumericArray: 68;
|
155
|
+
readonly BooleanArray: 69;
|
156
|
+
readonly CharacterArray: 70;
|
157
|
+
readonly TextArray: 71;
|
158
|
+
readonly DateArray: 72;
|
159
|
+
readonly TimeArray: 73;
|
160
|
+
readonly DateTimeArray: 74;
|
161
|
+
readonly JsonArray: 75;
|
162
|
+
readonly EnumArray: 76;
|
163
|
+
readonly BytesArray: 77;
|
164
|
+
readonly UuidArray: 78;
|
165
|
+
readonly UnknownNumber: 128;
|
166
|
+
};
|
167
|
+
|
168
|
+
export declare type Compute<T> = T extends Function ? T : {
|
169
|
+
[K in keyof T]: T[K];
|
170
|
+
} & unknown;
|
171
|
+
|
172
|
+
export declare type ComputeDeep<T> = T extends Function ? T : {
|
173
|
+
[K in keyof T]: ComputeDeep<T[K]>;
|
174
|
+
} & unknown;
|
175
|
+
|
176
|
+
declare type ComputedField = {
|
177
|
+
name: string;
|
178
|
+
needs: string[];
|
179
|
+
compute: ResultArgsFieldCompute;
|
180
|
+
};
|
181
|
+
|
182
|
+
declare type ComputedFieldsMap = {
|
183
|
+
[fieldName: string]: ComputedField;
|
184
|
+
};
|
185
|
+
|
186
|
+
declare type ConnectionInfo = {
|
187
|
+
schemaName?: string;
|
188
|
+
};
|
189
|
+
|
190
|
+
declare interface Context {
|
191
|
+
/**
|
192
|
+
* Get a value from the context.
|
193
|
+
*
|
194
|
+
* @param key key which identifies a context value
|
195
|
+
*/
|
196
|
+
getValue(key: symbol): unknown;
|
197
|
+
/**
|
198
|
+
* Create a new context which inherits from this context and has
|
199
|
+
* the given key set to the given value.
|
200
|
+
*
|
201
|
+
* @param key context key for which to set the value
|
202
|
+
* @param value value to set for the given key
|
203
|
+
*/
|
204
|
+
setValue(key: symbol, value: unknown): Context;
|
205
|
+
/**
|
206
|
+
* Return a new context which inherits from this context but does
|
207
|
+
* not contain a value for the given key.
|
208
|
+
*
|
209
|
+
* @param key context key for which to clear a value
|
210
|
+
*/
|
211
|
+
deleteValue(key: symbol): Context;
|
212
|
+
}
|
213
|
+
|
214
|
+
declare type Context_2<T> = T extends {
|
215
|
+
[K: symbol]: {
|
216
|
+
ctx: infer C;
|
217
|
+
};
|
218
|
+
} ? C & T & {
|
219
|
+
/**
|
220
|
+
* @deprecated Use `$name` instead.
|
221
|
+
*/
|
222
|
+
name?: string;
|
223
|
+
$name?: string;
|
224
|
+
$parent?: unknown;
|
225
|
+
} : T & {
|
226
|
+
/**
|
227
|
+
* @deprecated Use `$name` instead.
|
228
|
+
*/
|
229
|
+
name?: string;
|
230
|
+
$name?: string;
|
231
|
+
$parent?: unknown;
|
232
|
+
};
|
233
|
+
|
234
|
+
export declare type Count<O> = {
|
235
|
+
[K in keyof O]: Count<number>;
|
236
|
+
} & {};
|
237
|
+
|
238
|
+
declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch;
|
239
|
+
|
240
|
+
declare class DataLoader<T = unknown> {
|
241
|
+
private options;
|
242
|
+
batches: {
|
243
|
+
[key: string]: Job[];
|
244
|
+
};
|
245
|
+
private tickActive;
|
246
|
+
constructor(options: DataLoaderOptions<T>);
|
247
|
+
request(request: T): Promise<any>;
|
248
|
+
private dispatchBatches;
|
249
|
+
get [Symbol.toStringTag](): string;
|
250
|
+
}
|
251
|
+
|
252
|
+
declare type DataLoaderOptions<T> = {
|
253
|
+
singleLoader: (request: T) => Promise<any>;
|
254
|
+
batchLoader: (request: T[]) => Promise<any[]>;
|
255
|
+
batchBy: (request: T) => string | undefined;
|
256
|
+
batchOrder: (requestA: T, requestB: T) => number;
|
257
|
+
};
|
258
|
+
|
259
|
+
declare type Datasource = {
|
260
|
+
url?: string;
|
261
|
+
};
|
262
|
+
|
263
|
+
declare type Datasources = {
|
264
|
+
[name in string]: Datasource;
|
265
|
+
};
|
266
|
+
|
267
|
+
declare class DbNull extends NullTypesEnumValue {
|
268
|
+
}
|
269
|
+
|
270
|
+
export declare const Debug: typeof debugCreate & {
|
271
|
+
enable(namespace: any): void;
|
272
|
+
disable(): any;
|
273
|
+
enabled(namespace: string): boolean;
|
274
|
+
log: (...args: string[]) => void;
|
275
|
+
formatters: {};
|
276
|
+
};
|
277
|
+
|
278
|
+
/**
|
279
|
+
* Create a new debug instance with the given namespace.
|
280
|
+
*
|
281
|
+
* @example
|
282
|
+
* ```ts
|
283
|
+
* import Debug from '@prisma/debug'
|
284
|
+
* const debug = Debug('prisma:client')
|
285
|
+
* debug('Hello World')
|
286
|
+
* ```
|
287
|
+
*/
|
288
|
+
declare function debugCreate(namespace: string): ((...args: any[]) => void) & {
|
289
|
+
color: string;
|
290
|
+
enabled: boolean;
|
291
|
+
namespace: string;
|
292
|
+
log: (...args: string[]) => void;
|
293
|
+
extend: () => void;
|
294
|
+
};
|
295
|
+
|
296
|
+
export declare namespace Decimal {
|
297
|
+
export type Constructor = typeof Decimal;
|
298
|
+
export type Instance = Decimal;
|
299
|
+
export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
300
|
+
export type Modulo = Rounding | 9;
|
301
|
+
export type Value = string | number | Decimal;
|
302
|
+
|
303
|
+
// http://mikemcl.github.io/decimal.js/#constructor-properties
|
304
|
+
export interface Config {
|
305
|
+
precision?: number;
|
306
|
+
rounding?: Rounding;
|
307
|
+
toExpNeg?: number;
|
308
|
+
toExpPos?: number;
|
309
|
+
minE?: number;
|
310
|
+
maxE?: number;
|
311
|
+
crypto?: boolean;
|
312
|
+
modulo?: Modulo;
|
313
|
+
defaults?: boolean;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
export declare class Decimal {
|
318
|
+
readonly d: number[];
|
319
|
+
readonly e: number;
|
320
|
+
readonly s: number;
|
321
|
+
|
322
|
+
constructor(n: Decimal.Value);
|
323
|
+
|
324
|
+
absoluteValue(): Decimal;
|
325
|
+
abs(): Decimal;
|
326
|
+
|
327
|
+
ceil(): Decimal;
|
328
|
+
|
329
|
+
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
|
330
|
+
clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
|
331
|
+
|
332
|
+
comparedTo(n: Decimal.Value): number;
|
333
|
+
cmp(n: Decimal.Value): number;
|
334
|
+
|
335
|
+
cosine(): Decimal;
|
336
|
+
cos(): Decimal;
|
337
|
+
|
338
|
+
cubeRoot(): Decimal;
|
339
|
+
cbrt(): Decimal;
|
340
|
+
|
341
|
+
decimalPlaces(): number;
|
342
|
+
dp(): number;
|
343
|
+
|
344
|
+
dividedBy(n: Decimal.Value): Decimal;
|
345
|
+
div(n: Decimal.Value): Decimal;
|
346
|
+
|
347
|
+
dividedToIntegerBy(n: Decimal.Value): Decimal;
|
348
|
+
divToInt(n: Decimal.Value): Decimal;
|
349
|
+
|
350
|
+
equals(n: Decimal.Value): boolean;
|
351
|
+
eq(n: Decimal.Value): boolean;
|
352
|
+
|
353
|
+
floor(): Decimal;
|
354
|
+
|
355
|
+
greaterThan(n: Decimal.Value): boolean;
|
356
|
+
gt(n: Decimal.Value): boolean;
|
357
|
+
|
358
|
+
greaterThanOrEqualTo(n: Decimal.Value): boolean;
|
359
|
+
gte(n: Decimal.Value): boolean;
|
360
|
+
|
361
|
+
hyperbolicCosine(): Decimal;
|
362
|
+
cosh(): Decimal;
|
363
|
+
|
364
|
+
hyperbolicSine(): Decimal;
|
365
|
+
sinh(): Decimal;
|
366
|
+
|
367
|
+
hyperbolicTangent(): Decimal;
|
368
|
+
tanh(): Decimal;
|
369
|
+
|
370
|
+
inverseCosine(): Decimal;
|
371
|
+
acos(): Decimal;
|
372
|
+
|
373
|
+
inverseHyperbolicCosine(): Decimal;
|
374
|
+
acosh(): Decimal;
|
375
|
+
|
376
|
+
inverseHyperbolicSine(): Decimal;
|
377
|
+
asinh(): Decimal;
|
378
|
+
|
379
|
+
inverseHyperbolicTangent(): Decimal;
|
380
|
+
atanh(): Decimal;
|
381
|
+
|
382
|
+
inverseSine(): Decimal;
|
383
|
+
asin(): Decimal;
|
384
|
+
|
385
|
+
inverseTangent(): Decimal;
|
386
|
+
atan(): Decimal;
|
387
|
+
|
388
|
+
isFinite(): boolean;
|
389
|
+
|
390
|
+
isInteger(): boolean;
|
391
|
+
isInt(): boolean;
|
392
|
+
|
393
|
+
isNaN(): boolean;
|
394
|
+
|
395
|
+
isNegative(): boolean;
|
396
|
+
isNeg(): boolean;
|
397
|
+
|
398
|
+
isPositive(): boolean;
|
399
|
+
isPos(): boolean;
|
400
|
+
|
401
|
+
isZero(): boolean;
|
402
|
+
|
403
|
+
lessThan(n: Decimal.Value): boolean;
|
404
|
+
lt(n: Decimal.Value): boolean;
|
405
|
+
|
406
|
+
lessThanOrEqualTo(n: Decimal.Value): boolean;
|
407
|
+
lte(n: Decimal.Value): boolean;
|
408
|
+
|
409
|
+
logarithm(n?: Decimal.Value): Decimal;
|
410
|
+
log(n?: Decimal.Value): Decimal;
|
411
|
+
|
412
|
+
minus(n: Decimal.Value): Decimal;
|
413
|
+
sub(n: Decimal.Value): Decimal;
|
414
|
+
|
415
|
+
modulo(n: Decimal.Value): Decimal;
|
416
|
+
mod(n: Decimal.Value): Decimal;
|
417
|
+
|
418
|
+
naturalExponential(): Decimal;
|
419
|
+
exp(): Decimal;
|
420
|
+
|
421
|
+
naturalLogarithm(): Decimal;
|
422
|
+
ln(): Decimal;
|
423
|
+
|
424
|
+
negated(): Decimal;
|
425
|
+
neg(): Decimal;
|
426
|
+
|
427
|
+
plus(n: Decimal.Value): Decimal;
|
428
|
+
add(n: Decimal.Value): Decimal;
|
429
|
+
|
430
|
+
precision(includeZeros?: boolean): number;
|
431
|
+
sd(includeZeros?: boolean): number;
|
432
|
+
|
433
|
+
round(): Decimal;
|
434
|
+
|
435
|
+
sine() : Decimal;
|
436
|
+
sin() : Decimal;
|
437
|
+
|
438
|
+
squareRoot(): Decimal;
|
439
|
+
sqrt(): Decimal;
|
440
|
+
|
441
|
+
tangent() : Decimal;
|
442
|
+
tan() : Decimal;
|
443
|
+
|
444
|
+
times(n: Decimal.Value): Decimal;
|
445
|
+
mul(n: Decimal.Value) : Decimal;
|
446
|
+
|
447
|
+
toBinary(significantDigits?: number): string;
|
448
|
+
toBinary(significantDigits: number, rounding: Decimal.Rounding): string;
|
449
|
+
|
450
|
+
toDecimalPlaces(decimalPlaces?: number): Decimal;
|
451
|
+
toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
|
452
|
+
toDP(decimalPlaces?: number): Decimal;
|
453
|
+
toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
|
454
|
+
|
455
|
+
toExponential(decimalPlaces?: number): string;
|
456
|
+
toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string;
|
457
|
+
|
458
|
+
toFixed(decimalPlaces?: number): string;
|
459
|
+
toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string;
|
460
|
+
|
461
|
+
toFraction(max_denominator?: Decimal.Value): Decimal[];
|
462
|
+
|
463
|
+
toHexadecimal(significantDigits?: number): string;
|
464
|
+
toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string;
|
465
|
+
toHex(significantDigits?: number): string;
|
466
|
+
toHex(significantDigits: number, rounding?: Decimal.Rounding): string;
|
467
|
+
|
468
|
+
toJSON(): string;
|
469
|
+
|
470
|
+
toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal;
|
471
|
+
|
472
|
+
toNumber(): number;
|
473
|
+
|
474
|
+
toOctal(significantDigits?: number): string;
|
475
|
+
toOctal(significantDigits: number, rounding: Decimal.Rounding): string;
|
476
|
+
|
477
|
+
toPower(n: Decimal.Value): Decimal;
|
478
|
+
pow(n: Decimal.Value): Decimal;
|
479
|
+
|
480
|
+
toPrecision(significantDigits?: number): string;
|
481
|
+
toPrecision(significantDigits: number, rounding: Decimal.Rounding): string;
|
482
|
+
|
483
|
+
toSignificantDigits(significantDigits?: number): Decimal;
|
484
|
+
toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal;
|
485
|
+
toSD(significantDigits?: number): Decimal;
|
486
|
+
toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal;
|
487
|
+
|
488
|
+
toString(): string;
|
489
|
+
|
490
|
+
truncated(): Decimal;
|
491
|
+
trunc(): Decimal;
|
492
|
+
|
493
|
+
valueOf(): string;
|
494
|
+
|
495
|
+
static abs(n: Decimal.Value): Decimal;
|
496
|
+
static acos(n: Decimal.Value): Decimal;
|
497
|
+
static acosh(n: Decimal.Value): Decimal;
|
498
|
+
static add(x: Decimal.Value, y: Decimal.Value): Decimal;
|
499
|
+
static asin(n: Decimal.Value): Decimal;
|
500
|
+
static asinh(n: Decimal.Value): Decimal;
|
501
|
+
static atan(n: Decimal.Value): Decimal;
|
502
|
+
static atanh(n: Decimal.Value): Decimal;
|
503
|
+
static atan2(y: Decimal.Value, x: Decimal.Value): Decimal;
|
504
|
+
static cbrt(n: Decimal.Value): Decimal;
|
505
|
+
static ceil(n: Decimal.Value): Decimal;
|
506
|
+
static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal;
|
507
|
+
static clone(object?: Decimal.Config): Decimal.Constructor;
|
508
|
+
static config(object: Decimal.Config): Decimal.Constructor;
|
509
|
+
static cos(n: Decimal.Value): Decimal;
|
510
|
+
static cosh(n: Decimal.Value): Decimal;
|
511
|
+
static div(x: Decimal.Value, y: Decimal.Value): Decimal;
|
512
|
+
static exp(n: Decimal.Value): Decimal;
|
513
|
+
static floor(n: Decimal.Value): Decimal;
|
514
|
+
static hypot(...n: Decimal.Value[]): Decimal;
|
515
|
+
static isDecimal(object: any): object is Decimal;
|
516
|
+
static ln(n: Decimal.Value): Decimal;
|
517
|
+
static log(n: Decimal.Value, base?: Decimal.Value): Decimal;
|
518
|
+
static log2(n: Decimal.Value): Decimal;
|
519
|
+
static log10(n: Decimal.Value): Decimal;
|
520
|
+
static max(...n: Decimal.Value[]): Decimal;
|
521
|
+
static min(...n: Decimal.Value[]): Decimal;
|
522
|
+
static mod(x: Decimal.Value, y: Decimal.Value): Decimal;
|
523
|
+
static mul(x: Decimal.Value, y: Decimal.Value): Decimal;
|
524
|
+
static noConflict(): Decimal.Constructor; // Browser only
|
525
|
+
static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal;
|
526
|
+
static random(significantDigits?: number): Decimal;
|
527
|
+
static round(n: Decimal.Value): Decimal;
|
528
|
+
static set(object: Decimal.Config): Decimal.Constructor;
|
529
|
+
static sign(n: Decimal.Value): number;
|
530
|
+
static sin(n: Decimal.Value): Decimal;
|
531
|
+
static sinh(n: Decimal.Value): Decimal;
|
532
|
+
static sqrt(n: Decimal.Value): Decimal;
|
533
|
+
static sub(x: Decimal.Value, y: Decimal.Value): Decimal;
|
534
|
+
static sum(...n: Decimal.Value[]): Decimal;
|
535
|
+
static tan(n: Decimal.Value): Decimal;
|
536
|
+
static tanh(n: Decimal.Value): Decimal;
|
537
|
+
static trunc(n: Decimal.Value): Decimal;
|
538
|
+
|
539
|
+
static readonly default?: Decimal.Constructor;
|
540
|
+
static readonly Decimal?: Decimal.Constructor;
|
541
|
+
|
542
|
+
static readonly precision: number;
|
543
|
+
static readonly rounding: Decimal.Rounding;
|
544
|
+
static readonly toExpNeg: number;
|
545
|
+
static readonly toExpPos: number;
|
546
|
+
static readonly minE: number;
|
547
|
+
static readonly maxE: number;
|
548
|
+
static readonly crypto: boolean;
|
549
|
+
static readonly modulo: Decimal.Modulo;
|
550
|
+
|
551
|
+
static readonly ROUND_UP: 0;
|
552
|
+
static readonly ROUND_DOWN: 1;
|
553
|
+
static readonly ROUND_CEIL: 2;
|
554
|
+
static readonly ROUND_FLOOR: 3;
|
555
|
+
static readonly ROUND_HALF_UP: 4;
|
556
|
+
static readonly ROUND_HALF_DOWN: 5;
|
557
|
+
static readonly ROUND_HALF_EVEN: 6;
|
558
|
+
static readonly ROUND_HALF_CEIL: 7;
|
559
|
+
static readonly ROUND_HALF_FLOOR: 8;
|
560
|
+
static readonly EUCLID: 9;
|
561
|
+
}
|
562
|
+
|
563
|
+
/**
|
564
|
+
* Interface for any Decimal.js-like library
|
565
|
+
* Allows us to accept Decimal.js from different
|
566
|
+
* versions and some compatible alternatives
|
567
|
+
*/
|
568
|
+
export declare interface DecimalJsLike {
|
569
|
+
d: number[];
|
570
|
+
e: number;
|
571
|
+
s: number;
|
572
|
+
toFixed(): string;
|
573
|
+
}
|
574
|
+
|
575
|
+
export declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>;
|
576
|
+
|
577
|
+
export declare type DefaultSelection<P> = UnwrapPayload<{
|
578
|
+
default: P;
|
579
|
+
}>['default'];
|
580
|
+
|
581
|
+
export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void;
|
582
|
+
|
583
|
+
declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Client)): (client: Client) => Client;
|
584
|
+
|
585
|
+
declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"];
|
586
|
+
|
587
|
+
export declare type DevTypeMapDef = {
|
588
|
+
meta: {
|
589
|
+
modelProps: string;
|
590
|
+
};
|
591
|
+
model: {
|
592
|
+
[Model in PropertyKey]: {
|
593
|
+
[Operation in PropertyKey]: DevTypeMapFnDef;
|
594
|
+
};
|
595
|
+
};
|
596
|
+
other: {
|
597
|
+
[Operation in PropertyKey]: DevTypeMapFnDef;
|
598
|
+
};
|
599
|
+
};
|
600
|
+
|
601
|
+
export declare type DevTypeMapFnDef = {
|
602
|
+
args: any;
|
603
|
+
result: any;
|
604
|
+
payload: OperationPayload;
|
605
|
+
};
|
606
|
+
|
607
|
+
export declare namespace DMMF {
|
608
|
+
export type Document = ReadonlyDeep_2<{
|
609
|
+
datamodel: Datamodel;
|
610
|
+
schema: Schema;
|
611
|
+
mappings: Mappings;
|
612
|
+
}>;
|
613
|
+
export type Mappings = ReadonlyDeep_2<{
|
614
|
+
modelOperations: ModelMapping[];
|
615
|
+
otherOperations: {
|
616
|
+
read: string[];
|
617
|
+
write: string[];
|
618
|
+
};
|
619
|
+
}>;
|
620
|
+
export type OtherOperationMappings = ReadonlyDeep_2<{
|
621
|
+
read: string[];
|
622
|
+
write: string[];
|
623
|
+
}>;
|
624
|
+
export type DatamodelEnum = ReadonlyDeep_2<{
|
625
|
+
name: string;
|
626
|
+
values: EnumValue[];
|
627
|
+
dbName?: string | null;
|
628
|
+
documentation?: string;
|
629
|
+
}>;
|
630
|
+
export type SchemaEnum = ReadonlyDeep_2<{
|
631
|
+
name: string;
|
632
|
+
values: string[];
|
633
|
+
}>;
|
634
|
+
export type EnumValue = ReadonlyDeep_2<{
|
635
|
+
name: string;
|
636
|
+
dbName: string | null;
|
637
|
+
}>;
|
638
|
+
export type Datamodel = ReadonlyDeep_2<{
|
639
|
+
models: Model[];
|
640
|
+
enums: DatamodelEnum[];
|
641
|
+
types: Model[];
|
642
|
+
}>;
|
643
|
+
export type uniqueIndex = ReadonlyDeep_2<{
|
644
|
+
name: string;
|
645
|
+
fields: string[];
|
646
|
+
}>;
|
647
|
+
export type PrimaryKey = ReadonlyDeep_2<{
|
648
|
+
name: string | null;
|
649
|
+
fields: string[];
|
650
|
+
}>;
|
651
|
+
export type Model = ReadonlyDeep_2<{
|
652
|
+
name: string;
|
653
|
+
dbName: string | null;
|
654
|
+
fields: Field[];
|
655
|
+
uniqueFields: string[][];
|
656
|
+
uniqueIndexes: uniqueIndex[];
|
657
|
+
documentation?: string;
|
658
|
+
primaryKey: PrimaryKey | null;
|
659
|
+
isGenerated?: boolean;
|
660
|
+
}>;
|
661
|
+
export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
|
662
|
+
export type FieldNamespace = 'model' | 'prisma';
|
663
|
+
export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes';
|
664
|
+
export type Field = ReadonlyDeep_2<{
|
665
|
+
kind: FieldKind;
|
666
|
+
name: string;
|
667
|
+
isRequired: boolean;
|
668
|
+
isList: boolean;
|
669
|
+
isUnique: boolean;
|
670
|
+
isId: boolean;
|
671
|
+
isReadOnly: boolean;
|
672
|
+
isGenerated?: boolean;
|
673
|
+
isUpdatedAt?: boolean;
|
674
|
+
/**
|
675
|
+
* Describes the data type in the same the way it is defined in the Prisma schema:
|
676
|
+
* BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
|
677
|
+
*/
|
678
|
+
type: string;
|
679
|
+
dbName?: string | null;
|
680
|
+
hasDefaultValue: boolean;
|
681
|
+
default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[];
|
682
|
+
relationFromFields?: string[];
|
683
|
+
relationToFields?: string[];
|
684
|
+
relationOnDelete?: string;
|
685
|
+
relationName?: string;
|
686
|
+
documentation?: string;
|
687
|
+
}>;
|
688
|
+
export type FieldDefault = ReadonlyDeep_2<{
|
689
|
+
name: string;
|
690
|
+
args: any[];
|
691
|
+
}>;
|
692
|
+
export type FieldDefaultScalar = string | boolean | number;
|
693
|
+
export type Schema = ReadonlyDeep_2<{
|
694
|
+
rootQueryType?: string;
|
695
|
+
rootMutationType?: string;
|
696
|
+
inputObjectTypes: {
|
697
|
+
model?: InputType[];
|
698
|
+
prisma: InputType[];
|
699
|
+
};
|
700
|
+
outputObjectTypes: {
|
701
|
+
model: OutputType[];
|
702
|
+
prisma: OutputType[];
|
703
|
+
};
|
704
|
+
enumTypes: {
|
705
|
+
model?: SchemaEnum[];
|
706
|
+
prisma: SchemaEnum[];
|
707
|
+
};
|
708
|
+
fieldRefTypes: {
|
709
|
+
prisma?: FieldRefType[];
|
710
|
+
};
|
711
|
+
}>;
|
712
|
+
export type Query = ReadonlyDeep_2<{
|
713
|
+
name: string;
|
714
|
+
args: SchemaArg[];
|
715
|
+
output: QueryOutput;
|
716
|
+
}>;
|
717
|
+
export type QueryOutput = ReadonlyDeep_2<{
|
718
|
+
name: string;
|
719
|
+
isRequired: boolean;
|
720
|
+
isList: boolean;
|
721
|
+
}>;
|
722
|
+
export type TypeRef<AllowedLocations extends FieldLocation> = {
|
723
|
+
isList: boolean;
|
724
|
+
type: string;
|
725
|
+
location: AllowedLocations;
|
726
|
+
namespace?: FieldNamespace;
|
727
|
+
};
|
728
|
+
export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>;
|
729
|
+
export type SchemaArg = ReadonlyDeep_2<{
|
730
|
+
name: string;
|
731
|
+
comment?: string;
|
732
|
+
isNullable: boolean;
|
733
|
+
isRequired: boolean;
|
734
|
+
inputTypes: InputTypeRef[];
|
735
|
+
deprecation?: Deprecation;
|
736
|
+
}>;
|
737
|
+
export type OutputType = ReadonlyDeep_2<{
|
738
|
+
name: string;
|
739
|
+
fields: SchemaField[];
|
740
|
+
}>;
|
741
|
+
export type SchemaField = ReadonlyDeep_2<{
|
742
|
+
name: string;
|
743
|
+
isNullable?: boolean;
|
744
|
+
outputType: OutputTypeRef;
|
745
|
+
args: SchemaArg[];
|
746
|
+
deprecation?: Deprecation;
|
747
|
+
documentation?: string;
|
748
|
+
}>;
|
749
|
+
export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>;
|
750
|
+
export type Deprecation = ReadonlyDeep_2<{
|
751
|
+
sinceVersion: string;
|
752
|
+
reason: string;
|
753
|
+
plannedRemovalVersion?: string;
|
754
|
+
}>;
|
755
|
+
export type InputType = ReadonlyDeep_2<{
|
756
|
+
name: string;
|
757
|
+
constraints: {
|
758
|
+
maxNumFields: number | null;
|
759
|
+
minNumFields: number | null;
|
760
|
+
fields?: string[];
|
761
|
+
};
|
762
|
+
meta?: {
|
763
|
+
source?: string;
|
764
|
+
};
|
765
|
+
fields: SchemaArg[];
|
766
|
+
}>;
|
767
|
+
export type FieldRefType = ReadonlyDeep_2<{
|
768
|
+
name: string;
|
769
|
+
allowTypes: FieldRefAllowType[];
|
770
|
+
fields: SchemaArg[];
|
771
|
+
}>;
|
772
|
+
export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>;
|
773
|
+
export type ModelMapping = ReadonlyDeep_2<{
|
774
|
+
model: string;
|
775
|
+
plural: string;
|
776
|
+
findUnique?: string | null;
|
777
|
+
findUniqueOrThrow?: string | null;
|
778
|
+
findFirst?: string | null;
|
779
|
+
findFirstOrThrow?: string | null;
|
780
|
+
findMany?: string | null;
|
781
|
+
create?: string | null;
|
782
|
+
createMany?: string | null;
|
783
|
+
createManyAndReturn?: string | null;
|
784
|
+
update?: string | null;
|
785
|
+
updateMany?: string | null;
|
786
|
+
upsert?: string | null;
|
787
|
+
delete?: string | null;
|
788
|
+
deleteMany?: string | null;
|
789
|
+
aggregate?: string | null;
|
790
|
+
groupBy?: string | null;
|
791
|
+
count?: string | null;
|
792
|
+
findRaw?: string | null;
|
793
|
+
aggregateRaw?: string | null;
|
794
|
+
}>;
|
795
|
+
export enum ModelAction {
|
796
|
+
findUnique = "findUnique",
|
797
|
+
findUniqueOrThrow = "findUniqueOrThrow",
|
798
|
+
findFirst = "findFirst",
|
799
|
+
findFirstOrThrow = "findFirstOrThrow",
|
800
|
+
findMany = "findMany",
|
801
|
+
create = "create",
|
802
|
+
createMany = "createMany",
|
803
|
+
createManyAndReturn = "createManyAndReturn",
|
804
|
+
update = "update",
|
805
|
+
updateMany = "updateMany",
|
806
|
+
upsert = "upsert",
|
807
|
+
delete = "delete",
|
808
|
+
deleteMany = "deleteMany",
|
809
|
+
groupBy = "groupBy",
|
810
|
+
count = "count",// TODO: count does not actually exist, why?
|
811
|
+
aggregate = "aggregate",
|
812
|
+
findRaw = "findRaw",
|
813
|
+
aggregateRaw = "aggregateRaw"
|
814
|
+
}
|
815
|
+
}
|
816
|
+
|
817
|
+
export declare interface DriverAdapter extends Queryable {
|
818
|
+
/**
|
819
|
+
* Starts new transaction.
|
820
|
+
*/
|
821
|
+
startTransaction(): Promise<Result_4<Transaction>>;
|
822
|
+
/**
|
823
|
+
* Optional method that returns extra connection info
|
824
|
+
*/
|
825
|
+
getConnectionInfo?(): Result_4<ConnectionInfo>;
|
826
|
+
}
|
827
|
+
|
828
|
+
/** Client */
|
829
|
+
export declare type DynamicClientExtensionArgs<C_, TypeMap extends TypeMapDef, TypeMapCb extends TypeMapCbDef, ExtArgs extends Record<string, any>> = {
|
830
|
+
[P in keyof C_]: unknown;
|
831
|
+
} & {
|
832
|
+
[K: symbol]: {
|
833
|
+
ctx: Optional<DynamicClientExtensionThis<TypeMap, TypeMapCb, ExtArgs>, ITXClientDenyList> & {
|
834
|
+
$parent: Optional<DynamicClientExtensionThis<TypeMap, TypeMapCb, ExtArgs>, ITXClientDenyList>;
|
835
|
+
};
|
836
|
+
};
|
837
|
+
};
|
838
|
+
|
839
|
+
export declare type DynamicClientExtensionThis<TypeMap extends TypeMapDef, TypeMapCb extends TypeMapCbDef, ExtArgs extends Record<string, any>> = {
|
840
|
+
[P in keyof ExtArgs['client']]: Return<ExtArgs['client'][P]>;
|
841
|
+
} & {
|
842
|
+
[P in Exclude<TypeMap['meta']['modelProps'], keyof ExtArgs['client']>]: DynamicModelExtensionThis<TypeMap, ModelKey<TypeMap, P>, ExtArgs>;
|
843
|
+
} & {
|
844
|
+
[P in Exclude<keyof TypeMap['other']['operations'], keyof ExtArgs['client']>]: <R = GetResult<TypeMap['other']['payload'], any, P & Operation>>(...args: ToTuple<TypeMap['other']['operations'][P]['args']>) => PrismaPromise<R>;
|
845
|
+
} & {
|
846
|
+
[P in Exclude<ClientBuiltInProp, keyof ExtArgs['client']>]: DynamicClientExtensionThisBuiltin<TypeMap, TypeMapCb, ExtArgs>[P];
|
847
|
+
} & {
|
848
|
+
[K: symbol]: {
|
849
|
+
types: TypeMap['other'];
|
850
|
+
};
|
851
|
+
};
|
852
|
+
|
853
|
+
export declare type DynamicClientExtensionThisBuiltin<TypeMap extends TypeMapDef, TypeMapCb extends TypeMapCbDef, ExtArgs extends Record<string, any>> = {
|
854
|
+
$extends: ExtendsHook<'extends', TypeMapCb, ExtArgs>;
|
855
|
+
$transaction<P extends PrismaPromise<any>[]>(arg: [...P], options?: {
|
856
|
+
isolationLevel?: TypeMap['meta']['txIsolationLevel'];
|
857
|
+
}): Promise<UnwrapTuple<P>>;
|
858
|
+
$transaction<R>(fn: (client: Omit<DynamicClientExtensionThis<TypeMap, TypeMapCb, ExtArgs>, ITXClientDenyList>) => Promise<R>, options?: {
|
859
|
+
maxWait?: number;
|
860
|
+
timeout?: number;
|
861
|
+
isolationLevel?: TypeMap['meta']['txIsolationLevel'];
|
862
|
+
}): Promise<R>;
|
863
|
+
$disconnect(): Promise<void>;
|
864
|
+
$connect(): Promise<void>;
|
865
|
+
};
|
866
|
+
|
867
|
+
/** Model */
|
868
|
+
export declare type DynamicModelExtensionArgs<M_, TypeMap extends TypeMapDef, TypeMapCb extends TypeMapCbDef, ExtArgs extends Record<string, any>> = {
|
869
|
+
[K in keyof M_]: K extends '$allModels' ? {
|
870
|
+
[P in keyof M_[K]]?: unknown;
|
871
|
+
} & {
|
872
|
+
[K: symbol]: {};
|
873
|
+
} : K extends TypeMap['meta']['modelProps'] ? {
|
874
|
+
[P in keyof M_[K]]?: unknown;
|
875
|
+
} & {
|
876
|
+
[K: symbol]: {
|
877
|
+
ctx: DynamicModelExtensionThis<TypeMap, ModelKey<TypeMap, K>, ExtArgs> & {
|
878
|
+
$parent: DynamicClientExtensionThis<TypeMap, TypeMapCb, ExtArgs>;
|
879
|
+
} & {
|
880
|
+
$name: ModelKey<TypeMap, K>;
|
881
|
+
} & {
|
882
|
+
/**
|
883
|
+
* @deprecated Use `$name` instead.
|
884
|
+
*/
|
885
|
+
name: ModelKey<TypeMap, K>;
|
886
|
+
};
|
887
|
+
};
|
888
|
+
} : never;
|
889
|
+
};
|
890
|
+
|
891
|
+
export declare type DynamicModelExtensionFluentApi<TypeMap extends TypeMapDef, M extends PropertyKey, P extends PropertyKey, Null> = {
|
892
|
+
[K in keyof TypeMap['model'][M]['payload']['objects']]: <A>(args?: Exact<A, Path<TypeMap['model'][M]['operations'][P]['args']['select'], [K]>>) => PrismaPromise<Path<DynamicModelExtensionFnResultBase<TypeMap, M, {
|
893
|
+
select: {
|
894
|
+
[P in K]: A;
|
895
|
+
};
|
896
|
+
}, P>, [K]> | Null> & DynamicModelExtensionFluentApi<TypeMap, (TypeMap['model'][M]['payload']['objects'][K] & {})['name'], P, Null | Select<TypeMap['model'][M]['payload']['objects'][K], null>>;
|
897
|
+
};
|
898
|
+
|
899
|
+
export declare type DynamicModelExtensionFnResult<TypeMap extends TypeMapDef, M extends PropertyKey, A, P extends PropertyKey, Null = DynamicModelExtensionFnResultNull<P>> = P extends FluentOperation ? DynamicModelExtensionFluentApi<TypeMap, M, P, Null> & PrismaPromise<DynamicModelExtensionFnResultBase<TypeMap, M, A, P> | Null> : PrismaPromise<DynamicModelExtensionFnResultBase<TypeMap, M, A, P>>;
|
900
|
+
|
901
|
+
export declare type DynamicModelExtensionFnResultBase<TypeMap extends TypeMapDef, M extends PropertyKey, A, P extends PropertyKey> = GetResult<TypeMap['model'][M]['payload'], A, P & Operation>;
|
902
|
+
|
903
|
+
export declare type DynamicModelExtensionFnResultNull<P extends PropertyKey> = P extends 'findUnique' | 'findFirst' ? null : never;
|
904
|
+
|
905
|
+
export declare type DynamicModelExtensionOperationFn<TypeMap extends TypeMapDef, M extends PropertyKey, P extends PropertyKey> = {} extends TypeMap['model'][M]['operations'][P]['args'] ? <A extends TypeMap['model'][M]['operations'][P]['args']>(args?: Exact<A, TypeMap['model'][M]['operations'][P]['args']>) => DynamicModelExtensionFnResult<TypeMap, M, A, P> : <A extends TypeMap['model'][M]['operations'][P]['args']>(args: Exact<A, TypeMap['model'][M]['operations'][P]['args']>) => DynamicModelExtensionFnResult<TypeMap, M, A, P>;
|
906
|
+
|
907
|
+
export declare type DynamicModelExtensionThis<TypeMap extends TypeMapDef, M extends PropertyKey, ExtArgs extends Record<string, any>> = {
|
908
|
+
[P in keyof ExtArgs['model'][Uncapitalize<M & string>]]: Return<ExtArgs['model'][Uncapitalize<M & string>][P]>;
|
909
|
+
} & {
|
910
|
+
[P in Exclude<keyof TypeMap['model'][M]['operations'], keyof ExtArgs['model'][Uncapitalize<M & string>]>]: DynamicModelExtensionOperationFn<TypeMap, M, P>;
|
911
|
+
} & {
|
912
|
+
[P in Exclude<'fields', keyof ExtArgs['model'][Uncapitalize<M & string>]>]: TypeMap['model'][M]['fields'];
|
913
|
+
} & {
|
914
|
+
[K: symbol]: {
|
915
|
+
types: TypeMap['model'][M];
|
916
|
+
};
|
917
|
+
};
|
918
|
+
|
919
|
+
/** Query */
|
920
|
+
export declare type DynamicQueryExtensionArgs<Q_, TypeMap extends TypeMapDef> = {
|
921
|
+
[K in keyof Q_]: K extends '$allOperations' ? (args: {
|
922
|
+
model?: string;
|
923
|
+
operation: string;
|
924
|
+
args: any;
|
925
|
+
query: (args: any) => PrismaPromise<any>;
|
926
|
+
}) => Promise<any> : K extends '$allModels' ? {
|
927
|
+
[P in keyof Q_[K] | keyof TypeMap['model'][keyof TypeMap['model']]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb<TypeMap, 'model', keyof TypeMap['model'], keyof TypeMap['model'][keyof TypeMap['model']]['operations']> : P extends keyof TypeMap['model'][keyof TypeMap['model']]['operations'] ? DynamicQueryExtensionCb<TypeMap, 'model', keyof TypeMap['model'], P> : never;
|
928
|
+
} : K extends TypeMap['meta']['modelProps'] ? {
|
929
|
+
[P in keyof Q_[K] | keyof TypeMap['model'][ModelKey<TypeMap, K>]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb<TypeMap, 'model', ModelKey<TypeMap, K>, keyof TypeMap['model'][ModelKey<TypeMap, K>]['operations']> : P extends keyof TypeMap['model'][ModelKey<TypeMap, K>]['operations'] ? DynamicQueryExtensionCb<TypeMap, 'model', ModelKey<TypeMap, K>, P> : never;
|
930
|
+
} : K extends keyof TypeMap['other']['operations'] ? DynamicQueryExtensionCb<[TypeMap], 0, 'other', K> : never;
|
931
|
+
};
|
932
|
+
|
933
|
+
export declare type DynamicQueryExtensionCb<TypeMap extends TypeMapDef, _0 extends PropertyKey, _1 extends PropertyKey, _2 extends PropertyKey> = <A extends DynamicQueryExtensionCbArgs<TypeMap, _0, _1, _2>>(args: A) => Promise<TypeMap[_0][_1][_2]['result']>;
|
934
|
+
|
935
|
+
export declare type DynamicQueryExtensionCbArgs<TypeMap extends TypeMapDef, _0 extends PropertyKey, _1 extends PropertyKey, _2 extends PropertyKey> = (_1 extends unknown ? _2 extends unknown ? {
|
936
|
+
args: DynamicQueryExtensionCbArgsArgs<TypeMap, _0, _1, _2>;
|
937
|
+
model: _0 extends 0 ? undefined : _1;
|
938
|
+
operation: _2;
|
939
|
+
query: <A extends DynamicQueryExtensionCbArgsArgs<TypeMap, _0, _1, _2>>(args: A) => PrismaPromise<TypeMap[_0][_1]['operations'][_2]['result']>;
|
940
|
+
} : never : never) & {
|
941
|
+
query: (args: DynamicQueryExtensionCbArgsArgs<TypeMap, _0, _1, _2>) => PrismaPromise<TypeMap[_0][_1]['operations'][_2]['result']>;
|
942
|
+
};
|
943
|
+
|
944
|
+
export declare type DynamicQueryExtensionCbArgsArgs<TypeMap extends TypeMapDef, _0 extends PropertyKey, _1 extends PropertyKey, _2 extends PropertyKey> = _2 extends '$queryRaw' | '$executeRaw' ? Sql : TypeMap[_0][_1]['operations'][_2]['args'];
|
945
|
+
|
946
|
+
/** Result */
|
947
|
+
export declare type DynamicResultExtensionArgs<R_, TypeMap extends TypeMapDef> = {
|
948
|
+
[K in keyof R_]: {
|
949
|
+
[P in keyof R_[K]]?: {
|
950
|
+
needs?: DynamicResultExtensionNeeds<TypeMap, ModelKey<TypeMap, K>, R_[K][P]>;
|
951
|
+
compute(data: DynamicResultExtensionData<TypeMap, ModelKey<TypeMap, K>, R_[K][P]>): any;
|
952
|
+
};
|
953
|
+
};
|
954
|
+
};
|
955
|
+
|
956
|
+
export declare type DynamicResultExtensionData<TypeMap extends TypeMapDef, M extends PropertyKey, S> = GetFindResult<TypeMap['model'][M]['payload'], {
|
957
|
+
select: S;
|
958
|
+
}>;
|
959
|
+
|
960
|
+
export declare type DynamicResultExtensionNeeds<TypeMap extends TypeMapDef, M extends PropertyKey, S> = {
|
961
|
+
[K in keyof S]: K extends keyof TypeMap['model'][M]['payload']['scalars'] ? S[K] : never;
|
962
|
+
} & {
|
963
|
+
[N in keyof TypeMap['model'][M]['payload']['scalars']]?: boolean;
|
964
|
+
};
|
965
|
+
|
966
|
+
/**
|
967
|
+
* Placeholder value for "no text".
|
968
|
+
*/
|
969
|
+
export declare const empty: Sql;
|
970
|
+
|
971
|
+
export declare type EmptyToUnknown<T> = T;
|
972
|
+
|
973
|
+
declare interface Engine<InteractiveTransactionPayload = unknown> {
|
974
|
+
/** The name of the engine. This is meant to be consumed externally */
|
975
|
+
readonly name: string;
|
976
|
+
onBeforeExit(callback: () => Promise<void>): void;
|
977
|
+
start(): Promise<void>;
|
978
|
+
stop(): Promise<void>;
|
979
|
+
version(forceRun?: boolean): Promise<string> | string;
|
980
|
+
request<T>(query: JsonQuery, options: RequestOptions_2<InteractiveTransactionPayload>): Promise<QueryEngineResult<T>>;
|
981
|
+
requestBatch<T>(queries: JsonQuery[], options: RequestBatchOptions<InteractiveTransactionPayload>): Promise<BatchQueryEngineResult<T>[]>;
|
982
|
+
transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise<Transaction_2.InteractiveTransactionInfo<unknown>>;
|
983
|
+
transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo<unknown>): Promise<void>;
|
984
|
+
transaction(action: 'rollback', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo<unknown>): Promise<void>;
|
985
|
+
metrics(options: MetricsOptionsJson): Promise<Metrics>;
|
986
|
+
metrics(options: MetricsOptionsPrometheus): Promise<string>;
|
987
|
+
applyPendingMigrations(): Promise<void>;
|
988
|
+
}
|
989
|
+
|
990
|
+
declare interface EngineConfig {
|
991
|
+
cwd: string;
|
992
|
+
dirname: string;
|
993
|
+
datamodelPath: string;
|
994
|
+
enableDebugLogs?: boolean;
|
995
|
+
allowTriggerPanic?: boolean;
|
996
|
+
prismaPath?: string;
|
997
|
+
generator?: GeneratorConfig;
|
998
|
+
overrideDatasources: Datasources;
|
999
|
+
showColors?: boolean;
|
1000
|
+
logQueries?: boolean;
|
1001
|
+
logLevel?: 'info' | 'warn';
|
1002
|
+
env: Record<string, string>;
|
1003
|
+
flags?: string[];
|
1004
|
+
clientVersion: string;
|
1005
|
+
engineVersion: string;
|
1006
|
+
previewFeatures?: string[];
|
1007
|
+
engineEndpoint?: string;
|
1008
|
+
activeProvider?: string;
|
1009
|
+
logEmitter: LogEmitter;
|
1010
|
+
transactionOptions: Transaction_2.Options;
|
1011
|
+
/**
|
1012
|
+
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`.
|
1013
|
+
* If set, this is only used in the library engine, and all queries would be performed through it,
|
1014
|
+
* rather than Prisma's Rust drivers.
|
1015
|
+
* @remarks only used by LibraryEngine.ts
|
1016
|
+
*/
|
1017
|
+
adapter?: ErrorCapturingDriverAdapter;
|
1018
|
+
/**
|
1019
|
+
* The contents of the schema encoded into a string
|
1020
|
+
* @remarks only used by DataProxyEngine.ts
|
1021
|
+
*/
|
1022
|
+
inlineSchema: string;
|
1023
|
+
/**
|
1024
|
+
* The contents of the datasource url saved in a string
|
1025
|
+
* @remarks only used by DataProxyEngine.ts
|
1026
|
+
*/
|
1027
|
+
inlineDatasources: GetPrismaClientConfig['inlineDatasources'];
|
1028
|
+
/**
|
1029
|
+
* The string hash that was produced for a given schema
|
1030
|
+
* @remarks only used by DataProxyEngine.ts
|
1031
|
+
*/
|
1032
|
+
inlineSchemaHash: string;
|
1033
|
+
/**
|
1034
|
+
* The helper for interaction with OTEL tracing
|
1035
|
+
* @remarks enabling is determined by the client and @prisma/instrumentation package
|
1036
|
+
*/
|
1037
|
+
tracingHelper: TracingHelper;
|
1038
|
+
/**
|
1039
|
+
* Information about whether we have not found a schema.prisma file in the
|
1040
|
+
* default location, and that we fell back to finding the schema.prisma file
|
1041
|
+
* in the current working directory. This usually means it has been bundled.
|
1042
|
+
*/
|
1043
|
+
isBundled?: boolean;
|
1044
|
+
/**
|
1045
|
+
* Web Assembly module loading configuration
|
1046
|
+
*/
|
1047
|
+
engineWasm?: WasmLoadingConfig;
|
1048
|
+
/**
|
1049
|
+
* Allows Accelerate to use runtime utilities from the client. These are
|
1050
|
+
* necessary for the AccelerateEngine to function correctly.
|
1051
|
+
*/
|
1052
|
+
accelerateUtils?: {
|
1053
|
+
resolveDatasourceUrl: typeof resolveDatasourceUrl;
|
1054
|
+
getBatchRequestPayload: typeof getBatchRequestPayload;
|
1055
|
+
prismaGraphQLToJSError: typeof prismaGraphQLToJSError;
|
1056
|
+
PrismaClientUnknownRequestError: typeof PrismaClientUnknownRequestError;
|
1057
|
+
PrismaClientInitializationError: typeof PrismaClientInitializationError;
|
1058
|
+
PrismaClientKnownRequestError: typeof PrismaClientKnownRequestError;
|
1059
|
+
debug: (...args: any[]) => void;
|
1060
|
+
engineVersion: string;
|
1061
|
+
clientVersion: string;
|
1062
|
+
};
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
declare type EngineEvent<E extends EngineEventType> = E extends QueryEventType ? QueryEvent : LogEvent;
|
1066
|
+
|
1067
|
+
declare type EngineEventType = QueryEventType | LogEventType;
|
1068
|
+
|
1069
|
+
declare type EngineProtocol = 'graphql' | 'json';
|
1070
|
+
|
1071
|
+
declare type EngineSpan = {
|
1072
|
+
span: boolean;
|
1073
|
+
name: string;
|
1074
|
+
trace_id: string;
|
1075
|
+
span_id: string;
|
1076
|
+
parent_span_id: string;
|
1077
|
+
start_time: [number, number];
|
1078
|
+
end_time: [number, number];
|
1079
|
+
attributes?: Record<string, string>;
|
1080
|
+
links?: {
|
1081
|
+
trace_id: string;
|
1082
|
+
span_id: string;
|
1083
|
+
}[];
|
1084
|
+
};
|
1085
|
+
|
1086
|
+
declare type EngineSpanEvent = {
|
1087
|
+
span: boolean;
|
1088
|
+
spans: EngineSpan[];
|
1089
|
+
};
|
1090
|
+
|
1091
|
+
declare interface EnvValue {
|
1092
|
+
fromEnvVar: null | string;
|
1093
|
+
value: null | string;
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
export declare type Equals<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? 1 : 0;
|
1097
|
+
|
1098
|
+
declare type Error_2 = {
|
1099
|
+
kind: 'GenericJs';
|
1100
|
+
id: number;
|
1101
|
+
} | {
|
1102
|
+
kind: 'UnsupportedNativeDataType';
|
1103
|
+
type: string;
|
1104
|
+
} | {
|
1105
|
+
kind: 'Postgres';
|
1106
|
+
code: string;
|
1107
|
+
severity: string;
|
1108
|
+
message: string;
|
1109
|
+
detail: string | undefined;
|
1110
|
+
column: string | undefined;
|
1111
|
+
hint: string | undefined;
|
1112
|
+
} | {
|
1113
|
+
kind: 'Mysql';
|
1114
|
+
code: number;
|
1115
|
+
message: string;
|
1116
|
+
state: string;
|
1117
|
+
} | {
|
1118
|
+
kind: 'Sqlite';
|
1119
|
+
/**
|
1120
|
+
* Sqlite extended error code: https://www.sqlite.org/rescode.html
|
1121
|
+
*/
|
1122
|
+
extendedCode: number;
|
1123
|
+
message: string;
|
1124
|
+
};
|
1125
|
+
|
1126
|
+
declare interface ErrorCapturingDriverAdapter extends DriverAdapter {
|
1127
|
+
readonly errorRegistry: ErrorRegistry;
|
1128
|
+
}
|
1129
|
+
|
1130
|
+
declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal';
|
1131
|
+
|
1132
|
+
declare type ErrorRecord = {
|
1133
|
+
error: unknown;
|
1134
|
+
};
|
1135
|
+
|
1136
|
+
declare interface ErrorRegistry {
|
1137
|
+
consumeError(id: number): ErrorRecord | undefined;
|
1138
|
+
}
|
1139
|
+
|
1140
|
+
declare interface ErrorWithBatchIndex {
|
1141
|
+
batchRequestIdx?: number;
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
declare type EventCallback<E extends ExtendedEventType> = [E] extends ['beforeExit'] ? () => Promise<void> : [E] extends [LogLevel] ? (event: EngineEvent<E>) => void : never;
|
1145
|
+
|
1146
|
+
export declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
|
1147
|
+
[K in keyof A]: Exact<A[K], W[K]>;
|
1148
|
+
} : W) : never) | (A extends Narrowable ? A : never);
|
1149
|
+
|
1150
|
+
/**
|
1151
|
+
* Defines Exception.
|
1152
|
+
*
|
1153
|
+
* string or an object with one of (message or name or code) and optional stack
|
1154
|
+
*/
|
1155
|
+
declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
|
1156
|
+
|
1157
|
+
declare interface ExceptionWithCode {
|
1158
|
+
code: string | number;
|
1159
|
+
name?: string;
|
1160
|
+
message?: string;
|
1161
|
+
stack?: string;
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
declare interface ExceptionWithMessage {
|
1165
|
+
code?: string | number;
|
1166
|
+
message: string;
|
1167
|
+
name?: string;
|
1168
|
+
stack?: string;
|
1169
|
+
}
|
1170
|
+
|
1171
|
+
declare interface ExceptionWithName {
|
1172
|
+
code?: string | number;
|
1173
|
+
message?: string;
|
1174
|
+
name: string;
|
1175
|
+
stack?: string;
|
1176
|
+
}
|
1177
|
+
|
1178
|
+
declare type ExtendedEventType = LogLevel | 'beforeExit';
|
1179
|
+
|
1180
|
+
declare type ExtendedSpanOptions = SpanOptions & {
|
1181
|
+
/** The name of the span */
|
1182
|
+
name: string;
|
1183
|
+
internal?: boolean;
|
1184
|
+
middleware?: boolean;
|
1185
|
+
/** Whether it propagates context (?=true) */
|
1186
|
+
active?: boolean;
|
1187
|
+
/** The context to append the span to */
|
1188
|
+
context?: Context;
|
1189
|
+
};
|
1190
|
+
|
1191
|
+
/** $extends, defineExtension */
|
1192
|
+
export declare interface ExtendsHook<Variant extends 'extends' | 'define', TypeMapCb extends TypeMapCbDef, ExtArgs extends Record<string, any>, TypeMap extends TypeMapDef = Call<TypeMapCb, {
|
1193
|
+
extArgs: ExtArgs;
|
1194
|
+
}>> {
|
1195
|
+
extArgs: ExtArgs;
|
1196
|
+
<R_ extends {
|
1197
|
+
[K in TypeMap['meta']['modelProps'] | '$allModels']?: unknown;
|
1198
|
+
}, R, M_ extends {
|
1199
|
+
[K in TypeMap['meta']['modelProps'] | '$allModels']?: unknown;
|
1200
|
+
}, M, Q_ extends {
|
1201
|
+
[K in TypeMap['meta']['modelProps'] | '$allModels' | keyof TypeMap['other']['operations'] | '$allOperations']?: unknown;
|
1202
|
+
}, C_ extends {
|
1203
|
+
[K in string]?: unknown;
|
1204
|
+
}, C, Args extends InternalArgs = InternalArgs<R, M, {}, C>, MergedArgs extends InternalArgs = MergeExtArgs<TypeMap, ExtArgs, Args>>(extension: ((client: DynamicClientExtensionThis<TypeMap, TypeMapCb, ExtArgs>) => {
|
1205
|
+
$extends: {
|
1206
|
+
extArgs: Args;
|
1207
|
+
};
|
1208
|
+
}) | {
|
1209
|
+
name?: string;
|
1210
|
+
query?: DynamicQueryExtensionArgs<Q_, TypeMap>;
|
1211
|
+
result?: DynamicResultExtensionArgs<R_, TypeMap> & R;
|
1212
|
+
model?: DynamicModelExtensionArgs<M_, TypeMap, TypeMapCb, ExtArgs> & M;
|
1213
|
+
client?: DynamicClientExtensionArgs<C_, TypeMap, TypeMapCb, ExtArgs> & C;
|
1214
|
+
}): {
|
1215
|
+
extends: DynamicClientExtensionThis<Call<TypeMapCb, {
|
1216
|
+
extArgs: MergedArgs;
|
1217
|
+
}>, TypeMapCb, MergedArgs>;
|
1218
|
+
define: (client: any) => {
|
1219
|
+
$extends: {
|
1220
|
+
extArgs: Args;
|
1221
|
+
};
|
1222
|
+
};
|
1223
|
+
}[Variant];
|
1224
|
+
}
|
1225
|
+
|
1226
|
+
export declare type ExtensionArgs = Optional<RequiredExtensionArgs>;
|
1227
|
+
|
1228
|
+
declare namespace Extensions {
|
1229
|
+
export {
|
1230
|
+
defineExtension,
|
1231
|
+
getExtensionContext
|
1232
|
+
}
|
1233
|
+
}
|
1234
|
+
export { Extensions }
|
1235
|
+
|
1236
|
+
declare namespace Extensions_2 {
|
1237
|
+
export {
|
1238
|
+
InternalArgs,
|
1239
|
+
DefaultArgs,
|
1240
|
+
GetPayloadResult,
|
1241
|
+
GetSelect,
|
1242
|
+
GetOmit,
|
1243
|
+
DynamicQueryExtensionArgs,
|
1244
|
+
DynamicQueryExtensionCb,
|
1245
|
+
DynamicQueryExtensionCbArgs,
|
1246
|
+
DynamicQueryExtensionCbArgsArgs,
|
1247
|
+
DynamicResultExtensionArgs,
|
1248
|
+
DynamicResultExtensionNeeds,
|
1249
|
+
DynamicResultExtensionData,
|
1250
|
+
DynamicModelExtensionArgs,
|
1251
|
+
DynamicModelExtensionThis,
|
1252
|
+
DynamicModelExtensionOperationFn,
|
1253
|
+
DynamicModelExtensionFnResult,
|
1254
|
+
DynamicModelExtensionFnResultBase,
|
1255
|
+
DynamicModelExtensionFluentApi,
|
1256
|
+
DynamicModelExtensionFnResultNull,
|
1257
|
+
DynamicClientExtensionArgs,
|
1258
|
+
DynamicClientExtensionThis,
|
1259
|
+
ClientBuiltInProp,
|
1260
|
+
DynamicClientExtensionThisBuiltin,
|
1261
|
+
ExtendsHook,
|
1262
|
+
MergeExtArgs,
|
1263
|
+
AllModelsToStringIndex,
|
1264
|
+
TypeMapDef,
|
1265
|
+
DevTypeMapDef,
|
1266
|
+
DevTypeMapFnDef,
|
1267
|
+
TypeMapCbDef,
|
1268
|
+
ModelKey,
|
1269
|
+
RequiredExtensionArgs as UserArgs
|
1270
|
+
}
|
1271
|
+
}
|
1272
|
+
|
1273
|
+
declare type Fetch = typeof nodeFetch;
|
1274
|
+
|
1275
|
+
/**
|
1276
|
+
* A reference to a specific field of a specific model
|
1277
|
+
*/
|
1278
|
+
export declare interface FieldRef<Model, FieldType> {
|
1279
|
+
readonly modelName: Model;
|
1280
|
+
readonly name: string;
|
1281
|
+
readonly typeName: FieldType;
|
1282
|
+
readonly isList: boolean;
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete';
|
1286
|
+
|
1287
|
+
export declare interface Fn<Params = unknown, Returns = unknown> {
|
1288
|
+
params: Params;
|
1289
|
+
returns: Returns;
|
1290
|
+
}
|
1291
|
+
|
1292
|
+
declare interface GeneratorConfig {
|
1293
|
+
name: string;
|
1294
|
+
output: EnvValue | null;
|
1295
|
+
isCustomOutput?: boolean;
|
1296
|
+
provider: EnvValue;
|
1297
|
+
config: {
|
1298
|
+
/** `output` is a reserved name and will only be available directly at `generator.output` */
|
1299
|
+
output?: never;
|
1300
|
+
/** `provider` is a reserved name and will only be available directly at `generator.provider` */
|
1301
|
+
provider?: never;
|
1302
|
+
/** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */
|
1303
|
+
binaryTargets?: never;
|
1304
|
+
/** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */
|
1305
|
+
previewFeatures?: never;
|
1306
|
+
} & {
|
1307
|
+
[key: string]: string | string[] | undefined;
|
1308
|
+
};
|
1309
|
+
binaryTargets: BinaryTargetsEnvValue[];
|
1310
|
+
previewFeatures: string[];
|
1311
|
+
}
|
1312
|
+
|
1313
|
+
export declare type GetAggregateResult<P extends OperationPayload, A> = {
|
1314
|
+
[K in keyof A as K extends Aggregate ? K : never]: K extends '_count' ? A[K] extends true ? number : Count<A[K]> : {
|
1315
|
+
[J in keyof A[K] & string]: P['scalars'][J] | null;
|
1316
|
+
};
|
1317
|
+
};
|
1318
|
+
|
1319
|
+
declare function getBatchRequestPayload(batch: JsonQuery[], transaction?: TransactionOptions_2<unknown>): QueryEngineBatchRequest;
|
1320
|
+
|
1321
|
+
export declare type GetBatchResult = {
|
1322
|
+
count: number;
|
1323
|
+
};
|
1324
|
+
|
1325
|
+
export declare type GetCountResult<A> = A extends {
|
1326
|
+
select: infer S;
|
1327
|
+
} ? (S extends true ? number : Count<S>) : number;
|
1328
|
+
|
1329
|
+
declare function getExtensionContext<T>(that: T): Context_2<T>;
|
1330
|
+
|
1331
|
+
export declare type GetFindResult<P extends OperationPayload, A> = A extends {
|
1332
|
+
omit: infer Omission;
|
1333
|
+
} ? Compute<Omit_2<GetSelectIncludeResult<P, A>, TrueKeys<Omission>>> : GetSelectIncludeResult<P, A>;
|
1334
|
+
|
1335
|
+
export declare type GetGroupByResult<P extends OperationPayload, A> = A extends {
|
1336
|
+
by: string[];
|
1337
|
+
} ? Array<GetAggregateResult<P, A> & {
|
1338
|
+
[K in A['by'][number]]: P['scalars'][K];
|
1339
|
+
}> : A extends {
|
1340
|
+
by: string;
|
1341
|
+
} ? Array<GetAggregateResult<P, A> & {
|
1342
|
+
[K in A['by']]: P['scalars'][K];
|
1343
|
+
}> : {}[];
|
1344
|
+
|
1345
|
+
export declare type GetOmit<BaseKeys extends string, R extends InternalArgs['result'][string]> = {
|
1346
|
+
[K in (string extends keyof R ? never : keyof R) | BaseKeys]?: boolean;
|
1347
|
+
};
|
1348
|
+
|
1349
|
+
export declare type GetPayloadResult<Base extends Record<any, any>, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = unknown extends R ? Base : {
|
1350
|
+
[K in KR | keyof Base]: K extends KR ? R[K] extends () => {
|
1351
|
+
compute: (...args: any) => infer C;
|
1352
|
+
} ? C : never : Base[K];
|
1353
|
+
};
|
1354
|
+
|
1355
|
+
export declare function getPrismaClient(config: GetPrismaClientConfig): {
|
1356
|
+
new (optionsArg?: PrismaClientOptions): {
|
1357
|
+
_originalClient: any;
|
1358
|
+
_runtimeDataModel: RuntimeDataModel;
|
1359
|
+
_requestHandler: RequestHandler;
|
1360
|
+
_connectionPromise?: Promise<any> | undefined;
|
1361
|
+
_disconnectionPromise?: Promise<any> | undefined;
|
1362
|
+
_engineConfig: EngineConfig;
|
1363
|
+
_accelerateEngineConfig: AccelerateEngineConfig;
|
1364
|
+
_clientVersion: string;
|
1365
|
+
_errorFormat: ErrorFormat;
|
1366
|
+
_tracingHelper: TracingHelper;
|
1367
|
+
_metrics: MetricsClient;
|
1368
|
+
_middlewares: MiddlewareHandler<QueryMiddleware>;
|
1369
|
+
_previewFeatures: string[];
|
1370
|
+
_activeProvider: string;
|
1371
|
+
_extensions: MergedExtensionsList;
|
1372
|
+
_engine: Engine;
|
1373
|
+
/**
|
1374
|
+
* A fully constructed/applied Client that references the parent
|
1375
|
+
* PrismaClient. This is used for Client extensions only.
|
1376
|
+
*/
|
1377
|
+
_appliedParent: any;
|
1378
|
+
_createPrismaPromise: PrismaPromiseFactory;
|
1379
|
+
/**
|
1380
|
+
* Hook a middleware into the client
|
1381
|
+
* @param middleware to hook
|
1382
|
+
*/
|
1383
|
+
$use(middleware: QueryMiddleware): void;
|
1384
|
+
$on<E extends ExtendedEventType>(eventType: E, callback: EventCallback<E>): void;
|
1385
|
+
$connect(): Promise<void>;
|
1386
|
+
/**
|
1387
|
+
* Disconnect from the database
|
1388
|
+
*/
|
1389
|
+
$disconnect(): Promise<void>;
|
1390
|
+
/**
|
1391
|
+
* Executes a raw query and always returns a number
|
1392
|
+
*/
|
1393
|
+
$executeRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper<unknown, unknown>): Promise<number>;
|
1394
|
+
/**
|
1395
|
+
* Executes a raw query provided through a safe tag function
|
1396
|
+
* @see https://github.com/prisma/prisma/issues/7142
|
1397
|
+
*
|
1398
|
+
* @param query
|
1399
|
+
* @param values
|
1400
|
+
* @returns
|
1401
|
+
*/
|
1402
|
+
$executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
|
1403
|
+
/**
|
1404
|
+
* Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections
|
1405
|
+
* @see https://github.com/prisma/prisma/issues/7142
|
1406
|
+
*
|
1407
|
+
* @param query
|
1408
|
+
* @param values
|
1409
|
+
* @returns
|
1410
|
+
*/
|
1411
|
+
$executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
|
1412
|
+
/**
|
1413
|
+
* Executes a raw command only for MongoDB
|
1414
|
+
*
|
1415
|
+
* @param command
|
1416
|
+
* @returns
|
1417
|
+
*/
|
1418
|
+
$runCommandRaw(command: Record<string, JsInputValue>): PrismaPromise_2<unknown>;
|
1419
|
+
/**
|
1420
|
+
* Executes a raw query and returns selected data
|
1421
|
+
*/
|
1422
|
+
$queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper<unknown, unknown>): Promise<unknown[]>;
|
1423
|
+
/**
|
1424
|
+
* Executes a raw query provided through a safe tag function
|
1425
|
+
* @see https://github.com/prisma/prisma/issues/7142
|
1426
|
+
*
|
1427
|
+
* @param query
|
1428
|
+
* @param values
|
1429
|
+
* @returns
|
1430
|
+
*/
|
1431
|
+
$queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
|
1432
|
+
/**
|
1433
|
+
* Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections
|
1434
|
+
* @see https://github.com/prisma/prisma/issues/7142
|
1435
|
+
*
|
1436
|
+
* @param query
|
1437
|
+
* @param values
|
1438
|
+
* @returns
|
1439
|
+
*/
|
1440
|
+
$queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2<unknown>;
|
1441
|
+
/**
|
1442
|
+
* Execute a batch of requests in a transaction
|
1443
|
+
* @param requests
|
1444
|
+
* @param options
|
1445
|
+
*/
|
1446
|
+
_transactionWithArray({ promises, options, }: {
|
1447
|
+
promises: Array<PrismaPromise_2<any>>;
|
1448
|
+
options?: BatchTransactionOptions;
|
1449
|
+
}): Promise<any>;
|
1450
|
+
/**
|
1451
|
+
* Perform a long-running transaction
|
1452
|
+
* @param callback
|
1453
|
+
* @param options
|
1454
|
+
* @returns
|
1455
|
+
*/
|
1456
|
+
_transactionWithCallback({ callback, options, }: {
|
1457
|
+
callback: (client: Client) => Promise<unknown>;
|
1458
|
+
options?: Options;
|
1459
|
+
}): Promise<unknown>;
|
1460
|
+
_createItxClient(transaction: PrismaPromiseInteractiveTransaction): Client;
|
1461
|
+
/**
|
1462
|
+
* Execute queries within a transaction
|
1463
|
+
* @param input a callback or a query list
|
1464
|
+
* @param options to set timeouts (callback)
|
1465
|
+
* @returns
|
1466
|
+
*/
|
1467
|
+
$transaction(input: any, options?: any): Promise<any>;
|
1468
|
+
/**
|
1469
|
+
* Runs the middlewares over params before executing a request
|
1470
|
+
* @param internalParams
|
1471
|
+
* @returns
|
1472
|
+
*/
|
1473
|
+
_request(internalParams: InternalRequestParams): Promise<any>;
|
1474
|
+
_executeRequest({ args, clientMethod, dataPath, callsite, action, model, argsMapper, transaction, unpacker, otelParentCtx, customDataProxyFetch, }: InternalRequestParams): Promise<any>;
|
1475
|
+
readonly $metrics: MetricsClient;
|
1476
|
+
/**
|
1477
|
+
* Shortcut for checking a preview flag
|
1478
|
+
* @param feature preview flag
|
1479
|
+
* @returns
|
1480
|
+
*/
|
1481
|
+
_hasPreviewFlag(feature: string): boolean;
|
1482
|
+
$applyPendingMigrations(): Promise<void>;
|
1483
|
+
$extends: typeof $extends;
|
1484
|
+
readonly [Symbol.toStringTag]: string;
|
1485
|
+
};
|
1486
|
+
};
|
1487
|
+
|
1488
|
+
/**
|
1489
|
+
* Config that is stored into the generated client. When the generated client is
|
1490
|
+
* loaded, this same config is passed to {@link getPrismaClient} which creates a
|
1491
|
+
* closure with that config around a non-instantiated [[PrismaClient]].
|
1492
|
+
*/
|
1493
|
+
declare type GetPrismaClientConfig = {
|
1494
|
+
runtimeDataModel: RuntimeDataModel;
|
1495
|
+
generator?: GeneratorConfig;
|
1496
|
+
relativeEnvPaths: {
|
1497
|
+
rootEnvPath?: string | null;
|
1498
|
+
schemaEnvPath?: string | null;
|
1499
|
+
};
|
1500
|
+
relativePath: string;
|
1501
|
+
dirname: string;
|
1502
|
+
filename?: string;
|
1503
|
+
clientVersion: string;
|
1504
|
+
engineVersion: string;
|
1505
|
+
datasourceNames: string[];
|
1506
|
+
activeProvider: string;
|
1507
|
+
/**
|
1508
|
+
* The contents of the schema encoded into a string
|
1509
|
+
* @remarks only used for the purpose of data proxy
|
1510
|
+
*/
|
1511
|
+
inlineSchema: string;
|
1512
|
+
/**
|
1513
|
+
* A special env object just for the data proxy edge runtime.
|
1514
|
+
* Allows bundlers to inject their own env variables (Vercel).
|
1515
|
+
* Allows platforms to declare global variables as env (Workers).
|
1516
|
+
* @remarks only used for the purpose of data proxy
|
1517
|
+
*/
|
1518
|
+
injectableEdgeEnv?: () => LoadedEnv;
|
1519
|
+
/**
|
1520
|
+
* The contents of the datasource url saved in a string.
|
1521
|
+
* This can either be an env var name or connection string.
|
1522
|
+
* It is needed by the client to connect to the Data Proxy.
|
1523
|
+
* @remarks only used for the purpose of data proxy
|
1524
|
+
*/
|
1525
|
+
inlineDatasources: {
|
1526
|
+
[name in string]: {
|
1527
|
+
url: EnvValue;
|
1528
|
+
};
|
1529
|
+
};
|
1530
|
+
/**
|
1531
|
+
* The string hash that was produced for a given schema
|
1532
|
+
* @remarks only used for the purpose of data proxy
|
1533
|
+
*/
|
1534
|
+
inlineSchemaHash: string;
|
1535
|
+
/**
|
1536
|
+
* A marker to indicate that the client was not generated via `prisma
|
1537
|
+
* generate` but was generated via `generate --postinstall` script instead.
|
1538
|
+
* @remarks used to error for Vercel/Netlify for schema caching issues
|
1539
|
+
*/
|
1540
|
+
postinstall?: boolean;
|
1541
|
+
/**
|
1542
|
+
* Information about the CI where the Prisma Client has been generated. The
|
1543
|
+
* name of the CI environment is stored at generation time because CI
|
1544
|
+
* information is not always available at runtime. Moreover, the edge client
|
1545
|
+
* has no notion of environment variables, so this works around that.
|
1546
|
+
* @remarks used to error for Vercel/Netlify for schema caching issues
|
1547
|
+
*/
|
1548
|
+
ciName?: string;
|
1549
|
+
/**
|
1550
|
+
* Information about whether we have not found a schema.prisma file in the
|
1551
|
+
* default location, and that we fell back to finding the schema.prisma file
|
1552
|
+
* in the current working directory. This usually means it has been bundled.
|
1553
|
+
*/
|
1554
|
+
isBundled?: boolean;
|
1555
|
+
/**
|
1556
|
+
* A boolean that is `false` when the client was generated with --no-engine. At
|
1557
|
+
* runtime, this means the client will be bound to be using the Data Proxy.
|
1558
|
+
*/
|
1559
|
+
copyEngine?: boolean;
|
1560
|
+
/**
|
1561
|
+
* Optional wasm loading configuration
|
1562
|
+
*/
|
1563
|
+
engineWasm?: WasmLoadingConfig;
|
1564
|
+
};
|
1565
|
+
|
1566
|
+
export declare type GetResult<P extends OperationPayload, A, O extends Operation = 'findUniqueOrThrow'> = {
|
1567
|
+
findUnique: GetFindResult<P, A> | null;
|
1568
|
+
findUniqueOrThrow: GetFindResult<P, A>;
|
1569
|
+
findFirst: GetFindResult<P, A> | null;
|
1570
|
+
findFirstOrThrow: GetFindResult<P, A>;
|
1571
|
+
findMany: GetFindResult<P, A>[];
|
1572
|
+
create: GetFindResult<P, A>;
|
1573
|
+
createMany: GetBatchResult;
|
1574
|
+
createManyAndReturn: GetFindResult<P, A>[];
|
1575
|
+
update: GetFindResult<P, A>;
|
1576
|
+
updateMany: GetBatchResult;
|
1577
|
+
upsert: GetFindResult<P, A>;
|
1578
|
+
delete: GetFindResult<P, A>;
|
1579
|
+
deleteMany: GetBatchResult;
|
1580
|
+
aggregate: GetAggregateResult<P, A>;
|
1581
|
+
count: GetCountResult<A>;
|
1582
|
+
groupBy: GetGroupByResult<P, A>;
|
1583
|
+
$queryRaw: unknown;
|
1584
|
+
$executeRaw: number;
|
1585
|
+
$queryRawUnsafe: unknown;
|
1586
|
+
$executeRawUnsafe: number;
|
1587
|
+
$runCommandRaw: JsonObject;
|
1588
|
+
findRaw: JsonObject;
|
1589
|
+
aggregateRaw: JsonObject;
|
1590
|
+
}[O];
|
1591
|
+
|
1592
|
+
export declare function getRuntime(): GetRuntimeOutput;
|
1593
|
+
|
1594
|
+
declare type GetRuntimeOutput = {
|
1595
|
+
id: Runtime;
|
1596
|
+
prettyName: string;
|
1597
|
+
isEdge: boolean;
|
1598
|
+
};
|
1599
|
+
|
1600
|
+
export declare type GetSelect<Base extends Record<any, any>, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = {
|
1601
|
+
[K in KR | keyof Base]?: K extends KR ? boolean : Base[K];
|
1602
|
+
};
|
1603
|
+
|
1604
|
+
export declare type GetSelectIncludeResult<P extends OperationPayload, A> = Equals<A, any> extends 1 ? DefaultSelection<P> : A extends {
|
1605
|
+
select: infer S extends object;
|
1606
|
+
} & Record<string, unknown> | {
|
1607
|
+
include: infer I extends object;
|
1608
|
+
} & Record<string, unknown> ? {
|
1609
|
+
[K in keyof S | keyof I as (S & I)[K] extends false | undefined | null ? never : K]: (S & I)[K] extends object ? P extends SelectablePayloadFields<K, (infer O)[]> ? O extends OperationPayload ? GetFindResult<O, (S & I)[K]>[] : never : P extends SelectablePayloadFields<K, infer O | null> ? O extends OperationPayload ? GetFindResult<O, (S & I)[K]> | SelectField<P, K> & null : never : K extends '_count' ? Count<GetFindResult<P, (S & I)[K]>> : never : P extends SelectablePayloadFields<K, (infer O)[]> ? O extends OperationPayload ? DefaultSelection<O>[] : never : P extends SelectablePayloadFields<K, infer O | null> ? O extends OperationPayload ? DefaultSelection<O> | SelectField<P, K> & null : never : P extends {
|
1610
|
+
scalars: {
|
1611
|
+
[k in K]: infer O;
|
1612
|
+
};
|
1613
|
+
} ? O : K extends '_count' ? Count<P['objects']> : never;
|
1614
|
+
} & (A extends {
|
1615
|
+
include: any;
|
1616
|
+
} & Record<string, unknown> ? DefaultSelection<P> : unknown) : DefaultSelection<P>;
|
1617
|
+
|
1618
|
+
declare type HandleErrorParams = {
|
1619
|
+
args: JsArgs;
|
1620
|
+
error: any;
|
1621
|
+
clientMethod: string;
|
1622
|
+
callsite?: CallSite;
|
1623
|
+
transaction?: PrismaPromiseTransaction;
|
1624
|
+
modelName?: string;
|
1625
|
+
};
|
1626
|
+
|
1627
|
+
/**
|
1628
|
+
* Defines High-Resolution Time.
|
1629
|
+
*
|
1630
|
+
* The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
|
1631
|
+
* The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
|
1632
|
+
* For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
|
1633
|
+
* The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
|
1634
|
+
* HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
|
1635
|
+
* The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
|
1636
|
+
* HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
|
1637
|
+
* This is represented in HrTime format as [1609504210, 150000000].
|
1638
|
+
*/
|
1639
|
+
declare type HrTime = [number, number];
|
1640
|
+
|
1641
|
+
declare type InteractiveTransactionInfo<Payload = unknown> = {
|
1642
|
+
/**
|
1643
|
+
* Transaction ID returned by the query engine.
|
1644
|
+
*/
|
1645
|
+
id: string;
|
1646
|
+
/**
|
1647
|
+
* Arbitrary payload the meaning of which depends on the `Engine` implementation.
|
1648
|
+
* For example, `DataProxyEngine` needs to associate different API endpoints with transactions.
|
1649
|
+
* In `LibraryEngine` and `BinaryEngine` it is currently not used.
|
1650
|
+
*/
|
1651
|
+
payload: Payload;
|
1652
|
+
};
|
1653
|
+
|
1654
|
+
declare type InteractiveTransactionOptions<Payload> = Transaction_2.InteractiveTransactionInfo<Payload>;
|
1655
|
+
|
1656
|
+
export declare type InternalArgs<R = {
|
1657
|
+
[K in string]: {
|
1658
|
+
[K in string]: unknown;
|
1659
|
+
};
|
1660
|
+
}, M = {
|
1661
|
+
[K in string]: {
|
1662
|
+
[K in string]: unknown;
|
1663
|
+
};
|
1664
|
+
}, Q = {
|
1665
|
+
[K in string]: {
|
1666
|
+
[K in string]: unknown;
|
1667
|
+
};
|
1668
|
+
}, C = {
|
1669
|
+
[K in string]: unknown;
|
1670
|
+
}> = {
|
1671
|
+
result: {
|
1672
|
+
[K in keyof R]: {
|
1673
|
+
[P in keyof R[K]]: () => R[K][P];
|
1674
|
+
};
|
1675
|
+
};
|
1676
|
+
model: {
|
1677
|
+
[K in keyof M]: {
|
1678
|
+
[P in keyof M[K]]: () => M[K][P];
|
1679
|
+
};
|
1680
|
+
};
|
1681
|
+
query: {
|
1682
|
+
[K in keyof Q]: {
|
1683
|
+
[P in keyof Q[K]]: () => Q[K][P];
|
1684
|
+
};
|
1685
|
+
};
|
1686
|
+
client: {
|
1687
|
+
[K in keyof C]: () => C[K];
|
1688
|
+
};
|
1689
|
+
};
|
1690
|
+
|
1691
|
+
declare type InternalRequestParams = {
|
1692
|
+
/**
|
1693
|
+
* The original client method being called.
|
1694
|
+
* Even though the rootField / operation can be changed,
|
1695
|
+
* this method stays as it is, as it's what the user's
|
1696
|
+
* code looks like
|
1697
|
+
*/
|
1698
|
+
clientMethod: string;
|
1699
|
+
/**
|
1700
|
+
* Name of js model that triggered the request. Might be used
|
1701
|
+
* for warnings or error messages
|
1702
|
+
*/
|
1703
|
+
jsModelName?: string;
|
1704
|
+
callsite?: CallSite;
|
1705
|
+
transaction?: PrismaPromiseTransaction;
|
1706
|
+
unpacker?: Unpacker;
|
1707
|
+
otelParentCtx?: Context;
|
1708
|
+
/** Used to "desugar" a user input into an "expanded" one */
|
1709
|
+
argsMapper?: (args?: UserArgs_2) => UserArgs_2;
|
1710
|
+
/** Used to convert args for middleware and back */
|
1711
|
+
middlewareArgsMapper?: MiddlewareArgsMapper<unknown, unknown>;
|
1712
|
+
/** Used for Accelerate client extension via Data Proxy */
|
1713
|
+
customDataProxyFetch?: (fetch: Fetch) => Fetch;
|
1714
|
+
} & Omit<QueryMiddlewareParams, 'runInTransaction'>;
|
1715
|
+
|
1716
|
+
declare enum IsolationLevel {
|
1717
|
+
ReadUncommitted = "ReadUncommitted",
|
1718
|
+
ReadCommitted = "ReadCommitted",
|
1719
|
+
RepeatableRead = "RepeatableRead",
|
1720
|
+
Snapshot = "Snapshot",
|
1721
|
+
Serializable = "Serializable"
|
1722
|
+
}
|
1723
|
+
|
1724
|
+
export declare type ITXClientDenyList = (typeof denylist)[number];
|
1725
|
+
|
1726
|
+
export declare const itxClientDenyList: readonly (string | symbol)[];
|
1727
|
+
|
1728
|
+
declare interface Job {
|
1729
|
+
resolve: (data: any) => void;
|
1730
|
+
reject: (data: any) => void;
|
1731
|
+
request: any;
|
1732
|
+
}
|
1733
|
+
|
1734
|
+
/**
|
1735
|
+
* Create a SQL query for a list of values.
|
1736
|
+
*/
|
1737
|
+
export declare function join(values: readonly RawValue[], separator?: string, prefix?: string, suffix?: string): Sql;
|
1738
|
+
|
1739
|
+
export declare type JsArgs = {
|
1740
|
+
select?: Selection_2;
|
1741
|
+
include?: Selection_2;
|
1742
|
+
omit?: Omission;
|
1743
|
+
[argName: string]: JsInputValue;
|
1744
|
+
};
|
1745
|
+
|
1746
|
+
export declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | JsonConvertible | FieldRef<string, unknown> | JsInputValue[] | {
|
1747
|
+
[key: string]: JsInputValue;
|
1748
|
+
};
|
1749
|
+
|
1750
|
+
declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | {
|
1751
|
+
[key: string]: JsonArgumentValue;
|
1752
|
+
};
|
1753
|
+
|
1754
|
+
export declare interface JsonArray extends Array<JsonValue> {
|
1755
|
+
}
|
1756
|
+
|
1757
|
+
declare type JsonBatchQuery = {
|
1758
|
+
batch: JsonQuery[];
|
1759
|
+
transaction?: {
|
1760
|
+
isolationLevel?: Transaction_2.IsolationLevel;
|
1761
|
+
};
|
1762
|
+
};
|
1763
|
+
|
1764
|
+
export declare interface JsonConvertible {
|
1765
|
+
toJSON(): unknown;
|
1766
|
+
}
|
1767
|
+
|
1768
|
+
declare type JsonFieldSelection = {
|
1769
|
+
arguments?: Record<string, JsonArgumentValue> | RawTaggedValue;
|
1770
|
+
selection: JsonSelectionSet;
|
1771
|
+
};
|
1772
|
+
|
1773
|
+
declare class JsonNull extends NullTypesEnumValue {
|
1774
|
+
}
|
1775
|
+
|
1776
|
+
export declare type JsonObject = {
|
1777
|
+
[Key in string]?: JsonValue;
|
1778
|
+
};
|
1779
|
+
|
1780
|
+
declare type JsonQuery = {
|
1781
|
+
modelName?: string;
|
1782
|
+
action: JsonQueryAction;
|
1783
|
+
query: JsonFieldSelection;
|
1784
|
+
};
|
1785
|
+
|
1786
|
+
declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw';
|
1787
|
+
|
1788
|
+
declare type JsonSelectionSet = {
|
1789
|
+
$scalars?: boolean;
|
1790
|
+
$composites?: boolean;
|
1791
|
+
} & {
|
1792
|
+
[fieldName: string]: boolean | JsonFieldSelection;
|
1793
|
+
};
|
1794
|
+
|
1795
|
+
export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null;
|
1796
|
+
|
1797
|
+
export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | {
|
1798
|
+
[key: string]: JsOutputValue;
|
1799
|
+
};
|
1800
|
+
|
1801
|
+
export declare type JsPromise<T> = Promise<T> & {};
|
1802
|
+
|
1803
|
+
declare type KnownErrorParams = {
|
1804
|
+
code: string;
|
1805
|
+
clientVersion: string;
|
1806
|
+
meta?: Record<string, unknown>;
|
1807
|
+
batchRequestIdx?: number;
|
1808
|
+
};
|
1809
|
+
|
1810
|
+
/**
|
1811
|
+
* A pointer from the current {@link Span} to another span in the same trace or
|
1812
|
+
* in a different trace.
|
1813
|
+
* Few examples of Link usage.
|
1814
|
+
* 1. Batch Processing: A batch of elements may contain elements associated
|
1815
|
+
* with one or more traces/spans. Since there can only be one parent
|
1816
|
+
* SpanContext, Link is used to keep reference to SpanContext of all
|
1817
|
+
* elements in the batch.
|
1818
|
+
* 2. Public Endpoint: A SpanContext in incoming client request on a public
|
1819
|
+
* endpoint is untrusted from service provider perspective. In such case it
|
1820
|
+
* is advisable to start a new trace with appropriate sampling decision.
|
1821
|
+
* However, it is desirable to associate incoming SpanContext to new trace
|
1822
|
+
* initiated on service provider side so two traces (from Client and from
|
1823
|
+
* Service Provider) can be correlated.
|
1824
|
+
*/
|
1825
|
+
declare interface Link {
|
1826
|
+
/** The {@link SpanContext} of a linked span. */
|
1827
|
+
context: SpanContext;
|
1828
|
+
/** A set of {@link SpanAttributes} on the link. */
|
1829
|
+
attributes?: SpanAttributes;
|
1830
|
+
/** Count of attributes of the link that were dropped due to collection limits */
|
1831
|
+
droppedAttributesCount?: number;
|
1832
|
+
}
|
1833
|
+
|
1834
|
+
declare type LoadedEnv = {
|
1835
|
+
message?: string;
|
1836
|
+
parsed: {
|
1837
|
+
[x: string]: string;
|
1838
|
+
};
|
1839
|
+
} | undefined;
|
1840
|
+
|
1841
|
+
declare type LocationInFile = {
|
1842
|
+
fileName: string;
|
1843
|
+
lineNumber: number | null;
|
1844
|
+
columnNumber: number | null;
|
1845
|
+
};
|
1846
|
+
|
1847
|
+
declare type LogDefinition = {
|
1848
|
+
level: LogLevel;
|
1849
|
+
emit: 'stdout' | 'event';
|
1850
|
+
};
|
1851
|
+
|
1852
|
+
/**
|
1853
|
+
* Typings for the events we emit.
|
1854
|
+
*
|
1855
|
+
* @remarks
|
1856
|
+
* If this is updated, our edge runtime shim needs to be updated as well.
|
1857
|
+
*/
|
1858
|
+
declare type LogEmitter = {
|
1859
|
+
on<E extends EngineEventType>(event: E, listener: (event: EngineEvent<E>) => void): LogEmitter;
|
1860
|
+
emit(event: QueryEventType, payload: QueryEvent): boolean;
|
1861
|
+
emit(event: LogEventType, payload: LogEvent): boolean;
|
1862
|
+
};
|
1863
|
+
|
1864
|
+
declare type LogEvent = {
|
1865
|
+
timestamp: Date;
|
1866
|
+
message: string;
|
1867
|
+
target: string;
|
1868
|
+
};
|
1869
|
+
|
1870
|
+
declare type LogEventType = 'info' | 'warn' | 'error';
|
1871
|
+
|
1872
|
+
declare type LogLevel = 'info' | 'query' | 'warn' | 'error';
|
1873
|
+
|
1874
|
+
/**
|
1875
|
+
* Generates more strict variant of an enum which, unlike regular enum,
|
1876
|
+
* throws on non-existing property access. This can be useful in following situations:
|
1877
|
+
* - we have an API, that accepts both `undefined` and `SomeEnumType` as an input
|
1878
|
+
* - enum values are generated dynamically from DMMF.
|
1879
|
+
*
|
1880
|
+
* In that case, if using normal enums and no compile-time typechecking, using non-existing property
|
1881
|
+
* will result in `undefined` value being used, which will be accepted. Using strict enum
|
1882
|
+
* in this case will help to have a runtime exception, telling you that you are probably doing something wrong.
|
1883
|
+
*
|
1884
|
+
* Note: if you need to check for existence of a value in the enum you can still use either
|
1885
|
+
* `in` operator or `hasOwnProperty` function.
|
1886
|
+
*
|
1887
|
+
* @param definition
|
1888
|
+
* @returns
|
1889
|
+
*/
|
1890
|
+
export declare function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T;
|
1891
|
+
|
1892
|
+
/**
|
1893
|
+
* Class that holds the list of all extensions, applied to particular instance,
|
1894
|
+
* as well as resolved versions of the components that need to apply on
|
1895
|
+
* different levels. Main idea of this class: avoid re-resolving as much of the
|
1896
|
+
* stuff as possible when new extensions are added while also delaying the
|
1897
|
+
* resolve until the point it is actually needed. For example, computed fields
|
1898
|
+
* of the model won't be resolved unless the model is actually queried. Neither
|
1899
|
+
* adding extensions with `client` component only cause other components to
|
1900
|
+
* recompute.
|
1901
|
+
*/
|
1902
|
+
declare class MergedExtensionsList {
|
1903
|
+
private head?;
|
1904
|
+
private constructor();
|
1905
|
+
static empty(): MergedExtensionsList;
|
1906
|
+
static single(extension: ExtensionArgs): MergedExtensionsList;
|
1907
|
+
isEmpty(): boolean;
|
1908
|
+
append(extension: ExtensionArgs): MergedExtensionsList;
|
1909
|
+
getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined;
|
1910
|
+
getAllClientExtensions(): ClientArg | undefined;
|
1911
|
+
getAllModelExtensions(dmmfModelName: string): ModelArg | undefined;
|
1912
|
+
getAllQueryCallbacks(jsModelName: string, operation: string): any;
|
1913
|
+
getAllBatchQueryCallbacks(): BatchQueryOptionsCb[];
|
1914
|
+
}
|
1915
|
+
|
1916
|
+
export declare type MergeExtArgs<TypeMap extends TypeMapDef, ExtArgs extends Record<any, any>, Args extends Record<any, any>> = ComputeDeep<ExtArgs & Args & AllModelsToStringIndex<TypeMap, Args, 'result'> & AllModelsToStringIndex<TypeMap, Args, 'model'>>;
|
1917
|
+
|
1918
|
+
export declare type Metric<T> = {
|
1919
|
+
key: string;
|
1920
|
+
value: T;
|
1921
|
+
labels: Record<string, string>;
|
1922
|
+
description: string;
|
1923
|
+
};
|
1924
|
+
|
1925
|
+
export declare type MetricHistogram = {
|
1926
|
+
buckets: MetricHistogramBucket[];
|
1927
|
+
sum: number;
|
1928
|
+
count: number;
|
1929
|
+
};
|
1930
|
+
|
1931
|
+
export declare type MetricHistogramBucket = [maxValue: number, count: number];
|
1932
|
+
|
1933
|
+
export declare type Metrics = {
|
1934
|
+
counters: Metric<number>[];
|
1935
|
+
gauges: Metric<number>[];
|
1936
|
+
histograms: Metric<MetricHistogram>[];
|
1937
|
+
};
|
1938
|
+
|
1939
|
+
export declare class MetricsClient {
|
1940
|
+
private _engine;
|
1941
|
+
constructor(engine: Engine);
|
1942
|
+
/**
|
1943
|
+
* Returns all metrics gathered up to this point in prometheus format.
|
1944
|
+
* Result of this call can be exposed directly to prometheus scraping endpoint
|
1945
|
+
*
|
1946
|
+
* @param options
|
1947
|
+
* @returns
|
1948
|
+
*/
|
1949
|
+
prometheus(options?: MetricsOptions): Promise<string>;
|
1950
|
+
/**
|
1951
|
+
* Returns all metrics gathered up to this point in prometheus format.
|
1952
|
+
*
|
1953
|
+
* @param options
|
1954
|
+
* @returns
|
1955
|
+
*/
|
1956
|
+
json(options?: MetricsOptions): Promise<Metrics>;
|
1957
|
+
}
|
1958
|
+
|
1959
|
+
declare type MetricsOptions = {
|
1960
|
+
/**
|
1961
|
+
* Labels to add to every metrics in key-value format
|
1962
|
+
*/
|
1963
|
+
globalLabels?: Record<string, string>;
|
1964
|
+
};
|
1965
|
+
|
1966
|
+
declare type MetricsOptionsCommon = {
|
1967
|
+
globalLabels?: Record<string, string>;
|
1968
|
+
};
|
1969
|
+
|
1970
|
+
declare type MetricsOptionsJson = {
|
1971
|
+
format: 'json';
|
1972
|
+
} & MetricsOptionsCommon;
|
1973
|
+
|
1974
|
+
declare type MetricsOptionsPrometheus = {
|
1975
|
+
format: 'prometheus';
|
1976
|
+
} & MetricsOptionsCommon;
|
1977
|
+
|
1978
|
+
declare type MiddlewareArgsMapper<RequestArgs, MiddlewareArgs> = {
|
1979
|
+
requestArgsToMiddlewareArgs(requestArgs: RequestArgs): MiddlewareArgs;
|
1980
|
+
middlewareArgsToRequestArgs(middlewareArgs: MiddlewareArgs): RequestArgs;
|
1981
|
+
};
|
1982
|
+
|
1983
|
+
declare class MiddlewareHandler<M extends Function> {
|
1984
|
+
private _middlewares;
|
1985
|
+
use(middleware: M): void;
|
1986
|
+
get(id: number): M | undefined;
|
1987
|
+
has(id: number): boolean;
|
1988
|
+
length(): number;
|
1989
|
+
}
|
1990
|
+
|
1991
|
+
export declare type ModelArg = {
|
1992
|
+
[MethodName in string]: unknown;
|
1993
|
+
};
|
1994
|
+
|
1995
|
+
export declare type ModelArgs = {
|
1996
|
+
model: {
|
1997
|
+
[ModelName in string]: ModelArg;
|
1998
|
+
};
|
1999
|
+
};
|
2000
|
+
|
2001
|
+
export declare type ModelKey<TypeMap extends TypeMapDef, M extends PropertyKey> = M extends keyof TypeMap['model'] ? M : Capitalize<M & string>;
|
2002
|
+
|
2003
|
+
export declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise<any>;
|
2004
|
+
|
2005
|
+
export declare type ModelQueryOptionsCbArgs = {
|
2006
|
+
model: string;
|
2007
|
+
operation: string;
|
2008
|
+
args: JsArgs;
|
2009
|
+
query: (args: JsArgs) => Promise<unknown>;
|
2010
|
+
};
|
2011
|
+
|
2012
|
+
export declare type NameArgs = {
|
2013
|
+
name?: string;
|
2014
|
+
};
|
2015
|
+
|
2016
|
+
export declare type Narrow<A> = {
|
2017
|
+
[K in keyof A]: A[K] extends Function ? A[K] : Narrow<A[K]>;
|
2018
|
+
} | (A extends Narrowable ? A : never);
|
2019
|
+
|
2020
|
+
export declare type Narrowable = string | number | bigint | boolean | [];
|
2021
|
+
|
2022
|
+
export declare type NeverToUnknown<T> = [T] extends [never] ? unknown : T;
|
2023
|
+
|
2024
|
+
/**
|
2025
|
+
* Imitates `fetch` via `https` to only suit our needs, it does nothing more.
|
2026
|
+
* This is because we cannot bundle `node-fetch` as it uses many other Node.js
|
2027
|
+
* utilities, while also bloating our bundles. This approach is much leaner.
|
2028
|
+
* @param url
|
2029
|
+
* @param options
|
2030
|
+
* @returns
|
2031
|
+
*/
|
2032
|
+
declare function nodeFetch(url: string, options?: RequestOptions): Promise<RequestResponse>;
|
2033
|
+
|
2034
|
+
declare class NodeHeaders {
|
2035
|
+
readonly headers: Map<string, string>;
|
2036
|
+
constructor(init?: Record<any, any>);
|
2037
|
+
append(name: string, value: string): void;
|
2038
|
+
delete(name: string): void;
|
2039
|
+
get(name: string): string | null;
|
2040
|
+
has(name: string): boolean;
|
2041
|
+
set(name: string, value: string): void;
|
2042
|
+
forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void;
|
2043
|
+
}
|
2044
|
+
|
2045
|
+
/**
|
2046
|
+
* @deprecated Please don´t rely on type checks to this error anymore.
|
2047
|
+
* This will become a regular `PrismaClientKnownRequestError` with code `P2025`
|
2048
|
+
* in the future major version of the client.
|
2049
|
+
* Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`.
|
2050
|
+
*/
|
2051
|
+
export declare class NotFoundError extends PrismaClientKnownRequestError {
|
2052
|
+
constructor(message: string, clientVersion: string);
|
2053
|
+
}
|
2054
|
+
|
2055
|
+
declare class NullTypesEnumValue extends ObjectEnumValue {
|
2056
|
+
_getNamespace(): string;
|
2057
|
+
}
|
2058
|
+
|
2059
|
+
/**
|
2060
|
+
* List of Prisma enums that must use unique objects instead of strings as their values.
|
2061
|
+
*/
|
2062
|
+
export declare const objectEnumNames: string[];
|
2063
|
+
|
2064
|
+
/**
|
2065
|
+
* Base class for unique values of object-valued enums.
|
2066
|
+
*/
|
2067
|
+
export declare abstract class ObjectEnumValue {
|
2068
|
+
constructor(arg?: symbol);
|
2069
|
+
abstract _getNamespace(): string;
|
2070
|
+
_getName(): string;
|
2071
|
+
toString(): string;
|
2072
|
+
}
|
2073
|
+
|
2074
|
+
export declare const objectEnumValues: {
|
2075
|
+
classes: {
|
2076
|
+
DbNull: typeof DbNull;
|
2077
|
+
JsonNull: typeof JsonNull;
|
2078
|
+
AnyNull: typeof AnyNull;
|
2079
|
+
};
|
2080
|
+
instances: {
|
2081
|
+
DbNull: DbNull;
|
2082
|
+
JsonNull: JsonNull;
|
2083
|
+
AnyNull: AnyNull;
|
2084
|
+
};
|
2085
|
+
};
|
2086
|
+
|
2087
|
+
declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"];
|
2088
|
+
|
2089
|
+
export declare type Omission = Record<string, boolean>;
|
2090
|
+
|
2091
|
+
declare type Omit_2<T, K extends string | number | symbol> = {
|
2092
|
+
[P in keyof T as P extends K ? never : P]: T[P];
|
2093
|
+
};
|
2094
|
+
export { Omit_2 as Omit }
|
2095
|
+
|
2096
|
+
export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw';
|
2097
|
+
|
2098
|
+
export declare type OperationPayload = {
|
2099
|
+
scalars: {
|
2100
|
+
[ScalarName in string]: unknown;
|
2101
|
+
};
|
2102
|
+
objects: {
|
2103
|
+
[ObjectName in string]: unknown;
|
2104
|
+
};
|
2105
|
+
composites: {
|
2106
|
+
[CompositeName in string]: unknown;
|
2107
|
+
};
|
2108
|
+
};
|
2109
|
+
|
2110
|
+
export declare type Optional<O, K extends keyof any = keyof O> = {
|
2111
|
+
[P in K & keyof O]?: O[P];
|
2112
|
+
} & {
|
2113
|
+
[P in Exclude<keyof O, K>]: O[P];
|
2114
|
+
};
|
2115
|
+
|
2116
|
+
export declare type OptionalFlat<T> = {
|
2117
|
+
[K in keyof T]?: T[K];
|
2118
|
+
};
|
2119
|
+
|
2120
|
+
export declare type OptionalKeys<O> = {
|
2121
|
+
[K in keyof O]-?: {} extends Pick_2<O, K> ? K : never;
|
2122
|
+
}[keyof O];
|
2123
|
+
|
2124
|
+
declare type Options = {
|
2125
|
+
maxWait?: number;
|
2126
|
+
timeout?: number;
|
2127
|
+
isolationLevel?: IsolationLevel;
|
2128
|
+
};
|
2129
|
+
|
2130
|
+
declare type Options_2 = {
|
2131
|
+
clientVersion: string;
|
2132
|
+
};
|
2133
|
+
|
2134
|
+
export declare type Or<A extends 1 | 0, B extends 1 | 0> = {
|
2135
|
+
0: {
|
2136
|
+
0: 0;
|
2137
|
+
1: 1;
|
2138
|
+
};
|
2139
|
+
1: {
|
2140
|
+
0: 1;
|
2141
|
+
1: 1;
|
2142
|
+
};
|
2143
|
+
}[A][B];
|
2144
|
+
|
2145
|
+
export declare type PatchFlat<O1, O2> = O1 & Omit_2<O2, keyof O1>;
|
2146
|
+
|
2147
|
+
export declare type Path<O, P, Default = never> = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path<O[K], R> : Default : O : never;
|
2148
|
+
|
2149
|
+
export declare type Payload<T, F extends Operation = never> = T extends {
|
2150
|
+
[K: symbol]: {
|
2151
|
+
types: {
|
2152
|
+
payload: any;
|
2153
|
+
};
|
2154
|
+
};
|
2155
|
+
} ? T[symbol]['types']['payload'] : any;
|
2156
|
+
|
2157
|
+
export declare type PayloadToResult<P, O extends Record_2<any, any> = RenameAndNestPayloadKeys<P>> = {
|
2158
|
+
[K in keyof O]?: O[K][K] extends any[] ? PayloadToResult<O[K][K][number]>[] : O[K][K] extends object ? PayloadToResult<O[K][K]> : O[K][K];
|
2159
|
+
};
|
2160
|
+
|
2161
|
+
declare type Pick_2<T, K extends string | number | symbol> = {
|
2162
|
+
[P in keyof T as P extends K ? P : never]: T[P];
|
2163
|
+
};
|
2164
|
+
export { Pick_2 as Pick }
|
2165
|
+
|
2166
|
+
export declare class PrismaClientInitializationError extends Error {
|
2167
|
+
clientVersion: string;
|
2168
|
+
errorCode?: string;
|
2169
|
+
retryable?: boolean;
|
2170
|
+
constructor(message: string, clientVersion: string, errorCode?: string);
|
2171
|
+
get [Symbol.toStringTag](): string;
|
2172
|
+
}
|
2173
|
+
|
2174
|
+
export declare class PrismaClientKnownRequestError extends Error implements ErrorWithBatchIndex {
|
2175
|
+
code: string;
|
2176
|
+
meta?: Record<string, unknown>;
|
2177
|
+
clientVersion: string;
|
2178
|
+
batchRequestIdx?: number;
|
2179
|
+
constructor(message: string, { code, clientVersion, meta, batchRequestIdx }: KnownErrorParams);
|
2180
|
+
get [Symbol.toStringTag](): string;
|
2181
|
+
}
|
2182
|
+
|
2183
|
+
export declare type PrismaClientOptions = {
|
2184
|
+
/**
|
2185
|
+
* Overwrites the primary datasource url from your schema.prisma file
|
2186
|
+
*/
|
2187
|
+
datasourceUrl?: string;
|
2188
|
+
/**
|
2189
|
+
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale.
|
2190
|
+
*/
|
2191
|
+
adapter?: DriverAdapter | null;
|
2192
|
+
/**
|
2193
|
+
* Overwrites the datasource url from your schema.prisma file
|
2194
|
+
*/
|
2195
|
+
datasources?: Datasources;
|
2196
|
+
/**
|
2197
|
+
* @default "colorless"
|
2198
|
+
*/
|
2199
|
+
errorFormat?: ErrorFormat;
|
2200
|
+
/**
|
2201
|
+
* The default values for Transaction options
|
2202
|
+
* maxWait ?= 2000
|
2203
|
+
* timeout ?= 5000
|
2204
|
+
*/
|
2205
|
+
transactionOptions?: Transaction_2.Options;
|
2206
|
+
/**
|
2207
|
+
* @example
|
2208
|
+
* \`\`\`
|
2209
|
+
* // Defaults to stdout
|
2210
|
+
* log: ['query', 'info', 'warn']
|
2211
|
+
*
|
2212
|
+
* // Emit as events
|
2213
|
+
* log: [
|
2214
|
+
* { emit: 'stdout', level: 'query' },
|
2215
|
+
* { emit: 'stdout', level: 'info' },
|
2216
|
+
* { emit: 'stdout', level: 'warn' }
|
2217
|
+
* ]
|
2218
|
+
* \`\`\`
|
2219
|
+
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
|
2220
|
+
*/
|
2221
|
+
log?: Array<LogLevel | LogDefinition>;
|
2222
|
+
/**
|
2223
|
+
* @internal
|
2224
|
+
* You probably don't want to use this. \`__internal\` is used by internal tooling.
|
2225
|
+
*/
|
2226
|
+
__internal?: {
|
2227
|
+
debug?: boolean;
|
2228
|
+
engine?: {
|
2229
|
+
cwd?: string;
|
2230
|
+
binaryPath?: string;
|
2231
|
+
endpoint?: string;
|
2232
|
+
allowTriggerPanic?: boolean;
|
2233
|
+
};
|
2234
|
+
/** This can be used for testing purposes */
|
2235
|
+
configOverride?: (config: GetPrismaClientConfig) => GetPrismaClientConfig;
|
2236
|
+
};
|
2237
|
+
};
|
2238
|
+
|
2239
|
+
export declare class PrismaClientRustPanicError extends Error {
|
2240
|
+
clientVersion: string;
|
2241
|
+
constructor(message: string, clientVersion: string);
|
2242
|
+
get [Symbol.toStringTag](): string;
|
2243
|
+
}
|
2244
|
+
|
2245
|
+
export declare class PrismaClientUnknownRequestError extends Error implements ErrorWithBatchIndex {
|
2246
|
+
clientVersion: string;
|
2247
|
+
batchRequestIdx?: number;
|
2248
|
+
constructor(message: string, { clientVersion, batchRequestIdx }: UnknownErrorParams);
|
2249
|
+
get [Symbol.toStringTag](): string;
|
2250
|
+
}
|
2251
|
+
|
2252
|
+
export declare class PrismaClientValidationError extends Error {
|
2253
|
+
name: string;
|
2254
|
+
clientVersion: string;
|
2255
|
+
constructor(message: string, { clientVersion }: Options_2);
|
2256
|
+
get [Symbol.toStringTag](): string;
|
2257
|
+
}
|
2258
|
+
|
2259
|
+
declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError;
|
2260
|
+
|
2261
|
+
export declare interface PrismaPromise<T> extends Promise<T> {
|
2262
|
+
[Symbol.toStringTag]: 'PrismaPromise';
|
2263
|
+
}
|
2264
|
+
|
2265
|
+
/**
|
2266
|
+
* Prisma's `Promise` that is backwards-compatible. All additions on top of the
|
2267
|
+
* original `Promise` are optional so that it can be backwards-compatible.
|
2268
|
+
* @see [[createPrismaPromise]]
|
2269
|
+
*/
|
2270
|
+
declare interface PrismaPromise_2<A> extends Promise<A> {
|
2271
|
+
/**
|
2272
|
+
* Extension of the original `.then` function
|
2273
|
+
* @param onfulfilled same as regular promises
|
2274
|
+
* @param onrejected same as regular promises
|
2275
|
+
* @param transaction transaction options
|
2276
|
+
*/
|
2277
|
+
then<R1 = A, R2 = never>(onfulfilled?: (value: A) => R1 | PromiseLike<R1>, onrejected?: (error: unknown) => R2 | PromiseLike<R2>, transaction?: PrismaPromiseTransaction): Promise<R1 | R2>;
|
2278
|
+
/**
|
2279
|
+
* Extension of the original `.catch` function
|
2280
|
+
* @param onrejected same as regular promises
|
2281
|
+
* @param transaction transaction options
|
2282
|
+
*/
|
2283
|
+
catch<R = never>(onrejected?: ((reason: any) => R | PromiseLike<R>) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<A | R>;
|
2284
|
+
/**
|
2285
|
+
* Extension of the original `.finally` function
|
2286
|
+
* @param onfinally same as regular promises
|
2287
|
+
* @param transaction transaction options
|
2288
|
+
*/
|
2289
|
+
finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise<A>;
|
2290
|
+
/**
|
2291
|
+
* Called when executing a batch of regular tx
|
2292
|
+
* @param transaction transaction options for batch tx
|
2293
|
+
*/
|
2294
|
+
requestTransaction?(transaction: PrismaPromiseBatchTransaction): PromiseLike<unknown>;
|
2295
|
+
}
|
2296
|
+
|
2297
|
+
declare type PrismaPromiseBatchTransaction = {
|
2298
|
+
kind: 'batch';
|
2299
|
+
id: number;
|
2300
|
+
isolationLevel?: IsolationLevel;
|
2301
|
+
index: number;
|
2302
|
+
lock: PromiseLike<void>;
|
2303
|
+
};
|
2304
|
+
|
2305
|
+
declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2<unknown>;
|
2306
|
+
|
2307
|
+
/**
|
2308
|
+
* Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which
|
2309
|
+
* is essentially a proxy for `Promise`. All the transaction-compatible client
|
2310
|
+
* methods return one, this allows for pre-preparing queries without executing
|
2311
|
+
* them until `.then` is called. It's the foundation of Prisma's query batching.
|
2312
|
+
* @param callback that will be wrapped within our promise implementation
|
2313
|
+
* @see [[PrismaPromise]]
|
2314
|
+
* @returns
|
2315
|
+
*/
|
2316
|
+
declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2<unknown>;
|
2317
|
+
|
2318
|
+
declare type PrismaPromiseInteractiveTransaction<PayloadType = unknown> = {
|
2319
|
+
kind: 'itx';
|
2320
|
+
id: string;
|
2321
|
+
payload: PayloadType;
|
2322
|
+
};
|
2323
|
+
|
2324
|
+
declare type PrismaPromiseTransaction<PayloadType = unknown> = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction<PayloadType>;
|
2325
|
+
|
2326
|
+
declare namespace Public {
|
2327
|
+
export {
|
2328
|
+
validator
|
2329
|
+
}
|
2330
|
+
}
|
2331
|
+
export { Public }
|
2332
|
+
|
2333
|
+
declare namespace Public_2 {
|
2334
|
+
export {
|
2335
|
+
Args,
|
2336
|
+
Result,
|
2337
|
+
Payload,
|
2338
|
+
PrismaPromise,
|
2339
|
+
Operation,
|
2340
|
+
Exact
|
2341
|
+
}
|
2342
|
+
}
|
2343
|
+
|
2344
|
+
declare type Query = {
|
2345
|
+
sql: string;
|
2346
|
+
args: Array<unknown>;
|
2347
|
+
};
|
2348
|
+
|
2349
|
+
declare interface Queryable {
|
2350
|
+
readonly provider: 'mysql' | 'postgres' | 'sqlite';
|
2351
|
+
readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {});
|
2352
|
+
/**
|
2353
|
+
* Execute a query given as SQL, interpolating the given parameters,
|
2354
|
+
* and returning the type-aware result set of the query.
|
2355
|
+
*
|
2356
|
+
* This is the preferred way of executing `SELECT` queries.
|
2357
|
+
*/
|
2358
|
+
queryRaw(params: Query): Promise<Result_4<ResultSet>>;
|
2359
|
+
/**
|
2360
|
+
* Execute a query given as SQL, interpolating the given parameters,
|
2361
|
+
* and returning the number of affected rows.
|
2362
|
+
*
|
2363
|
+
* This is the preferred way of executing `INSERT`, `UPDATE`, `DELETE` queries,
|
2364
|
+
* as well as transactional queries.
|
2365
|
+
*/
|
2366
|
+
executeRaw(params: Query): Promise<Result_4<number>>;
|
2367
|
+
}
|
2368
|
+
|
2369
|
+
declare type QueryEngineBatchGraphQLRequest = {
|
2370
|
+
batch: QueryEngineRequest[];
|
2371
|
+
transaction?: boolean;
|
2372
|
+
isolationLevel?: Transaction_2.IsolationLevel;
|
2373
|
+
};
|
2374
|
+
|
2375
|
+
declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery;
|
2376
|
+
|
2377
|
+
declare type QueryEngineConfig = {
|
2378
|
+
datamodel: string;
|
2379
|
+
configDir: string;
|
2380
|
+
logQueries: boolean;
|
2381
|
+
ignoreEnvVarErrors: boolean;
|
2382
|
+
datasourceOverrides: Record<string, string>;
|
2383
|
+
env: Record<string, string | undefined>;
|
2384
|
+
logLevel: QueryEngineLogLevel;
|
2385
|
+
telemetry?: QueryEngineTelemetry;
|
2386
|
+
engineProtocol: EngineProtocol;
|
2387
|
+
};
|
2388
|
+
|
2389
|
+
declare interface QueryEngineConstructor {
|
2390
|
+
new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingDriverAdapter): QueryEngineInstance;
|
2391
|
+
}
|
2392
|
+
|
2393
|
+
declare type QueryEngineInstance = {
|
2394
|
+
connect(headers: string): Promise<void>;
|
2395
|
+
disconnect(headers: string): Promise<void>;
|
2396
|
+
/**
|
2397
|
+
* @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest`
|
2398
|
+
* @param headersStr JSON.stringified `QueryEngineRequestHeaders`
|
2399
|
+
*/
|
2400
|
+
query(requestStr: string, headersStr: string, transactionId?: string): Promise<string>;
|
2401
|
+
sdlSchema(): Promise<string>;
|
2402
|
+
dmmf(traceparent: string): Promise<string>;
|
2403
|
+
startTransaction(options: string, traceHeaders: string): Promise<string>;
|
2404
|
+
commitTransaction(id: string, traceHeaders: string): Promise<string>;
|
2405
|
+
rollbackTransaction(id: string, traceHeaders: string): Promise<string>;
|
2406
|
+
metrics(options: string): Promise<string>;
|
2407
|
+
applyPendingMigrations(): Promise<void>;
|
2408
|
+
};
|
2409
|
+
|
2410
|
+
declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off';
|
2411
|
+
|
2412
|
+
declare type QueryEngineRequest = {
|
2413
|
+
query: string;
|
2414
|
+
variables: Object;
|
2415
|
+
};
|
2416
|
+
|
2417
|
+
declare type QueryEngineResult<T> = {
|
2418
|
+
data: T;
|
2419
|
+
elapsed: number;
|
2420
|
+
};
|
2421
|
+
|
2422
|
+
declare type QueryEngineTelemetry = {
|
2423
|
+
enabled: Boolean;
|
2424
|
+
endpoint: string;
|
2425
|
+
};
|
2426
|
+
|
2427
|
+
declare type QueryEvent = {
|
2428
|
+
timestamp: Date;
|
2429
|
+
query: string;
|
2430
|
+
params: string;
|
2431
|
+
duration: number;
|
2432
|
+
target: string;
|
2433
|
+
};
|
2434
|
+
|
2435
|
+
declare type QueryEventType = 'query';
|
2436
|
+
|
2437
|
+
declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise<unknown>) => Promise<unknown>;
|
2438
|
+
|
2439
|
+
declare type QueryMiddlewareParams = {
|
2440
|
+
/** The model this is executed on */
|
2441
|
+
model?: string;
|
2442
|
+
/** The action that is being handled */
|
2443
|
+
action: Action;
|
2444
|
+
/** TODO what is this */
|
2445
|
+
dataPath: string[];
|
2446
|
+
/** TODO what is this */
|
2447
|
+
runInTransaction: boolean;
|
2448
|
+
args?: UserArgs_2;
|
2449
|
+
};
|
2450
|
+
|
2451
|
+
export declare type QueryOptions = {
|
2452
|
+
query: {
|
2453
|
+
[ModelName in string]: {
|
2454
|
+
[ModelAction in string]: ModelQueryOptionsCb;
|
2455
|
+
} | QueryOptionsCb;
|
2456
|
+
};
|
2457
|
+
};
|
2458
|
+
|
2459
|
+
export declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise<any>;
|
2460
|
+
|
2461
|
+
export declare type QueryOptionsCbArgs = {
|
2462
|
+
model?: string;
|
2463
|
+
operation: string;
|
2464
|
+
args: JsArgs | RawQueryArgs;
|
2465
|
+
query: (args: JsArgs | RawQueryArgs) => Promise<unknown>;
|
2466
|
+
};
|
2467
|
+
|
2468
|
+
/**
|
2469
|
+
* Create raw SQL statement.
|
2470
|
+
*/
|
2471
|
+
export declare function raw(value: string): Sql;
|
2472
|
+
|
2473
|
+
export declare type RawParameters = {
|
2474
|
+
__prismaRawParameters__: true;
|
2475
|
+
values: string;
|
2476
|
+
};
|
2477
|
+
|
2478
|
+
export declare type RawQueryArgs = Sql | [query: string, ...values: RawValue[]];
|
2479
|
+
|
2480
|
+
declare type RawTaggedValue = {
|
2481
|
+
$type: 'Raw';
|
2482
|
+
value: unknown;
|
2483
|
+
};
|
2484
|
+
|
2485
|
+
/**
|
2486
|
+
* Supported value or SQL instance.
|
2487
|
+
*/
|
2488
|
+
export declare type RawValue = Value | Sql;
|
2489
|
+
|
2490
|
+
export declare type ReadonlyDeep<T> = {
|
2491
|
+
readonly [K in keyof T]: ReadonlyDeep<T[K]>;
|
2492
|
+
};
|
2493
|
+
|
2494
|
+
declare type ReadonlyDeep_2<O> = {
|
2495
|
+
+readonly [K in keyof O]: ReadonlyDeep_2<O[K]>;
|
2496
|
+
};
|
2497
|
+
|
2498
|
+
declare type Record_2<T extends string | number | symbol, U> = {
|
2499
|
+
[P in T]: U;
|
2500
|
+
};
|
2501
|
+
export { Record_2 as Record }
|
2502
|
+
|
2503
|
+
export declare type RenameAndNestPayloadKeys<P> = {
|
2504
|
+
[K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K];
|
2505
|
+
};
|
2506
|
+
|
2507
|
+
declare type RequestBatchOptions<InteractiveTransactionPayload> = {
|
2508
|
+
transaction?: TransactionOptions_2<InteractiveTransactionPayload>;
|
2509
|
+
traceparent?: string;
|
2510
|
+
numTry?: number;
|
2511
|
+
containsWrite: boolean;
|
2512
|
+
customDataProxyFetch?: (fetch: Fetch) => Fetch;
|
2513
|
+
};
|
2514
|
+
|
2515
|
+
declare interface RequestError {
|
2516
|
+
error: string;
|
2517
|
+
user_facing_error: {
|
2518
|
+
is_panic: boolean;
|
2519
|
+
message: string;
|
2520
|
+
meta?: Record<string, unknown>;
|
2521
|
+
error_code?: string;
|
2522
|
+
batch_request_idx?: number;
|
2523
|
+
};
|
2524
|
+
}
|
2525
|
+
|
2526
|
+
declare class RequestHandler {
|
2527
|
+
client: Client;
|
2528
|
+
dataloader: DataLoader<RequestParams>;
|
2529
|
+
private logEmitter?;
|
2530
|
+
constructor(client: Client, logEmitter?: LogEmitter);
|
2531
|
+
request(params: RequestParams): Promise<any>;
|
2532
|
+
mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult<any>): any;
|
2533
|
+
/**
|
2534
|
+
* Handles the error and logs it, logging the error is done synchronously waiting for the event
|
2535
|
+
* handlers to finish.
|
2536
|
+
*/
|
2537
|
+
handleAndLogRequestError(params: HandleErrorParams): never;
|
2538
|
+
handleRequestError({ error, clientMethod, callsite, transaction, args, modelName }: HandleErrorParams): never;
|
2539
|
+
sanitizeMessage(message: any): any;
|
2540
|
+
unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any;
|
2541
|
+
get [Symbol.toStringTag](): string;
|
2542
|
+
}
|
2543
|
+
|
2544
|
+
declare type RequestOptions = {
|
2545
|
+
method?: string;
|
2546
|
+
headers?: Record<string, string>;
|
2547
|
+
body?: string;
|
2548
|
+
};
|
2549
|
+
|
2550
|
+
declare type RequestOptions_2<InteractiveTransactionPayload> = {
|
2551
|
+
traceparent?: string;
|
2552
|
+
numTry?: number;
|
2553
|
+
interactiveTransaction?: InteractiveTransactionOptions<InteractiveTransactionPayload>;
|
2554
|
+
isWrite: boolean;
|
2555
|
+
customDataProxyFetch?: (fetch: Fetch) => Fetch;
|
2556
|
+
};
|
2557
|
+
|
2558
|
+
declare type RequestParams = {
|
2559
|
+
modelName?: string;
|
2560
|
+
action: Action;
|
2561
|
+
protocolQuery: JsonQuery;
|
2562
|
+
dataPath: string[];
|
2563
|
+
clientMethod: string;
|
2564
|
+
callsite?: CallSite;
|
2565
|
+
transaction?: PrismaPromiseTransaction;
|
2566
|
+
extensions: MergedExtensionsList;
|
2567
|
+
args?: any;
|
2568
|
+
headers?: Record<string, string>;
|
2569
|
+
unpacker?: Unpacker;
|
2570
|
+
otelParentCtx?: Context;
|
2571
|
+
otelChildCtx?: Context;
|
2572
|
+
customDataProxyFetch?: (fetch: Fetch) => Fetch;
|
2573
|
+
};
|
2574
|
+
|
2575
|
+
declare type RequestResponse = {
|
2576
|
+
ok: boolean;
|
2577
|
+
url: string;
|
2578
|
+
statusText?: string;
|
2579
|
+
status: number;
|
2580
|
+
headers: NodeHeaders;
|
2581
|
+
text: () => Promise<string>;
|
2582
|
+
json: () => Promise<any>;
|
2583
|
+
};
|
2584
|
+
|
2585
|
+
declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions;
|
2586
|
+
export { RequiredExtensionArgs }
|
2587
|
+
export { RequiredExtensionArgs as UserArgs }
|
2588
|
+
|
2589
|
+
export declare type RequiredKeys<O> = {
|
2590
|
+
[K in keyof O]-?: {} extends Pick_2<O, K> ? never : K;
|
2591
|
+
}[keyof O];
|
2592
|
+
|
2593
|
+
declare function resolveDatasourceUrl({ inlineDatasources, overrideDatasources, env, clientVersion, }: {
|
2594
|
+
inlineDatasources: GetPrismaClientConfig['inlineDatasources'];
|
2595
|
+
overrideDatasources: Datasources;
|
2596
|
+
env: Record<string, string | undefined>;
|
2597
|
+
clientVersion: string;
|
2598
|
+
}): string;
|
2599
|
+
|
2600
|
+
export declare type Result<T, A, F extends Operation> = T extends {
|
2601
|
+
[K: symbol]: {
|
2602
|
+
types: {
|
2603
|
+
payload: any;
|
2604
|
+
};
|
2605
|
+
};
|
2606
|
+
} ? GetResult<T[symbol]['types']['payload'], A, F> : GetResult<{
|
2607
|
+
composites: {};
|
2608
|
+
objects: {};
|
2609
|
+
scalars: {};
|
2610
|
+
}, {}, F>;
|
2611
|
+
|
2612
|
+
export declare type Result_2<T, A, F extends Operation> = Result<T, A, F>;
|
2613
|
+
|
2614
|
+
declare namespace Result_3 {
|
2615
|
+
export {
|
2616
|
+
Operation,
|
2617
|
+
FluentOperation,
|
2618
|
+
Count,
|
2619
|
+
TrueKeys,
|
2620
|
+
GetFindResult,
|
2621
|
+
GetSelectIncludeResult,
|
2622
|
+
SelectablePayloadFields,
|
2623
|
+
SelectField,
|
2624
|
+
DefaultSelection,
|
2625
|
+
UnwrapPayload,
|
2626
|
+
GetCountResult,
|
2627
|
+
Aggregate,
|
2628
|
+
GetAggregateResult,
|
2629
|
+
GetBatchResult,
|
2630
|
+
GetGroupByResult,
|
2631
|
+
GetResult
|
2632
|
+
}
|
2633
|
+
}
|
2634
|
+
|
2635
|
+
declare type Result_4<T> = {
|
2636
|
+
map<U>(fn: (value: T) => U): Result_4<U>;
|
2637
|
+
flatMap<U>(fn: (value: T) => Result_4<U>): Result_4<U>;
|
2638
|
+
} & ({
|
2639
|
+
readonly ok: true;
|
2640
|
+
readonly value: T;
|
2641
|
+
} | {
|
2642
|
+
readonly ok: false;
|
2643
|
+
readonly error: Error_2;
|
2644
|
+
});
|
2645
|
+
|
2646
|
+
export declare type ResultArg = {
|
2647
|
+
[FieldName in string]: ResultFieldDefinition;
|
2648
|
+
};
|
2649
|
+
|
2650
|
+
export declare type ResultArgs = {
|
2651
|
+
result: {
|
2652
|
+
[ModelName in string]: ResultArg;
|
2653
|
+
};
|
2654
|
+
};
|
2655
|
+
|
2656
|
+
export declare type ResultArgsFieldCompute = (model: any) => unknown;
|
2657
|
+
|
2658
|
+
export declare type ResultFieldDefinition = {
|
2659
|
+
needs?: {
|
2660
|
+
[FieldName in string]: boolean;
|
2661
|
+
};
|
2662
|
+
compute: ResultArgsFieldCompute;
|
2663
|
+
};
|
2664
|
+
|
2665
|
+
declare interface ResultSet {
|
2666
|
+
/**
|
2667
|
+
* List of column types appearing in a database query, in the same order as `columnNames`.
|
2668
|
+
* They are used within the Query Engine to convert values from JS to Quaint values.
|
2669
|
+
*/
|
2670
|
+
columnTypes: Array<ColumnType>;
|
2671
|
+
/**
|
2672
|
+
* List of column names appearing in a database query, in the same order as `columnTypes`.
|
2673
|
+
*/
|
2674
|
+
columnNames: Array<string>;
|
2675
|
+
/**
|
2676
|
+
* List of rows retrieved from a database query.
|
2677
|
+
* Each row is a list of values, whose length matches `columnNames` and `columnTypes`.
|
2678
|
+
*/
|
2679
|
+
rows: Array<Array<unknown>>;
|
2680
|
+
/**
|
2681
|
+
* The last ID of an `INSERT` statement, if any.
|
2682
|
+
* This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite.
|
2683
|
+
*/
|
2684
|
+
lastInsertId?: string;
|
2685
|
+
}
|
2686
|
+
|
2687
|
+
export declare type Return<T> = T extends (...args: any[]) => infer R ? R : T;
|
2688
|
+
|
2689
|
+
declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown";
|
2690
|
+
|
2691
|
+
declare type RuntimeDataModel = {
|
2692
|
+
readonly models: Record<string, RuntimeModel>;
|
2693
|
+
readonly enums: Record<string, RuntimeEnum>;
|
2694
|
+
readonly types: Record<string, RuntimeModel>;
|
2695
|
+
};
|
2696
|
+
|
2697
|
+
declare type RuntimeEnum = Omit<DMMF.DatamodelEnum, 'name'>;
|
2698
|
+
|
2699
|
+
declare type RuntimeModel = Omit<DMMF.Model, 'name'>;
|
2700
|
+
|
2701
|
+
export declare type Select<T, U> = T extends U ? T : never;
|
2702
|
+
|
2703
|
+
export declare type SelectablePayloadFields<K extends PropertyKey, O> = {
|
2704
|
+
objects: {
|
2705
|
+
[k in K]: O;
|
2706
|
+
};
|
2707
|
+
} | {
|
2708
|
+
composites: {
|
2709
|
+
[k in K]: O;
|
2710
|
+
};
|
2711
|
+
};
|
2712
|
+
|
2713
|
+
export declare type SelectField<P extends SelectablePayloadFields<any, any>, K extends PropertyKey> = P extends {
|
2714
|
+
objects: Record<K, any>;
|
2715
|
+
} ? P['objects'][K] : P extends {
|
2716
|
+
composites: Record<K, any>;
|
2717
|
+
} ? P['composites'][K] : never;
|
2718
|
+
|
2719
|
+
declare type Selection_2 = Record<string, boolean | JsArgs>;
|
2720
|
+
export { Selection_2 as Selection }
|
2721
|
+
|
2722
|
+
/**
|
2723
|
+
* An interface that represents a span. A span represents a single operation
|
2724
|
+
* within a trace. Examples of span might include remote procedure calls or a
|
2725
|
+
* in-process function calls to sub-components. A Trace has a single, top-level
|
2726
|
+
* "root" Span that in turn may have zero or more child Spans, which in turn
|
2727
|
+
* may have children.
|
2728
|
+
*
|
2729
|
+
* Spans are created by the {@link Tracer.startSpan} method.
|
2730
|
+
*/
|
2731
|
+
declare interface Span {
|
2732
|
+
/**
|
2733
|
+
* Returns the {@link SpanContext} object associated with this Span.
|
2734
|
+
*
|
2735
|
+
* Get an immutable, serializable identifier for this span that can be used
|
2736
|
+
* to create new child spans. Returned SpanContext is usable even after the
|
2737
|
+
* span ends.
|
2738
|
+
*
|
2739
|
+
* @returns the SpanContext object associated with this Span.
|
2740
|
+
*/
|
2741
|
+
spanContext(): SpanContext;
|
2742
|
+
/**
|
2743
|
+
* Sets an attribute to the span.
|
2744
|
+
*
|
2745
|
+
* Sets a single Attribute with the key and value passed as arguments.
|
2746
|
+
*
|
2747
|
+
* @param key the key for this attribute.
|
2748
|
+
* @param value the value for this attribute. Setting a value null or
|
2749
|
+
* undefined is invalid and will result in undefined behavior.
|
2750
|
+
*/
|
2751
|
+
setAttribute(key: string, value: SpanAttributeValue): this;
|
2752
|
+
/**
|
2753
|
+
* Sets attributes to the span.
|
2754
|
+
*
|
2755
|
+
* @param attributes the attributes that will be added.
|
2756
|
+
* null or undefined attribute values
|
2757
|
+
* are invalid and will result in undefined behavior.
|
2758
|
+
*/
|
2759
|
+
setAttributes(attributes: SpanAttributes): this;
|
2760
|
+
/**
|
2761
|
+
* Adds an event to the Span.
|
2762
|
+
*
|
2763
|
+
* @param name the name of the event.
|
2764
|
+
* @param [attributesOrStartTime] the attributes that will be added; these are
|
2765
|
+
* associated with this event. Can be also a start time
|
2766
|
+
* if type is {@type TimeInput} and 3rd param is undefined
|
2767
|
+
* @param [startTime] start time of the event.
|
2768
|
+
*/
|
2769
|
+
addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this;
|
2770
|
+
/**
|
2771
|
+
* Sets a status to the span. If used, this will override the default Span
|
2772
|
+
* status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value
|
2773
|
+
* of previous calls to SetStatus on the Span.
|
2774
|
+
*
|
2775
|
+
* @param status the SpanStatus to set.
|
2776
|
+
*/
|
2777
|
+
setStatus(status: SpanStatus): this;
|
2778
|
+
/**
|
2779
|
+
* Updates the Span name.
|
2780
|
+
*
|
2781
|
+
* This will override the name provided via {@link Tracer.startSpan}.
|
2782
|
+
*
|
2783
|
+
* Upon this update, any sampling behavior based on Span name will depend on
|
2784
|
+
* the implementation.
|
2785
|
+
*
|
2786
|
+
* @param name the Span name.
|
2787
|
+
*/
|
2788
|
+
updateName(name: string): this;
|
2789
|
+
/**
|
2790
|
+
* Marks the end of Span execution.
|
2791
|
+
*
|
2792
|
+
* Call to End of a Span MUST not have any effects on child spans. Those may
|
2793
|
+
* still be running and can be ended later.
|
2794
|
+
*
|
2795
|
+
* Do not return `this`. The Span generally should not be used after it
|
2796
|
+
* is ended so chaining is not desired in this context.
|
2797
|
+
*
|
2798
|
+
* @param [endTime] the time to set as Span's end time. If not provided,
|
2799
|
+
* use the current time as the span's end time.
|
2800
|
+
*/
|
2801
|
+
end(endTime?: TimeInput): void;
|
2802
|
+
/**
|
2803
|
+
* Returns the flag whether this span will be recorded.
|
2804
|
+
*
|
2805
|
+
* @returns true if this Span is active and recording information like events
|
2806
|
+
* with the `AddEvent` operation and attributes using `setAttributes`.
|
2807
|
+
*/
|
2808
|
+
isRecording(): boolean;
|
2809
|
+
/**
|
2810
|
+
* Sets exception as a span event
|
2811
|
+
* @param exception the exception the only accepted values are string or Error
|
2812
|
+
* @param [time] the time to set as Span's event time. If not provided,
|
2813
|
+
* use the current time.
|
2814
|
+
*/
|
2815
|
+
recordException(exception: Exception, time?: TimeInput): void;
|
2816
|
+
}
|
2817
|
+
|
2818
|
+
/**
|
2819
|
+
* @deprecated please use {@link Attributes}
|
2820
|
+
*/
|
2821
|
+
declare type SpanAttributes = Attributes;
|
2822
|
+
|
2823
|
+
/**
|
2824
|
+
* @deprecated please use {@link AttributeValue}
|
2825
|
+
*/
|
2826
|
+
declare type SpanAttributeValue = AttributeValue;
|
2827
|
+
|
2828
|
+
declare type SpanCallback<R> = (span?: Span, context?: Context) => R;
|
2829
|
+
|
2830
|
+
/**
|
2831
|
+
* A SpanContext represents the portion of a {@link Span} which must be
|
2832
|
+
* serialized and propagated along side of a {@link Baggage}.
|
2833
|
+
*/
|
2834
|
+
declare interface SpanContext {
|
2835
|
+
/**
|
2836
|
+
* The ID of the trace that this span belongs to. It is worldwide unique
|
2837
|
+
* with practically sufficient probability by being made as 16 randomly
|
2838
|
+
* generated bytes, encoded as a 32 lowercase hex characters corresponding to
|
2839
|
+
* 128 bits.
|
2840
|
+
*/
|
2841
|
+
traceId: string;
|
2842
|
+
/**
|
2843
|
+
* The ID of the Span. It is globally unique with practically sufficient
|
2844
|
+
* probability by being made as 8 randomly generated bytes, encoded as a 16
|
2845
|
+
* lowercase hex characters corresponding to 64 bits.
|
2846
|
+
*/
|
2847
|
+
spanId: string;
|
2848
|
+
/**
|
2849
|
+
* Only true if the SpanContext was propagated from a remote parent.
|
2850
|
+
*/
|
2851
|
+
isRemote?: boolean;
|
2852
|
+
/**
|
2853
|
+
* Trace flags to propagate.
|
2854
|
+
*
|
2855
|
+
* It is represented as 1 byte (bitmap). Bit to represent whether trace is
|
2856
|
+
* sampled or not. When set, the least significant bit documents that the
|
2857
|
+
* caller may have recorded trace data. A caller who does not record trace
|
2858
|
+
* data out-of-band leaves this flag unset.
|
2859
|
+
*
|
2860
|
+
* see {@link TraceFlags} for valid flag values.
|
2861
|
+
*/
|
2862
|
+
traceFlags: number;
|
2863
|
+
/**
|
2864
|
+
* Tracing-system-specific info to propagate.
|
2865
|
+
*
|
2866
|
+
* The tracestate field value is a `list` as defined below. The `list` is a
|
2867
|
+
* series of `list-members` separated by commas `,`, and a list-member is a
|
2868
|
+
* key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
|
2869
|
+
* surrounding `list-members` are ignored. There can be a maximum of 32
|
2870
|
+
* `list-members` in a `list`.
|
2871
|
+
* More Info: https://www.w3.org/TR/trace-context/#tracestate-field
|
2872
|
+
*
|
2873
|
+
* Examples:
|
2874
|
+
* Single tracing system (generic format):
|
2875
|
+
* tracestate: rojo=00f067aa0ba902b7
|
2876
|
+
* Multiple tracing systems (with different formatting):
|
2877
|
+
* tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE
|
2878
|
+
*/
|
2879
|
+
traceState?: TraceState;
|
2880
|
+
}
|
2881
|
+
|
2882
|
+
declare enum SpanKind {
|
2883
|
+
/** Default value. Indicates that the span is used internally. */
|
2884
|
+
INTERNAL = 0,
|
2885
|
+
/**
|
2886
|
+
* Indicates that the span covers server-side handling of an RPC or other
|
2887
|
+
* remote request.
|
2888
|
+
*/
|
2889
|
+
SERVER = 1,
|
2890
|
+
/**
|
2891
|
+
* Indicates that the span covers the client-side wrapper around an RPC or
|
2892
|
+
* other remote request.
|
2893
|
+
*/
|
2894
|
+
CLIENT = 2,
|
2895
|
+
/**
|
2896
|
+
* Indicates that the span describes producer sending a message to a
|
2897
|
+
* broker. Unlike client and server, there is no direct critical path latency
|
2898
|
+
* relationship between producer and consumer spans.
|
2899
|
+
*/
|
2900
|
+
PRODUCER = 3,
|
2901
|
+
/**
|
2902
|
+
* Indicates that the span describes consumer receiving a message from a
|
2903
|
+
* broker. Unlike client and server, there is no direct critical path latency
|
2904
|
+
* relationship between producer and consumer spans.
|
2905
|
+
*/
|
2906
|
+
CONSUMER = 4
|
2907
|
+
}
|
2908
|
+
|
2909
|
+
/**
|
2910
|
+
* Options needed for span creation
|
2911
|
+
*/
|
2912
|
+
declare interface SpanOptions {
|
2913
|
+
/**
|
2914
|
+
* The SpanKind of a span
|
2915
|
+
* @default {@link SpanKind.INTERNAL}
|
2916
|
+
*/
|
2917
|
+
kind?: SpanKind;
|
2918
|
+
/** A span's attributes */
|
2919
|
+
attributes?: SpanAttributes;
|
2920
|
+
/** {@link Link}s span to other spans */
|
2921
|
+
links?: Link[];
|
2922
|
+
/** A manually specified start time for the created `Span` object. */
|
2923
|
+
startTime?: TimeInput;
|
2924
|
+
/** The new span should be a root span. (Ignore parent from context). */
|
2925
|
+
root?: boolean;
|
2926
|
+
}
|
2927
|
+
|
2928
|
+
declare interface SpanStatus {
|
2929
|
+
/** The status code of this message. */
|
2930
|
+
code: SpanStatusCode;
|
2931
|
+
/** A developer-facing error message. */
|
2932
|
+
message?: string;
|
2933
|
+
}
|
2934
|
+
|
2935
|
+
/**
|
2936
|
+
* An enumeration of status codes.
|
2937
|
+
*/
|
2938
|
+
declare enum SpanStatusCode {
|
2939
|
+
/**
|
2940
|
+
* The default status.
|
2941
|
+
*/
|
2942
|
+
UNSET = 0,
|
2943
|
+
/**
|
2944
|
+
* The operation has been validated by an Application developer or
|
2945
|
+
* Operator to have completed successfully.
|
2946
|
+
*/
|
2947
|
+
OK = 1,
|
2948
|
+
/**
|
2949
|
+
* The operation contains an error.
|
2950
|
+
*/
|
2951
|
+
ERROR = 2
|
2952
|
+
}
|
2953
|
+
|
2954
|
+
/**
|
2955
|
+
* A SQL instance can be nested within each other to build SQL strings.
|
2956
|
+
*/
|
2957
|
+
export declare class Sql {
|
2958
|
+
readonly values: Value[];
|
2959
|
+
readonly strings: string[];
|
2960
|
+
constructor(rawStrings: readonly string[], rawValues: readonly RawValue[]);
|
2961
|
+
get sql(): string;
|
2962
|
+
get statement(): string;
|
2963
|
+
get text(): string;
|
2964
|
+
inspect(): {
|
2965
|
+
sql: string;
|
2966
|
+
statement: string;
|
2967
|
+
text: string;
|
2968
|
+
values: unknown[];
|
2969
|
+
};
|
2970
|
+
}
|
2971
|
+
|
2972
|
+
/**
|
2973
|
+
* Create a SQL object from a template string.
|
2974
|
+
*/
|
2975
|
+
export declare function sqltag(strings: readonly string[], ...values: readonly RawValue[]): Sql;
|
2976
|
+
|
2977
|
+
/**
|
2978
|
+
* Defines TimeInput.
|
2979
|
+
*
|
2980
|
+
* hrtime, epoch milliseconds, performance.now() or Date
|
2981
|
+
*/
|
2982
|
+
declare type TimeInput = HrTime | number | Date;
|
2983
|
+
|
2984
|
+
export declare type ToTuple<T> = T extends any[] ? T : [T];
|
2985
|
+
|
2986
|
+
declare interface TraceState {
|
2987
|
+
/**
|
2988
|
+
* Create a new TraceState which inherits from this TraceState and has the
|
2989
|
+
* given key set.
|
2990
|
+
* The new entry will always be added in the front of the list of states.
|
2991
|
+
*
|
2992
|
+
* @param key key of the TraceState entry.
|
2993
|
+
* @param value value of the TraceState entry.
|
2994
|
+
*/
|
2995
|
+
set(key: string, value: string): TraceState;
|
2996
|
+
/**
|
2997
|
+
* Return a new TraceState which inherits from this TraceState but does not
|
2998
|
+
* contain the given key.
|
2999
|
+
*
|
3000
|
+
* @param key the key for the TraceState entry to be removed.
|
3001
|
+
*/
|
3002
|
+
unset(key: string): TraceState;
|
3003
|
+
/**
|
3004
|
+
* Returns the value to which the specified key is mapped, or `undefined` if
|
3005
|
+
* this map contains no mapping for the key.
|
3006
|
+
*
|
3007
|
+
* @param key with which the specified value is to be associated.
|
3008
|
+
* @returns the value to which the specified key is mapped, or `undefined` if
|
3009
|
+
* this map contains no mapping for the key.
|
3010
|
+
*/
|
3011
|
+
get(key: string): string | undefined;
|
3012
|
+
/**
|
3013
|
+
* Serializes the TraceState to a `list` as defined below. The `list` is a
|
3014
|
+
* series of `list-members` separated by commas `,`, and a list-member is a
|
3015
|
+
* key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
|
3016
|
+
* surrounding `list-members` are ignored. There can be a maximum of 32
|
3017
|
+
* `list-members` in a `list`.
|
3018
|
+
*
|
3019
|
+
* @returns the serialized string.
|
3020
|
+
*/
|
3021
|
+
serialize(): string;
|
3022
|
+
}
|
3023
|
+
|
3024
|
+
declare interface TracingHelper {
|
3025
|
+
isEnabled(): boolean;
|
3026
|
+
getTraceParent(context?: Context): string;
|
3027
|
+
createEngineSpan(engineSpanEvent: EngineSpanEvent): void;
|
3028
|
+
getActiveContext(): Context | undefined;
|
3029
|
+
runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R;
|
3030
|
+
}
|
3031
|
+
|
3032
|
+
declare interface Transaction extends Queryable {
|
3033
|
+
/**
|
3034
|
+
* Transaction options.
|
3035
|
+
*/
|
3036
|
+
readonly options: TransactionOptions;
|
3037
|
+
/**
|
3038
|
+
* Commit the transaction.
|
3039
|
+
*/
|
3040
|
+
commit(): Promise<Result_4<void>>;
|
3041
|
+
/**
|
3042
|
+
* Rolls back the transaction.
|
3043
|
+
*/
|
3044
|
+
rollback(): Promise<Result_4<void>>;
|
3045
|
+
}
|
3046
|
+
|
3047
|
+
declare namespace Transaction_2 {
|
3048
|
+
export {
|
3049
|
+
IsolationLevel,
|
3050
|
+
Options,
|
3051
|
+
InteractiveTransactionInfo,
|
3052
|
+
TransactionHeaders
|
3053
|
+
}
|
3054
|
+
}
|
3055
|
+
|
3056
|
+
declare type TransactionHeaders = {
|
3057
|
+
traceparent?: string;
|
3058
|
+
};
|
3059
|
+
|
3060
|
+
declare type TransactionOptions = {
|
3061
|
+
usePhantomQuery: boolean;
|
3062
|
+
};
|
3063
|
+
|
3064
|
+
declare type TransactionOptions_2<InteractiveTransactionPayload> = {
|
3065
|
+
kind: 'itx';
|
3066
|
+
options: InteractiveTransactionOptions<InteractiveTransactionPayload>;
|
3067
|
+
} | {
|
3068
|
+
kind: 'batch';
|
3069
|
+
options: BatchTransactionOptions;
|
3070
|
+
};
|
3071
|
+
|
3072
|
+
export declare type TrueKeys<T> = {
|
3073
|
+
[K in keyof T]: T[K] extends true ? K : never;
|
3074
|
+
}[keyof T];
|
3075
|
+
|
3076
|
+
export declare type TypeMapCbDef = Fn<{
|
3077
|
+
extArgs: InternalArgs;
|
3078
|
+
}, TypeMapDef>;
|
3079
|
+
|
3080
|
+
/** Shared */
|
3081
|
+
export declare type TypeMapDef = Record<any, any>;
|
3082
|
+
|
3083
|
+
declare namespace Types {
|
3084
|
+
export {
|
3085
|
+
Result_3 as Result,
|
3086
|
+
Extensions_2 as Extensions,
|
3087
|
+
Utils,
|
3088
|
+
Public_2 as Public,
|
3089
|
+
OperationPayload as Payload
|
3090
|
+
}
|
3091
|
+
}
|
3092
|
+
export { Types }
|
3093
|
+
|
3094
|
+
declare type UnknownErrorParams = {
|
3095
|
+
clientVersion: string;
|
3096
|
+
batchRequestIdx?: number;
|
3097
|
+
};
|
3098
|
+
|
3099
|
+
declare type Unpacker = (data: any) => any;
|
3100
|
+
|
3101
|
+
export declare type UnwrapPayload<P> = {} extends P ? unknown : {
|
3102
|
+
[K in keyof P]: P[K] extends {
|
3103
|
+
scalars: infer S;
|
3104
|
+
composites: infer C;
|
3105
|
+
}[] ? Array<S & UnwrapPayload<C>> : P[K] extends {
|
3106
|
+
scalars: infer S;
|
3107
|
+
composites: infer C;
|
3108
|
+
} | null ? S & UnwrapPayload<C> | Select<P[K], null> : never;
|
3109
|
+
};
|
3110
|
+
|
3111
|
+
export declare type UnwrapPromise<P> = P extends Promise<infer R> ? R : P;
|
3112
|
+
|
3113
|
+
export declare type UnwrapTuple<Tuple extends readonly unknown[]> = {
|
3114
|
+
[K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise<infer X> ? X : UnwrapPromise<Tuple[K]> : UnwrapPromise<Tuple[K]>;
|
3115
|
+
};
|
3116
|
+
|
3117
|
+
/**
|
3118
|
+
* Input that flows from the user into the Client.
|
3119
|
+
*/
|
3120
|
+
declare type UserArgs_2 = any;
|
3121
|
+
|
3122
|
+
declare namespace Utils {
|
3123
|
+
export {
|
3124
|
+
EmptyToUnknown,
|
3125
|
+
NeverToUnknown,
|
3126
|
+
PatchFlat,
|
3127
|
+
Omit_2 as Omit,
|
3128
|
+
Pick_2 as Pick,
|
3129
|
+
ComputeDeep,
|
3130
|
+
Compute,
|
3131
|
+
OptionalFlat,
|
3132
|
+
ReadonlyDeep,
|
3133
|
+
Narrowable,
|
3134
|
+
Narrow,
|
3135
|
+
Exact,
|
3136
|
+
Cast,
|
3137
|
+
JsonObject,
|
3138
|
+
JsonArray,
|
3139
|
+
JsonValue,
|
3140
|
+
Record_2 as Record,
|
3141
|
+
UnwrapPromise,
|
3142
|
+
UnwrapTuple,
|
3143
|
+
Path,
|
3144
|
+
Fn,
|
3145
|
+
Call,
|
3146
|
+
RequiredKeys,
|
3147
|
+
OptionalKeys,
|
3148
|
+
Optional,
|
3149
|
+
Return,
|
3150
|
+
ToTuple,
|
3151
|
+
RenameAndNestPayloadKeys,
|
3152
|
+
PayloadToResult,
|
3153
|
+
Select,
|
3154
|
+
Equals,
|
3155
|
+
Or,
|
3156
|
+
JsPromise
|
3157
|
+
}
|
3158
|
+
}
|
3159
|
+
|
3160
|
+
declare function validator<V>(): <S>(select: Exact<S, V>) => S;
|
3161
|
+
|
3162
|
+
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): <S>(select: Exact<S, Args<C[M], O>>) => S;
|
3163
|
+
|
3164
|
+
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation, P extends keyof Args<C[M], O>>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S;
|
3165
|
+
|
3166
|
+
/**
|
3167
|
+
* Values supported by SQL engine.
|
3168
|
+
*/
|
3169
|
+
export declare type Value = unknown;
|
3170
|
+
|
3171
|
+
export declare function warnEnvConflicts(envPaths: any): void;
|
3172
|
+
|
3173
|
+
export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void;
|
3174
|
+
|
3175
|
+
declare type WasmLoadingConfig = {
|
3176
|
+
/**
|
3177
|
+
* WASM-bindgen runtime for corresponding module
|
3178
|
+
*/
|
3179
|
+
getRuntime: () => {
|
3180
|
+
__wbg_set_wasm(exports: unknown): any;
|
3181
|
+
QueryEngine: QueryEngineConstructor;
|
3182
|
+
};
|
3183
|
+
/**
|
3184
|
+
* Loads the raw wasm module for the wasm query engine. This configuration is
|
3185
|
+
* generated specifically for each type of client, eg. Node.js client and Edge
|
3186
|
+
* clients will have different implementations.
|
3187
|
+
* @remarks this is a callback on purpose, we only load the wasm if needed.
|
3188
|
+
* @remarks only used by LibraryEngine.ts
|
3189
|
+
*/
|
3190
|
+
getQueryEngineWasmModule: () => Promise<unknown>;
|
3191
|
+
};
|
3192
|
+
|
3193
|
+
export { }
|