@fonoster/apiserver 0.8.13 → 0.8.15

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