@naturalcycles/abba 1.0.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abba.d.ts +2 -2
- package/dist/abba.js +11 -5
- package/dist/index.d.ts +1 -1
- package/dist/prisma-output/index-browser.js +141 -0
- package/dist/prisma-output/index.d.ts +5521 -0
- package/dist/prisma-output/index.js +176 -0
- package/dist/prisma-output/libquery_engine-darwin.dylib.node +0 -0
- package/dist/prisma-output/runtime/esm/index-browser.mjs +2370 -0
- package/dist/prisma-output/runtime/esm/index.mjs +40587 -0
- package/dist/prisma-output/runtime/esm/proxy.mjs +113 -0
- package/dist/prisma-output/runtime/index-browser.d.ts +269 -0
- package/dist/prisma-output/runtime/index-browser.js +2621 -0
- package/dist/prisma-output/runtime/index.d.ts +1373 -0
- package/dist/prisma-output/runtime/index.js +52855 -0
- package/dist/prisma-output/runtime/proxy.d.ts +1373 -0
- package/dist/prisma-output/runtime/proxy.js +13717 -0
- package/dist/prisma-output/schema.prisma +46 -0
- package/dist/types.d.ts +1 -1
- package/dist/util.d.ts +7 -14
- package/dist/util.js +18 -29
- package/package.json +5 -3
- package/readme.md +18 -14
- package/src/abba.ts +13 -13
- package/src/index.ts +1 -1
- package/src/prisma-output/index-browser.js +141 -0
- package/src/prisma-output/index.d.ts +5521 -0
- package/src/prisma-output/index.js +176 -0
- package/src/prisma-output/libquery_engine-darwin.dylib.node +0 -0
- package/src/prisma-output/runtime/esm/index-browser.mjs +2370 -0
- package/src/prisma-output/runtime/esm/index.mjs +40587 -0
- package/src/prisma-output/runtime/esm/proxy.mjs +113 -0
- package/src/prisma-output/runtime/index-browser.d.ts +269 -0
- package/src/prisma-output/runtime/index-browser.js +2621 -0
- package/src/prisma-output/runtime/index.d.ts +1373 -0
- package/src/prisma-output/runtime/index.js +52855 -0
- package/src/prisma-output/runtime/proxy.d.ts +1373 -0
- package/src/prisma-output/runtime/proxy.js +13717 -0
- package/src/prisma-output/schema.prisma +46 -0
- package/src/types.ts +1 -1
- package/src/util.ts +12 -20
|
@@ -0,0 +1,1373 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
import { inspect } from 'util'
|
|
4
|
+
|
|
5
|
+
declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'
|
|
6
|
+
|
|
7
|
+
declare class Arg {
|
|
8
|
+
key: string
|
|
9
|
+
value: ArgValue
|
|
10
|
+
error?: InvalidArgError
|
|
11
|
+
hasError: boolean
|
|
12
|
+
isEnum: boolean
|
|
13
|
+
schemaArg?: DMMF.SchemaArg
|
|
14
|
+
isNullable: boolean
|
|
15
|
+
inputType?: DMMF.SchemaArgInputType
|
|
16
|
+
constructor({ key, value, isEnum, error, schemaArg, inputType }: ArgOptions)
|
|
17
|
+
get [Symbol.toStringTag](): string
|
|
18
|
+
_toString(value: ArgValue, key: string): string | undefined
|
|
19
|
+
toString(): string | undefined
|
|
20
|
+
collectErrors(): ArgError[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare interface ArgError {
|
|
24
|
+
path: string[]
|
|
25
|
+
id?: string
|
|
26
|
+
error: InvalidArgError
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare interface ArgOptions {
|
|
30
|
+
key: string
|
|
31
|
+
value: ArgValue
|
|
32
|
+
isEnum?: boolean
|
|
33
|
+
error?: InvalidArgError
|
|
34
|
+
schemaArg?: DMMF.SchemaArg
|
|
35
|
+
inputType?: DMMF.SchemaArgInputType
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare class Args {
|
|
39
|
+
args: Arg[]
|
|
40
|
+
readonly hasInvalidArg: boolean
|
|
41
|
+
constructor(args?: Arg[])
|
|
42
|
+
get [Symbol.toStringTag](): string
|
|
43
|
+
toString(): string
|
|
44
|
+
collectErrors(): ArgError[]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare type ArgValue =
|
|
48
|
+
| string
|
|
49
|
+
| boolean
|
|
50
|
+
| number
|
|
51
|
+
| undefined
|
|
52
|
+
| Args
|
|
53
|
+
| string[]
|
|
54
|
+
| boolean[]
|
|
55
|
+
| number[]
|
|
56
|
+
| Args[]
|
|
57
|
+
| null
|
|
58
|
+
|
|
59
|
+
declare interface AtLeastOneError {
|
|
60
|
+
type: 'atLeastOne'
|
|
61
|
+
key: string
|
|
62
|
+
inputType: DMMF.InputType
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare interface AtMostOneError {
|
|
66
|
+
type: 'atMostOne'
|
|
67
|
+
key: string
|
|
68
|
+
inputType: DMMF.InputType
|
|
69
|
+
providedKeys: string[]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare interface BinaryTargetsEnvValue {
|
|
73
|
+
fromEnvVar: null | string
|
|
74
|
+
value: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare interface Client_2 {
|
|
78
|
+
_dmmf: DMMFClass
|
|
79
|
+
_engine: Engine
|
|
80
|
+
_fetcher: PrismaClientFetcher
|
|
81
|
+
_connectionPromise?: Promise<any>
|
|
82
|
+
_disconnectionPromise?: Promise<any>
|
|
83
|
+
_engineConfig: EngineConfig
|
|
84
|
+
_clientVersion: string
|
|
85
|
+
_errorFormat: ErrorFormat
|
|
86
|
+
$use<T>(arg0: Namespace | QueryMiddleware<T>, arg1?: QueryMiddleware | EngineMiddleware<T>): any
|
|
87
|
+
$on(eventType: EngineEventType, callback: (event: any) => void): any
|
|
88
|
+
$connect(): any
|
|
89
|
+
$disconnect(): any
|
|
90
|
+
_runDisconnect(): any
|
|
91
|
+
$executeRaw(query: TemplateStringsArray | sqlTemplateTag.Sql, ...values: any[]): any
|
|
92
|
+
$queryRaw(query: TemplateStringsArray | sqlTemplateTag.Sql, ...values: any[]): any
|
|
93
|
+
__internal_triggerPanic(fatal: boolean): any
|
|
94
|
+
$transaction(input: any, options?: any): any
|
|
95
|
+
_request(internalParams: InternalRequestParams): Promise<any>
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare type ConnectorType =
|
|
99
|
+
| 'mysql'
|
|
100
|
+
| 'mongodb'
|
|
101
|
+
| 'sqlite'
|
|
102
|
+
| 'postgresql'
|
|
103
|
+
| 'sqlserver'
|
|
104
|
+
| 'jdbc:sqlserver'
|
|
105
|
+
| 'cockroachdb'
|
|
106
|
+
|
|
107
|
+
declare type ConnectorType_2 =
|
|
108
|
+
| 'mysql'
|
|
109
|
+
| 'mongodb'
|
|
110
|
+
| 'sqlite'
|
|
111
|
+
| 'postgresql'
|
|
112
|
+
| 'sqlserver'
|
|
113
|
+
| 'jdbc:sqlserver'
|
|
114
|
+
| 'cockroachdb'
|
|
115
|
+
|
|
116
|
+
declare interface Context {
|
|
117
|
+
/**
|
|
118
|
+
* Get a value from the context.
|
|
119
|
+
*
|
|
120
|
+
* @param key key which identifies a context value
|
|
121
|
+
*/
|
|
122
|
+
getValue(key: symbol): unknown
|
|
123
|
+
/**
|
|
124
|
+
* Create a new context which inherits from this context and has
|
|
125
|
+
* the given key set to the given value.
|
|
126
|
+
*
|
|
127
|
+
* @param key context key for which to set the value
|
|
128
|
+
* @param value value to set for the given key
|
|
129
|
+
*/
|
|
130
|
+
setValue(key: symbol, value: unknown): Context
|
|
131
|
+
/**
|
|
132
|
+
* Return a new context which inherits from this context but does
|
|
133
|
+
* not contain a value for the given key.
|
|
134
|
+
*
|
|
135
|
+
* @param key context key for which to clear a value
|
|
136
|
+
*/
|
|
137
|
+
deleteValue(key: symbol): Context
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare class DataLoader<T = unknown> {
|
|
141
|
+
private options
|
|
142
|
+
batches: {
|
|
143
|
+
[key: string]: Job[]
|
|
144
|
+
}
|
|
145
|
+
private tickActive
|
|
146
|
+
constructor(options: DataLoaderOptions<T>)
|
|
147
|
+
request(request: T): Promise<any>
|
|
148
|
+
private dispatchBatches
|
|
149
|
+
get [Symbol.toStringTag](): string
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare type DataLoaderOptions<T> = {
|
|
153
|
+
singleLoader: (request: T) => Promise<any>
|
|
154
|
+
batchLoader: (request: T[]) => Promise<any[]>
|
|
155
|
+
batchBy: (request: T) => string | undefined
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare interface DataSource {
|
|
159
|
+
name: string
|
|
160
|
+
activeProvider: ConnectorType
|
|
161
|
+
provider: ConnectorType
|
|
162
|
+
url: EnvValue
|
|
163
|
+
config: {
|
|
164
|
+
[key: string]: string
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare type Datasource = {
|
|
169
|
+
url?: string
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
declare interface DatasourceOverwrite {
|
|
173
|
+
name: string
|
|
174
|
+
url?: string
|
|
175
|
+
env?: string
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare type Datasources = {
|
|
179
|
+
[name in string]: Datasource
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare namespace Decimal {
|
|
183
|
+
export type Constructor = typeof Decimal
|
|
184
|
+
export type Instance = Decimal
|
|
185
|
+
export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
|
|
186
|
+
export type Modulo = Rounding | 9
|
|
187
|
+
export type Value = string | number | Decimal
|
|
188
|
+
|
|
189
|
+
// http://mikemcl.github.io/decimal.js/#constructor-properties
|
|
190
|
+
export interface Config {
|
|
191
|
+
precision?: number
|
|
192
|
+
rounding?: Rounding
|
|
193
|
+
toExpNeg?: number
|
|
194
|
+
toExpPos?: number
|
|
195
|
+
minE?: number
|
|
196
|
+
maxE?: number
|
|
197
|
+
crypto?: boolean
|
|
198
|
+
modulo?: Modulo
|
|
199
|
+
defaults?: boolean
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export declare class Decimal {
|
|
204
|
+
readonly d: number[]
|
|
205
|
+
readonly e: number
|
|
206
|
+
readonly s: number
|
|
207
|
+
private readonly toStringTag: string
|
|
208
|
+
|
|
209
|
+
constructor(n: Decimal.Value)
|
|
210
|
+
|
|
211
|
+
absoluteValue(): Decimal
|
|
212
|
+
abs(): Decimal
|
|
213
|
+
|
|
214
|
+
ceil(): Decimal
|
|
215
|
+
|
|
216
|
+
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal
|
|
217
|
+
clamp(min: Decimal.Value, max: Decimal.Value): Decimal
|
|
218
|
+
|
|
219
|
+
comparedTo(n: Decimal.Value): number
|
|
220
|
+
cmp(n: Decimal.Value): number
|
|
221
|
+
|
|
222
|
+
cosine(): Decimal
|
|
223
|
+
cos(): Decimal
|
|
224
|
+
|
|
225
|
+
cubeRoot(): Decimal
|
|
226
|
+
cbrt(): Decimal
|
|
227
|
+
|
|
228
|
+
decimalPlaces(): number
|
|
229
|
+
dp(): number
|
|
230
|
+
|
|
231
|
+
dividedBy(n: Decimal.Value): Decimal
|
|
232
|
+
div(n: Decimal.Value): Decimal
|
|
233
|
+
|
|
234
|
+
dividedToIntegerBy(n: Decimal.Value): Decimal
|
|
235
|
+
divToInt(n: Decimal.Value): Decimal
|
|
236
|
+
|
|
237
|
+
equals(n: Decimal.Value): boolean
|
|
238
|
+
eq(n: Decimal.Value): boolean
|
|
239
|
+
|
|
240
|
+
floor(): Decimal
|
|
241
|
+
|
|
242
|
+
greaterThan(n: Decimal.Value): boolean
|
|
243
|
+
gt(n: Decimal.Value): boolean
|
|
244
|
+
|
|
245
|
+
greaterThanOrEqualTo(n: Decimal.Value): boolean
|
|
246
|
+
gte(n: Decimal.Value): boolean
|
|
247
|
+
|
|
248
|
+
hyperbolicCosine(): Decimal
|
|
249
|
+
cosh(): Decimal
|
|
250
|
+
|
|
251
|
+
hyperbolicSine(): Decimal
|
|
252
|
+
sinh(): Decimal
|
|
253
|
+
|
|
254
|
+
hyperbolicTangent(): Decimal
|
|
255
|
+
tanh(): Decimal
|
|
256
|
+
|
|
257
|
+
inverseCosine(): Decimal
|
|
258
|
+
acos(): Decimal
|
|
259
|
+
|
|
260
|
+
inverseHyperbolicCosine(): Decimal
|
|
261
|
+
acosh(): Decimal
|
|
262
|
+
|
|
263
|
+
inverseHyperbolicSine(): Decimal
|
|
264
|
+
asinh(): Decimal
|
|
265
|
+
|
|
266
|
+
inverseHyperbolicTangent(): Decimal
|
|
267
|
+
atanh(): Decimal
|
|
268
|
+
|
|
269
|
+
inverseSine(): Decimal
|
|
270
|
+
asin(): Decimal
|
|
271
|
+
|
|
272
|
+
inverseTangent(): Decimal
|
|
273
|
+
atan(): Decimal
|
|
274
|
+
|
|
275
|
+
isFinite(): boolean
|
|
276
|
+
|
|
277
|
+
isInteger(): boolean
|
|
278
|
+
isInt(): boolean
|
|
279
|
+
|
|
280
|
+
isNaN(): boolean
|
|
281
|
+
|
|
282
|
+
isNegative(): boolean
|
|
283
|
+
isNeg(): boolean
|
|
284
|
+
|
|
285
|
+
isPositive(): boolean
|
|
286
|
+
isPos(): boolean
|
|
287
|
+
|
|
288
|
+
isZero(): boolean
|
|
289
|
+
|
|
290
|
+
lessThan(n: Decimal.Value): boolean
|
|
291
|
+
lt(n: Decimal.Value): boolean
|
|
292
|
+
|
|
293
|
+
lessThanOrEqualTo(n: Decimal.Value): boolean
|
|
294
|
+
lte(n: Decimal.Value): boolean
|
|
295
|
+
|
|
296
|
+
logarithm(n?: Decimal.Value): Decimal
|
|
297
|
+
log(n?: Decimal.Value): Decimal
|
|
298
|
+
|
|
299
|
+
minus(n: Decimal.Value): Decimal
|
|
300
|
+
sub(n: Decimal.Value): Decimal
|
|
301
|
+
|
|
302
|
+
modulo(n: Decimal.Value): Decimal
|
|
303
|
+
mod(n: Decimal.Value): Decimal
|
|
304
|
+
|
|
305
|
+
naturalExponential(): Decimal
|
|
306
|
+
exp(): Decimal
|
|
307
|
+
|
|
308
|
+
naturalLogarithm(): Decimal
|
|
309
|
+
ln(): Decimal
|
|
310
|
+
|
|
311
|
+
negated(): Decimal
|
|
312
|
+
neg(): Decimal
|
|
313
|
+
|
|
314
|
+
plus(n: Decimal.Value): Decimal
|
|
315
|
+
add(n: Decimal.Value): Decimal
|
|
316
|
+
|
|
317
|
+
precision(includeZeros?: boolean): number
|
|
318
|
+
sd(includeZeros?: boolean): number
|
|
319
|
+
|
|
320
|
+
round(): Decimal
|
|
321
|
+
|
|
322
|
+
sine(): Decimal
|
|
323
|
+
sin(): Decimal
|
|
324
|
+
|
|
325
|
+
squareRoot(): Decimal
|
|
326
|
+
sqrt(): Decimal
|
|
327
|
+
|
|
328
|
+
tangent(): Decimal
|
|
329
|
+
tan(): Decimal
|
|
330
|
+
|
|
331
|
+
times(n: Decimal.Value): Decimal
|
|
332
|
+
mul(n: Decimal.Value): Decimal
|
|
333
|
+
|
|
334
|
+
toBinary(significantDigits?: number): string
|
|
335
|
+
toBinary(significantDigits: number, rounding: Decimal.Rounding): string
|
|
336
|
+
|
|
337
|
+
toDecimalPlaces(decimalPlaces?: number): Decimal
|
|
338
|
+
toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal
|
|
339
|
+
toDP(decimalPlaces?: number): Decimal
|
|
340
|
+
toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal
|
|
341
|
+
|
|
342
|
+
toExponential(decimalPlaces?: number): string
|
|
343
|
+
toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string
|
|
344
|
+
|
|
345
|
+
toFixed(decimalPlaces?: number): string
|
|
346
|
+
toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string
|
|
347
|
+
|
|
348
|
+
toFraction(max_denominator?: Decimal.Value): Decimal[]
|
|
349
|
+
|
|
350
|
+
toHexadecimal(significantDigits?: number): string
|
|
351
|
+
toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string
|
|
352
|
+
toHex(significantDigits?: number): string
|
|
353
|
+
toHex(significantDigits: number, rounding?: Decimal.Rounding): string
|
|
354
|
+
|
|
355
|
+
toJSON(): string
|
|
356
|
+
|
|
357
|
+
toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal
|
|
358
|
+
|
|
359
|
+
toNumber(): number
|
|
360
|
+
|
|
361
|
+
toOctal(significantDigits?: number): string
|
|
362
|
+
toOctal(significantDigits: number, rounding: Decimal.Rounding): string
|
|
363
|
+
|
|
364
|
+
toPower(n: Decimal.Value): Decimal
|
|
365
|
+
pow(n: Decimal.Value): Decimal
|
|
366
|
+
|
|
367
|
+
toPrecision(significantDigits?: number): string
|
|
368
|
+
toPrecision(significantDigits: number, rounding: Decimal.Rounding): string
|
|
369
|
+
|
|
370
|
+
toSignificantDigits(significantDigits?: number): Decimal
|
|
371
|
+
toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal
|
|
372
|
+
toSD(significantDigits?: number): Decimal
|
|
373
|
+
toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal
|
|
374
|
+
|
|
375
|
+
toString(): string
|
|
376
|
+
|
|
377
|
+
truncated(): Decimal
|
|
378
|
+
trunc(): Decimal
|
|
379
|
+
|
|
380
|
+
valueOf(): string
|
|
381
|
+
|
|
382
|
+
static abs(n: Decimal.Value): Decimal
|
|
383
|
+
static acos(n: Decimal.Value): Decimal
|
|
384
|
+
static acosh(n: Decimal.Value): Decimal
|
|
385
|
+
static add(x: Decimal.Value, y: Decimal.Value): Decimal
|
|
386
|
+
static asin(n: Decimal.Value): Decimal
|
|
387
|
+
static asinh(n: Decimal.Value): Decimal
|
|
388
|
+
static atan(n: Decimal.Value): Decimal
|
|
389
|
+
static atanh(n: Decimal.Value): Decimal
|
|
390
|
+
static atan2(y: Decimal.Value, x: Decimal.Value): Decimal
|
|
391
|
+
static cbrt(n: Decimal.Value): Decimal
|
|
392
|
+
static ceil(n: Decimal.Value): Decimal
|
|
393
|
+
static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal
|
|
394
|
+
static clone(object?: Decimal.Config): Decimal.Constructor
|
|
395
|
+
static config(object: Decimal.Config): Decimal.Constructor
|
|
396
|
+
static cos(n: Decimal.Value): Decimal
|
|
397
|
+
static cosh(n: Decimal.Value): Decimal
|
|
398
|
+
static div(x: Decimal.Value, y: Decimal.Value): Decimal
|
|
399
|
+
static exp(n: Decimal.Value): Decimal
|
|
400
|
+
static floor(n: Decimal.Value): Decimal
|
|
401
|
+
static hypot(...n: Decimal.Value[]): Decimal
|
|
402
|
+
static isDecimal(object: any): boolean
|
|
403
|
+
static ln(n: Decimal.Value): Decimal
|
|
404
|
+
static log(n: Decimal.Value, base?: Decimal.Value): Decimal
|
|
405
|
+
static log2(n: Decimal.Value): Decimal
|
|
406
|
+
static log10(n: Decimal.Value): Decimal
|
|
407
|
+
static max(...n: Decimal.Value[]): Decimal
|
|
408
|
+
static min(...n: Decimal.Value[]): Decimal
|
|
409
|
+
static mod(x: Decimal.Value, y: Decimal.Value): Decimal
|
|
410
|
+
static mul(x: Decimal.Value, y: Decimal.Value): Decimal
|
|
411
|
+
static noConflict(): Decimal.Constructor // Browser only
|
|
412
|
+
static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal
|
|
413
|
+
static random(significantDigits?: number): Decimal
|
|
414
|
+
static round(n: Decimal.Value): Decimal
|
|
415
|
+
static set(object: Decimal.Config): Decimal.Constructor
|
|
416
|
+
static sign(n: Decimal.Value): Decimal
|
|
417
|
+
static sin(n: Decimal.Value): Decimal
|
|
418
|
+
static sinh(n: Decimal.Value): Decimal
|
|
419
|
+
static sqrt(n: Decimal.Value): Decimal
|
|
420
|
+
static sub(x: Decimal.Value, y: Decimal.Value): Decimal
|
|
421
|
+
static sum(...n: Decimal.Value[]): Decimal
|
|
422
|
+
static tan(n: Decimal.Value): Decimal
|
|
423
|
+
static tanh(n: Decimal.Value): Decimal
|
|
424
|
+
static trunc(n: Decimal.Value): Decimal
|
|
425
|
+
|
|
426
|
+
static readonly default?: Decimal.Constructor
|
|
427
|
+
static readonly Decimal?: Decimal.Constructor
|
|
428
|
+
|
|
429
|
+
static readonly precision: number
|
|
430
|
+
static readonly rounding: Decimal.Rounding
|
|
431
|
+
static readonly toExpNeg: number
|
|
432
|
+
static readonly toExpPos: number
|
|
433
|
+
static readonly minE: number
|
|
434
|
+
static readonly maxE: number
|
|
435
|
+
static readonly crypto: boolean
|
|
436
|
+
static readonly modulo: Decimal.Modulo
|
|
437
|
+
|
|
438
|
+
static readonly ROUND_UP: 0
|
|
439
|
+
static readonly ROUND_DOWN: 1
|
|
440
|
+
static readonly ROUND_CEIL: 2
|
|
441
|
+
static readonly ROUND_FLOOR: 3
|
|
442
|
+
static readonly ROUND_HALF_UP: 4
|
|
443
|
+
static readonly ROUND_HALF_DOWN: 5
|
|
444
|
+
static readonly ROUND_HALF_EVEN: 6
|
|
445
|
+
static readonly ROUND_HALF_CEIL: 7
|
|
446
|
+
static readonly ROUND_HALF_FLOOR: 8
|
|
447
|
+
static readonly EUCLID: 9
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export declare const decompressFromBase64: any
|
|
451
|
+
|
|
452
|
+
declare interface Dictionary<T> {
|
|
453
|
+
[key: string]: T
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
declare type Dictionary_2<T> = {
|
|
457
|
+
[key: string]: T
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export declare namespace DMMF {
|
|
461
|
+
export interface Document {
|
|
462
|
+
datamodel: Datamodel
|
|
463
|
+
schema: Schema
|
|
464
|
+
mappings: Mappings
|
|
465
|
+
}
|
|
466
|
+
export interface Mappings {
|
|
467
|
+
modelOperations: ModelMapping[]
|
|
468
|
+
otherOperations: {
|
|
469
|
+
read: string[]
|
|
470
|
+
write: string[]
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
export interface OtherOperationMappings {
|
|
474
|
+
read: string[]
|
|
475
|
+
write: string[]
|
|
476
|
+
}
|
|
477
|
+
export interface DatamodelEnum {
|
|
478
|
+
name: string
|
|
479
|
+
values: EnumValue[]
|
|
480
|
+
dbName?: string | null
|
|
481
|
+
documentation?: string
|
|
482
|
+
}
|
|
483
|
+
export interface SchemaEnum {
|
|
484
|
+
name: string
|
|
485
|
+
values: string[]
|
|
486
|
+
}
|
|
487
|
+
export interface EnumValue {
|
|
488
|
+
name: string
|
|
489
|
+
dbName: string | null
|
|
490
|
+
}
|
|
491
|
+
export interface Datamodel {
|
|
492
|
+
models: Model[]
|
|
493
|
+
enums: DatamodelEnum[]
|
|
494
|
+
}
|
|
495
|
+
export interface uniqueIndex {
|
|
496
|
+
name: string
|
|
497
|
+
fields: string[]
|
|
498
|
+
}
|
|
499
|
+
export interface PrimaryKey {
|
|
500
|
+
name: string | null
|
|
501
|
+
fields: string[]
|
|
502
|
+
}
|
|
503
|
+
export interface Model {
|
|
504
|
+
name: string
|
|
505
|
+
dbName: string | null
|
|
506
|
+
fields: Field[]
|
|
507
|
+
fieldMap?: Record<string, Field>
|
|
508
|
+
uniqueFields: string[][]
|
|
509
|
+
uniqueIndexes: uniqueIndex[]
|
|
510
|
+
documentation?: string
|
|
511
|
+
primaryKey: PrimaryKey | null
|
|
512
|
+
[key: string]: any
|
|
513
|
+
}
|
|
514
|
+
export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'
|
|
515
|
+
export type FieldNamespace = 'model' | 'prisma'
|
|
516
|
+
export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes'
|
|
517
|
+
export interface Field {
|
|
518
|
+
kind: FieldKind
|
|
519
|
+
name: string
|
|
520
|
+
isRequired: boolean
|
|
521
|
+
isList: boolean
|
|
522
|
+
isUnique: boolean
|
|
523
|
+
isId: boolean
|
|
524
|
+
isReadOnly: boolean
|
|
525
|
+
isGenerated: boolean
|
|
526
|
+
isUpdatedAt: boolean
|
|
527
|
+
/**
|
|
528
|
+
* Describes the data type in the same the way is is defined in the Prisma schema:
|
|
529
|
+
* BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
|
|
530
|
+
*/
|
|
531
|
+
type: string
|
|
532
|
+
dbNames?: string[] | null
|
|
533
|
+
hasDefaultValue: boolean
|
|
534
|
+
default?: FieldDefault | string | boolean | number
|
|
535
|
+
relationFromFields?: string[]
|
|
536
|
+
relationToFields?: any[]
|
|
537
|
+
relationOnDelete?: string
|
|
538
|
+
relationName?: string
|
|
539
|
+
documentation?: string
|
|
540
|
+
[key: string]: any
|
|
541
|
+
}
|
|
542
|
+
export interface FieldDefault {
|
|
543
|
+
name: string
|
|
544
|
+
args: any[]
|
|
545
|
+
}
|
|
546
|
+
export interface Schema {
|
|
547
|
+
rootQueryType?: string
|
|
548
|
+
rootMutationType?: string
|
|
549
|
+
inputObjectTypes: {
|
|
550
|
+
model?: InputType[]
|
|
551
|
+
prisma: InputType[]
|
|
552
|
+
}
|
|
553
|
+
outputObjectTypes: {
|
|
554
|
+
model: OutputType[]
|
|
555
|
+
prisma: OutputType[]
|
|
556
|
+
}
|
|
557
|
+
enumTypes: {
|
|
558
|
+
model?: SchemaEnum[]
|
|
559
|
+
prisma: SchemaEnum[]
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
export interface Query {
|
|
563
|
+
name: string
|
|
564
|
+
args: SchemaArg[]
|
|
565
|
+
output: QueryOutput
|
|
566
|
+
}
|
|
567
|
+
export interface QueryOutput {
|
|
568
|
+
name: string
|
|
569
|
+
isRequired: boolean
|
|
570
|
+
isList: boolean
|
|
571
|
+
}
|
|
572
|
+
export type ArgType = string | InputType | SchemaEnum
|
|
573
|
+
export interface SchemaArgInputType {
|
|
574
|
+
isList: boolean
|
|
575
|
+
type: ArgType
|
|
576
|
+
location: FieldLocation
|
|
577
|
+
namespace?: FieldNamespace
|
|
578
|
+
}
|
|
579
|
+
export interface SchemaArg {
|
|
580
|
+
name: string
|
|
581
|
+
comment?: string
|
|
582
|
+
isNullable: boolean
|
|
583
|
+
isRequired: boolean
|
|
584
|
+
inputTypes: SchemaArgInputType[]
|
|
585
|
+
deprecation?: Deprecation
|
|
586
|
+
}
|
|
587
|
+
export interface OutputType {
|
|
588
|
+
name: string
|
|
589
|
+
fields: SchemaField[]
|
|
590
|
+
fieldMap?: Record<string, SchemaField>
|
|
591
|
+
}
|
|
592
|
+
export interface SchemaField {
|
|
593
|
+
name: string
|
|
594
|
+
isNullable?: boolean
|
|
595
|
+
outputType: {
|
|
596
|
+
type: string | OutputType | SchemaEnum
|
|
597
|
+
isList: boolean
|
|
598
|
+
location: FieldLocation
|
|
599
|
+
namespace?: FieldNamespace
|
|
600
|
+
}
|
|
601
|
+
args: SchemaArg[]
|
|
602
|
+
deprecation?: Deprecation
|
|
603
|
+
documentation?: string
|
|
604
|
+
}
|
|
605
|
+
export interface Deprecation {
|
|
606
|
+
sinceVersion: string
|
|
607
|
+
reason: string
|
|
608
|
+
plannedRemovalVersion?: string
|
|
609
|
+
}
|
|
610
|
+
export interface InputType {
|
|
611
|
+
name: string
|
|
612
|
+
constraints: {
|
|
613
|
+
maxNumFields: number | null
|
|
614
|
+
minNumFields: number | null
|
|
615
|
+
}
|
|
616
|
+
fields: SchemaArg[]
|
|
617
|
+
fieldMap?: Record<string, SchemaArg>
|
|
618
|
+
}
|
|
619
|
+
export interface ModelMapping {
|
|
620
|
+
model: string
|
|
621
|
+
plural: string
|
|
622
|
+
findUnique?: string | null
|
|
623
|
+
findFirst?: string | null
|
|
624
|
+
findMany?: string | null
|
|
625
|
+
create?: string | null
|
|
626
|
+
createMany?: string | null
|
|
627
|
+
update?: string | null
|
|
628
|
+
updateMany?: string | null
|
|
629
|
+
upsert?: string | null
|
|
630
|
+
delete?: string | null
|
|
631
|
+
deleteMany?: string | null
|
|
632
|
+
aggregate?: string | null
|
|
633
|
+
groupBy?: string | null
|
|
634
|
+
count?: string | null
|
|
635
|
+
findRaw?: string | null
|
|
636
|
+
aggregateRaw?: string | null
|
|
637
|
+
}
|
|
638
|
+
export enum ModelAction {
|
|
639
|
+
findUnique = 'findUnique',
|
|
640
|
+
findFirst = 'findFirst',
|
|
641
|
+
findMany = 'findMany',
|
|
642
|
+
create = 'create',
|
|
643
|
+
createMany = 'createMany',
|
|
644
|
+
update = 'update',
|
|
645
|
+
updateMany = 'updateMany',
|
|
646
|
+
upsert = 'upsert',
|
|
647
|
+
delete = 'delete',
|
|
648
|
+
deleteMany = 'deleteMany',
|
|
649
|
+
groupBy = 'groupBy',
|
|
650
|
+
count = 'count',
|
|
651
|
+
aggregate = 'aggregate',
|
|
652
|
+
findRaw = 'findRaw',
|
|
653
|
+
aggregateRaw = 'aggregateRaw',
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export declare class DMMFClass implements DMMF.Document {
|
|
658
|
+
datamodel: DMMF.Datamodel
|
|
659
|
+
schema: DMMF.Schema
|
|
660
|
+
mappings: DMMF.Mappings
|
|
661
|
+
queryType: DMMF.OutputType
|
|
662
|
+
mutationType: DMMF.OutputType
|
|
663
|
+
outputTypes: {
|
|
664
|
+
model: DMMF.OutputType[]
|
|
665
|
+
prisma: DMMF.OutputType[]
|
|
666
|
+
}
|
|
667
|
+
outputTypeMap: Dictionary<DMMF.OutputType>
|
|
668
|
+
inputObjectTypes: {
|
|
669
|
+
model?: DMMF.InputType[]
|
|
670
|
+
prisma: DMMF.InputType[]
|
|
671
|
+
}
|
|
672
|
+
inputTypeMap: Dictionary<DMMF.InputType>
|
|
673
|
+
enumMap: Dictionary<DMMF.SchemaEnum>
|
|
674
|
+
datamodelEnumMap: Dictionary<DMMF.DatamodelEnum>
|
|
675
|
+
modelMap: Dictionary<DMMF.Model>
|
|
676
|
+
mappingsMap: Dictionary<DMMF.ModelMapping>
|
|
677
|
+
rootFieldMap: Dictionary<DMMF.SchemaField>
|
|
678
|
+
constructor({ datamodel, schema, mappings }: DMMF.Document)
|
|
679
|
+
get [Symbol.toStringTag](): string
|
|
680
|
+
protected outputTypeToMergedOutputType: (outputType: DMMF.OutputType) => DMMF.OutputType
|
|
681
|
+
protected resolveOutputTypes(): void
|
|
682
|
+
protected resolveInputTypes(): void
|
|
683
|
+
protected resolveFieldArgumentTypes(): void
|
|
684
|
+
protected getQueryType(): DMMF.OutputType
|
|
685
|
+
protected getMutationType(): DMMF.OutputType
|
|
686
|
+
protected getOutputTypes(): {
|
|
687
|
+
model: DMMF.OutputType[]
|
|
688
|
+
prisma: DMMF.OutputType[]
|
|
689
|
+
}
|
|
690
|
+
protected getDatamodelEnumMap(): Dictionary<DMMF.DatamodelEnum>
|
|
691
|
+
protected getEnumMap(): Dictionary<DMMF.SchemaEnum>
|
|
692
|
+
protected getModelMap(): Dictionary<DMMF.Model>
|
|
693
|
+
protected getMergedOutputTypeMap(): Dictionary<DMMF.OutputType>
|
|
694
|
+
protected getInputTypeMap(): Dictionary<DMMF.InputType>
|
|
695
|
+
protected getMappingsMap(): Dictionary<DMMF.ModelMapping>
|
|
696
|
+
protected getRootFieldMap(): Dictionary<DMMF.SchemaField>
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
declare class Document {
|
|
700
|
+
readonly type: 'query' | 'mutation'
|
|
701
|
+
readonly children: Field[]
|
|
702
|
+
constructor(type: 'query' | 'mutation', children: Field[])
|
|
703
|
+
get [Symbol.toStringTag](): string
|
|
704
|
+
toString(): string
|
|
705
|
+
validate(
|
|
706
|
+
select?: any,
|
|
707
|
+
isTopLevelQuery?: boolean,
|
|
708
|
+
originalMethod?: string,
|
|
709
|
+
errorFormat?: 'pretty' | 'minimal' | 'colorless',
|
|
710
|
+
validationCallsite?: any,
|
|
711
|
+
): void
|
|
712
|
+
protected printFieldError: (
|
|
713
|
+
{ error }: FieldError,
|
|
714
|
+
missingItems: MissingItem[],
|
|
715
|
+
minimal: boolean,
|
|
716
|
+
) => string | undefined
|
|
717
|
+
protected printArgError: (
|
|
718
|
+
{ error, path, id }: ArgError,
|
|
719
|
+
hasMissingItems: boolean,
|
|
720
|
+
minimal: boolean,
|
|
721
|
+
) => string | undefined
|
|
722
|
+
/**
|
|
723
|
+
* As we're allowing both single objects and array of objects for list inputs, we need to remove incorrect
|
|
724
|
+
* zero indexes from the path
|
|
725
|
+
* @param inputPath e.g. ['where', 'AND', 0, 'id']
|
|
726
|
+
* @param select select object
|
|
727
|
+
*/
|
|
728
|
+
private normalizePath
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
declare interface DocumentInput {
|
|
732
|
+
dmmf: DMMFClass
|
|
733
|
+
rootTypeName: 'query' | 'mutation'
|
|
734
|
+
rootField: string
|
|
735
|
+
select?: any
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Placeholder value for "no text".
|
|
740
|
+
*/
|
|
741
|
+
export declare const empty: Sql
|
|
742
|
+
|
|
743
|
+
declare interface EmptyIncludeError {
|
|
744
|
+
type: 'emptyInclude'
|
|
745
|
+
field: DMMF.SchemaField
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
declare interface EmptySelectError {
|
|
749
|
+
type: 'emptySelect'
|
|
750
|
+
field: DMMF.SchemaField
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export declare abstract class Engine {
|
|
754
|
+
abstract on(event: EngineEventType, listener: (args?: any) => any): void
|
|
755
|
+
abstract start(): Promise<void>
|
|
756
|
+
abstract stop(): Promise<void>
|
|
757
|
+
abstract getConfig(): Promise<GetConfigResult>
|
|
758
|
+
abstract version(forceRun?: boolean): Promise<string> | string
|
|
759
|
+
abstract request<T>(
|
|
760
|
+
query: string,
|
|
761
|
+
headers?: QueryEngineRequestHeaders,
|
|
762
|
+
numTry?: number,
|
|
763
|
+
): Promise<QueryEngineResult<T>>
|
|
764
|
+
abstract requestBatch<T>(
|
|
765
|
+
queries: string[],
|
|
766
|
+
headers?: QueryEngineRequestHeaders,
|
|
767
|
+
transaction?: boolean,
|
|
768
|
+
numTry?: number,
|
|
769
|
+
): Promise<QueryEngineResult<T>[]>
|
|
770
|
+
abstract transaction(action: 'start', options?: Transaction.Options): Promise<Transaction.Info>
|
|
771
|
+
abstract transaction(action: 'commit', info: Transaction.Info): Promise<void>
|
|
772
|
+
abstract transaction(action: 'rollback', info: Transaction.Info): Promise<void>
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
declare interface EngineConfig {
|
|
776
|
+
cwd?: string
|
|
777
|
+
dirname?: string
|
|
778
|
+
datamodelPath: string
|
|
779
|
+
enableDebugLogs?: boolean
|
|
780
|
+
allowTriggerPanic?: boolean
|
|
781
|
+
prismaPath?: string
|
|
782
|
+
fetcher?: (query: string) => Promise<{
|
|
783
|
+
data?: any
|
|
784
|
+
error?: any
|
|
785
|
+
}>
|
|
786
|
+
generator?: GeneratorConfig
|
|
787
|
+
datasources?: DatasourceOverwrite[]
|
|
788
|
+
showColors?: boolean
|
|
789
|
+
logQueries?: boolean
|
|
790
|
+
logLevel?: 'info' | 'warn'
|
|
791
|
+
env?: Record<string, string>
|
|
792
|
+
flags?: string[]
|
|
793
|
+
clientVersion?: string
|
|
794
|
+
previewFeatures?: string[]
|
|
795
|
+
engineEndpoint?: string
|
|
796
|
+
activeProvider?: string
|
|
797
|
+
/**
|
|
798
|
+
* The contents of the schema encoded into a string
|
|
799
|
+
* @remarks only used for the purpose of data proxy
|
|
800
|
+
*/
|
|
801
|
+
inlineSchema?: string
|
|
802
|
+
/**
|
|
803
|
+
* The contents of the datasource url saved in a string
|
|
804
|
+
* @remarks only used for the purpose of data proxy
|
|
805
|
+
*/
|
|
806
|
+
inlineDatasources?: any
|
|
807
|
+
/**
|
|
808
|
+
* The string hash that was produced for a given schema
|
|
809
|
+
* @remarks only used for the purpose of data proxy
|
|
810
|
+
*/
|
|
811
|
+
inlineSchemaHash?: string
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
declare type EngineEventType = 'query' | 'info' | 'warn' | 'error' | 'beforeExit'
|
|
815
|
+
|
|
816
|
+
declare type EngineMiddleware<T = unknown> = (
|
|
817
|
+
params: EngineMiddlewareParams,
|
|
818
|
+
next: (params: EngineMiddlewareParams) => Promise<{
|
|
819
|
+
data: T
|
|
820
|
+
elapsed: number
|
|
821
|
+
}>,
|
|
822
|
+
) => Promise<{
|
|
823
|
+
data: T
|
|
824
|
+
elapsed: number
|
|
825
|
+
}>
|
|
826
|
+
|
|
827
|
+
declare type EngineMiddlewareParams = {
|
|
828
|
+
document: Document
|
|
829
|
+
runInTransaction?: boolean
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
declare interface EnvValue {
|
|
833
|
+
fromEnvVar: null | string
|
|
834
|
+
value: string
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
declare interface EnvValue_2 {
|
|
838
|
+
fromEnvVar: string | null
|
|
839
|
+
value: string | null
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
|
|
843
|
+
|
|
844
|
+
declare class Field {
|
|
845
|
+
readonly name: string
|
|
846
|
+
readonly args?: Args
|
|
847
|
+
readonly children?: Field[]
|
|
848
|
+
readonly error?: InvalidFieldError
|
|
849
|
+
readonly hasInvalidChild: boolean
|
|
850
|
+
readonly hasInvalidArg: boolean
|
|
851
|
+
readonly schemaField?: DMMF.SchemaField
|
|
852
|
+
constructor({ name, args, children, error, schemaField }: FieldArgs)
|
|
853
|
+
get [Symbol.toStringTag](): string
|
|
854
|
+
toString(): string
|
|
855
|
+
collectErrors(prefix?: string): {
|
|
856
|
+
fieldErrors: FieldError[]
|
|
857
|
+
argErrors: ArgError[]
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
declare interface FieldArgs {
|
|
862
|
+
name: string
|
|
863
|
+
schemaField?: DMMF.SchemaField
|
|
864
|
+
args?: Args
|
|
865
|
+
children?: Field[]
|
|
866
|
+
error?: InvalidFieldError
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
declare interface FieldError {
|
|
870
|
+
path: string[]
|
|
871
|
+
error: InvalidFieldError
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Find paths that match a set of regexes
|
|
876
|
+
* @param root to start from
|
|
877
|
+
* @param match to match against
|
|
878
|
+
* @param types to select files, folders, links
|
|
879
|
+
* @param deep to recurse in the directory tree
|
|
880
|
+
* @param limit to limit the results
|
|
881
|
+
* @param handler to further filter results
|
|
882
|
+
* @param found to add to already found
|
|
883
|
+
* @param seen to add to already seen
|
|
884
|
+
* @returns found paths (symlinks preserved)
|
|
885
|
+
*/
|
|
886
|
+
export declare function findSync(
|
|
887
|
+
root: string,
|
|
888
|
+
match: (RegExp | string)[],
|
|
889
|
+
types?: ('f' | 'd' | 'l')[],
|
|
890
|
+
deep?: ('d' | 'l')[],
|
|
891
|
+
limit?: number,
|
|
892
|
+
handler?: Handler,
|
|
893
|
+
found?: string[],
|
|
894
|
+
seen?: Record<string, true>,
|
|
895
|
+
): string[]
|
|
896
|
+
|
|
897
|
+
declare interface GeneratorConfig {
|
|
898
|
+
name: string
|
|
899
|
+
output: EnvValue | null
|
|
900
|
+
isCustomOutput?: boolean
|
|
901
|
+
provider: EnvValue
|
|
902
|
+
config: Dictionary_2<string>
|
|
903
|
+
binaryTargets: BinaryTargetsEnvValue[]
|
|
904
|
+
previewFeatures: string[]
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
declare type GetConfigResult = {
|
|
908
|
+
datasources: DataSource[]
|
|
909
|
+
generators: GeneratorConfig[]
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
export declare function getPrismaClient(
|
|
913
|
+
config: GetPrismaClientConfig,
|
|
914
|
+
): new (optionsArg?: PrismaClientOptions | undefined) => Client_2
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* Config that is stored into the generated client. When the generated client is
|
|
918
|
+
* loaded, this same config is passed to {@link getPrismaClient} which creates a
|
|
919
|
+
* closure with that config around a non-instantiated [[PrismaClient]].
|
|
920
|
+
*/
|
|
921
|
+
declare interface GetPrismaClientConfig {
|
|
922
|
+
document: DMMF.Document
|
|
923
|
+
generator?: GeneratorConfig
|
|
924
|
+
sqliteDatasourceOverrides?: DatasourceOverwrite[]
|
|
925
|
+
relativeEnvPaths: {
|
|
926
|
+
rootEnvPath?: string | null
|
|
927
|
+
schemaEnvPath?: string | null
|
|
928
|
+
}
|
|
929
|
+
relativePath: string
|
|
930
|
+
dirname: string
|
|
931
|
+
filename?: string
|
|
932
|
+
clientVersion?: string
|
|
933
|
+
engineVersion?: string
|
|
934
|
+
datasourceNames: string[]
|
|
935
|
+
activeProvider: string
|
|
936
|
+
/**
|
|
937
|
+
* The contents of the schema encoded into a string
|
|
938
|
+
* @remarks only used for the purpose of data proxy
|
|
939
|
+
*/
|
|
940
|
+
inlineSchema?: string
|
|
941
|
+
/**
|
|
942
|
+
* The contents of the env saved into a special object
|
|
943
|
+
* @remarks only used for the purpose of data proxy
|
|
944
|
+
*/
|
|
945
|
+
inlineEnv?: LoadedEnv
|
|
946
|
+
/**
|
|
947
|
+
* The contents of the datasource url saved in a string
|
|
948
|
+
* @remarks only used for the purpose of data proxy
|
|
949
|
+
*/
|
|
950
|
+
inlineDatasources?: InlineDatasources
|
|
951
|
+
/**
|
|
952
|
+
* The string hash that was produced for a given schema
|
|
953
|
+
* @remarks only used for the purpose of data proxy
|
|
954
|
+
*/
|
|
955
|
+
inlineSchemaHash?: string
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
declare type Handler = (base: string, item: string, type: ItemType) => boolean | string
|
|
959
|
+
|
|
960
|
+
declare type HookParams = {
|
|
961
|
+
query: string
|
|
962
|
+
path: string[]
|
|
963
|
+
rootField?: string
|
|
964
|
+
typeName?: string
|
|
965
|
+
document: any
|
|
966
|
+
clientMethod: string
|
|
967
|
+
args: any
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
declare type Hooks = {
|
|
971
|
+
beforeRequest?: (options: HookParams) => any
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
declare interface IncludeAndSelectError {
|
|
975
|
+
type: 'includeAndSelect'
|
|
976
|
+
field: DMMF.SchemaField
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
declare type Info = {
|
|
980
|
+
id: string
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
declare type InlineDatasources = {
|
|
984
|
+
[name in InternalDatasource['name']]: {
|
|
985
|
+
url: InternalDatasource['url']
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
declare type InstanceRejectOnNotFound =
|
|
990
|
+
| RejectOnNotFound
|
|
991
|
+
| Record<string, RejectOnNotFound>
|
|
992
|
+
| Record<string, Record<string, RejectOnNotFound>>
|
|
993
|
+
|
|
994
|
+
declare interface InternalDatasource {
|
|
995
|
+
name: string
|
|
996
|
+
activeProvider: ConnectorType_2
|
|
997
|
+
provider: ConnectorType_2
|
|
998
|
+
url: EnvValue_2
|
|
999
|
+
config: any
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
declare type InternalRequestParams = {
|
|
1003
|
+
/**
|
|
1004
|
+
* The original client method being called.
|
|
1005
|
+
* Even though the rootField / operation can be changed,
|
|
1006
|
+
* this method stays as it is, as it's what the user's
|
|
1007
|
+
* code looks like
|
|
1008
|
+
*/
|
|
1009
|
+
clientMethod: string
|
|
1010
|
+
callsite?: string
|
|
1011
|
+
/** Headers metadata that will be passed to the Engine */
|
|
1012
|
+
headers?: Record<string, string>
|
|
1013
|
+
transactionId?: number
|
|
1014
|
+
unpacker?: Unpacker
|
|
1015
|
+
otelCtx?: Context
|
|
1016
|
+
} & QueryMiddlewareParams
|
|
1017
|
+
|
|
1018
|
+
declare type InvalidArgError =
|
|
1019
|
+
| InvalidArgNameError
|
|
1020
|
+
| MissingArgError
|
|
1021
|
+
| InvalidArgTypeError
|
|
1022
|
+
| AtLeastOneError
|
|
1023
|
+
| AtMostOneError
|
|
1024
|
+
| InvalidNullArgError
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* This error occurs if the user provides an arg name that doens't exist
|
|
1028
|
+
*/
|
|
1029
|
+
declare interface InvalidArgNameError {
|
|
1030
|
+
type: 'invalidName'
|
|
1031
|
+
providedName: string
|
|
1032
|
+
providedValue: any
|
|
1033
|
+
didYouMeanArg?: string
|
|
1034
|
+
didYouMeanField?: string
|
|
1035
|
+
originalType: DMMF.ArgType
|
|
1036
|
+
possibilities?: DMMF.SchemaArgInputType[]
|
|
1037
|
+
outputType?: DMMF.OutputType
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* If the scalar type of an arg is not matching what is required
|
|
1042
|
+
*/
|
|
1043
|
+
declare interface InvalidArgTypeError {
|
|
1044
|
+
type: 'invalidType'
|
|
1045
|
+
argName: string
|
|
1046
|
+
requiredType: {
|
|
1047
|
+
bestFittingType: DMMF.SchemaArgInputType
|
|
1048
|
+
inputType: DMMF.SchemaArgInputType[]
|
|
1049
|
+
}
|
|
1050
|
+
providedValue: any
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
declare type InvalidFieldError =
|
|
1054
|
+
| InvalidFieldNameError
|
|
1055
|
+
| InvalidFieldTypeError
|
|
1056
|
+
| EmptySelectError
|
|
1057
|
+
| NoTrueSelectError
|
|
1058
|
+
| IncludeAndSelectError
|
|
1059
|
+
| EmptyIncludeError
|
|
1060
|
+
|
|
1061
|
+
declare interface InvalidFieldNameError {
|
|
1062
|
+
type: 'invalidFieldName'
|
|
1063
|
+
modelName: string
|
|
1064
|
+
didYouMean?: string | null
|
|
1065
|
+
providedName: string
|
|
1066
|
+
isInclude?: boolean
|
|
1067
|
+
isIncludeScalar?: boolean
|
|
1068
|
+
outputType: DMMF.OutputType
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
declare interface InvalidFieldTypeError {
|
|
1072
|
+
type: 'invalidFieldType'
|
|
1073
|
+
modelName: string
|
|
1074
|
+
fieldName: string
|
|
1075
|
+
providedValue: any
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* If a user incorrectly provided null where she shouldn't have
|
|
1080
|
+
*/
|
|
1081
|
+
declare interface InvalidNullArgError {
|
|
1082
|
+
type: 'invalidNullArg'
|
|
1083
|
+
name: string
|
|
1084
|
+
invalidType: DMMF.SchemaArgInputType[]
|
|
1085
|
+
atLeastOne: boolean
|
|
1086
|
+
atMostOne: boolean
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
declare type ItemType = 'd' | 'f' | 'l'
|
|
1090
|
+
|
|
1091
|
+
declare interface Job {
|
|
1092
|
+
resolve: (data: any) => void
|
|
1093
|
+
reject: (data: any) => void
|
|
1094
|
+
request: any
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* Create a SQL query for a list of values.
|
|
1099
|
+
*/
|
|
1100
|
+
export declare function join(values: RawValue[], separator?: string): Sql
|
|
1101
|
+
|
|
1102
|
+
declare type LoadedEnv =
|
|
1103
|
+
| {
|
|
1104
|
+
message?: string
|
|
1105
|
+
parsed: {
|
|
1106
|
+
[x: string]: string
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
| undefined
|
|
1110
|
+
|
|
1111
|
+
declare type LogDefinition = {
|
|
1112
|
+
level: LogLevel
|
|
1113
|
+
emit: 'stdout' | 'event'
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
declare type LogLevel = 'info' | 'query' | 'warn' | 'error'
|
|
1117
|
+
|
|
1118
|
+
export declare function makeDocument({
|
|
1119
|
+
dmmf,
|
|
1120
|
+
rootTypeName,
|
|
1121
|
+
rootField,
|
|
1122
|
+
select,
|
|
1123
|
+
}: DocumentInput): Document
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* Opposite of InvalidArgNameError - if the user *doesn't* provide an arg that should be provided
|
|
1127
|
+
* This error both happens with an implicit and explicit `undefined`
|
|
1128
|
+
*/
|
|
1129
|
+
declare interface MissingArgError {
|
|
1130
|
+
type: 'missingArg'
|
|
1131
|
+
missingName: string
|
|
1132
|
+
missingArg: DMMF.SchemaArg
|
|
1133
|
+
atLeastOne: boolean
|
|
1134
|
+
atMostOne: boolean
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
declare interface MissingItem {
|
|
1138
|
+
path: string
|
|
1139
|
+
isRequired: boolean
|
|
1140
|
+
type: string | object
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
declare type Namespace = 'all' | 'engine'
|
|
1144
|
+
|
|
1145
|
+
declare interface NoTrueSelectError {
|
|
1146
|
+
type: 'noTrueSelect'
|
|
1147
|
+
field: DMMF.SchemaField
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* maxWait ?= 2000
|
|
1152
|
+
* timeout ?= 5000
|
|
1153
|
+
*/
|
|
1154
|
+
declare type Options = {
|
|
1155
|
+
maxWait?: number
|
|
1156
|
+
timeout?: number
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
declare class PrismaClientFetcher {
|
|
1160
|
+
prisma: any
|
|
1161
|
+
debug: boolean
|
|
1162
|
+
hooks: any
|
|
1163
|
+
dataloader: DataLoader<{
|
|
1164
|
+
document: Document
|
|
1165
|
+
runInTransaction?: boolean
|
|
1166
|
+
transactionId?: number
|
|
1167
|
+
headers?: Record<string, string>
|
|
1168
|
+
}>
|
|
1169
|
+
constructor(prisma: any, enableDebug?: boolean, hooks?: any)
|
|
1170
|
+
get [Symbol.toStringTag](): string
|
|
1171
|
+
request({
|
|
1172
|
+
document,
|
|
1173
|
+
dataPath,
|
|
1174
|
+
rootField,
|
|
1175
|
+
typeName,
|
|
1176
|
+
isList,
|
|
1177
|
+
callsite,
|
|
1178
|
+
rejectOnNotFound,
|
|
1179
|
+
clientMethod,
|
|
1180
|
+
runInTransaction,
|
|
1181
|
+
showColors,
|
|
1182
|
+
engineHook,
|
|
1183
|
+
args,
|
|
1184
|
+
headers,
|
|
1185
|
+
transactionId,
|
|
1186
|
+
unpacker,
|
|
1187
|
+
}: RequestParams): Promise<any>
|
|
1188
|
+
sanitizeMessage(message: any): any
|
|
1189
|
+
unpack(document: Document, data: any, path: string[], rootField: string, unpacker?: Unpacker): any
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
export declare class PrismaClientInitializationError extends Error {
|
|
1193
|
+
clientVersion: string
|
|
1194
|
+
errorCode?: string
|
|
1195
|
+
constructor(message: string, clientVersion: string, errorCode?: string)
|
|
1196
|
+
get [Symbol.toStringTag](): string
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
export declare class PrismaClientKnownRequestError extends Error {
|
|
1200
|
+
code: string
|
|
1201
|
+
meta?: object
|
|
1202
|
+
clientVersion: string
|
|
1203
|
+
constructor(message: string, code: string, clientVersion: string, meta?: any)
|
|
1204
|
+
get [Symbol.toStringTag](): string
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
export declare interface PrismaClientOptions {
|
|
1208
|
+
/**
|
|
1209
|
+
* Will throw an Error if findUnique returns null
|
|
1210
|
+
*/
|
|
1211
|
+
rejectOnNotFound?: InstanceRejectOnNotFound
|
|
1212
|
+
/**
|
|
1213
|
+
* Overwrites the datasource url from your prisma.schema file
|
|
1214
|
+
*/
|
|
1215
|
+
datasources?: Datasources
|
|
1216
|
+
/**
|
|
1217
|
+
* @default "colorless"
|
|
1218
|
+
*/
|
|
1219
|
+
errorFormat?: ErrorFormat
|
|
1220
|
+
/**
|
|
1221
|
+
* @example
|
|
1222
|
+
* \`\`\`
|
|
1223
|
+
* // Defaults to stdout
|
|
1224
|
+
* log: ['query', 'info', 'warn']
|
|
1225
|
+
*
|
|
1226
|
+
* // Emit as events
|
|
1227
|
+
* log: [
|
|
1228
|
+
* { emit: 'stdout', level: 'query' },
|
|
1229
|
+
* { emit: 'stdout', level: 'info' },
|
|
1230
|
+
* { emit: 'stdout', level: 'warn' }
|
|
1231
|
+
* ]
|
|
1232
|
+
* \`\`\`
|
|
1233
|
+
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
|
|
1234
|
+
*/
|
|
1235
|
+
log?: Array<LogLevel | LogDefinition>
|
|
1236
|
+
/**
|
|
1237
|
+
* @internal
|
|
1238
|
+
* You probably don't want to use this. \`__internal\` is used by internal tooling.
|
|
1239
|
+
*/
|
|
1240
|
+
__internal?: {
|
|
1241
|
+
debug?: boolean
|
|
1242
|
+
hooks?: Hooks
|
|
1243
|
+
engine?: {
|
|
1244
|
+
cwd?: string
|
|
1245
|
+
binaryPath?: string
|
|
1246
|
+
endpoint?: string
|
|
1247
|
+
allowTriggerPanic?: boolean
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
export declare class PrismaClientRustPanicError extends Error {
|
|
1253
|
+
clientVersion: string
|
|
1254
|
+
constructor(message: string, clientVersion: string)
|
|
1255
|
+
get [Symbol.toStringTag](): string
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
export declare class PrismaClientUnknownRequestError extends Error {
|
|
1259
|
+
clientVersion: string
|
|
1260
|
+
constructor(message: string, clientVersion: string)
|
|
1261
|
+
get [Symbol.toStringTag](): string
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
export declare class PrismaClientValidationError extends Error {
|
|
1265
|
+
get [Symbol.toStringTag](): string
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
declare type QueryEngineRequestHeaders = {
|
|
1269
|
+
traceparent?: string
|
|
1270
|
+
transactionId?: string
|
|
1271
|
+
fatal?: string
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
declare type QueryEngineResult<T> = {
|
|
1275
|
+
data: T
|
|
1276
|
+
elapsed: number
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
declare type QueryMiddleware<T = unknown> = (
|
|
1280
|
+
params: QueryMiddlewareParams,
|
|
1281
|
+
next: (params: QueryMiddlewareParams) => Promise<T>,
|
|
1282
|
+
) => Promise<T>
|
|
1283
|
+
|
|
1284
|
+
declare type QueryMiddlewareParams = {
|
|
1285
|
+
/** The model this is executed on */
|
|
1286
|
+
model?: string
|
|
1287
|
+
/** The action that is being handled */
|
|
1288
|
+
action: Action
|
|
1289
|
+
/** TODO what is this */
|
|
1290
|
+
dataPath: string[]
|
|
1291
|
+
/** TODO what is this */
|
|
1292
|
+
runInTransaction: boolean
|
|
1293
|
+
/** TODO what is this */
|
|
1294
|
+
args: any
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* Create raw SQL statement.
|
|
1299
|
+
*/
|
|
1300
|
+
export declare function raw(value: string): Sql
|
|
1301
|
+
|
|
1302
|
+
export declare type RawValue = Value | Sql
|
|
1303
|
+
|
|
1304
|
+
declare type RejectOnNotFound = boolean | ((error: Error) => Error) | undefined
|
|
1305
|
+
|
|
1306
|
+
declare type RequestParams = {
|
|
1307
|
+
document: Document
|
|
1308
|
+
dataPath: string[]
|
|
1309
|
+
rootField: string
|
|
1310
|
+
typeName: string
|
|
1311
|
+
isList: boolean
|
|
1312
|
+
clientMethod: string
|
|
1313
|
+
callsite?: string
|
|
1314
|
+
rejectOnNotFound?: RejectOnNotFound
|
|
1315
|
+
runInTransaction?: boolean
|
|
1316
|
+
showColors?: boolean
|
|
1317
|
+
engineHook?: EngineMiddleware
|
|
1318
|
+
args: any
|
|
1319
|
+
headers?: Record<string, string>
|
|
1320
|
+
transactionId?: number
|
|
1321
|
+
unpacker?: Unpacker
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* A SQL instance can be nested within each other to build SQL strings.
|
|
1326
|
+
*/
|
|
1327
|
+
export declare class Sql {
|
|
1328
|
+
values: Value[]
|
|
1329
|
+
strings: string[]
|
|
1330
|
+
constructor(rawStrings: ReadonlyArray<string>, rawValues: ReadonlyArray<RawValue>)
|
|
1331
|
+
get text(): string
|
|
1332
|
+
get sql(): string
|
|
1333
|
+
[inspect.custom](): {
|
|
1334
|
+
text: string
|
|
1335
|
+
sql: string
|
|
1336
|
+
values: Value[]
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* Create a SQL object from a template string.
|
|
1342
|
+
*/
|
|
1343
|
+
export declare function sqltag(strings: ReadonlyArray<string>, ...values: RawValue[]): Sql
|
|
1344
|
+
|
|
1345
|
+
declare namespace sqlTemplateTag {
|
|
1346
|
+
export { join, raw, sqltag, Value, RawValue, Sql, empty, sqltag as default }
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
declare namespace Transaction {
|
|
1350
|
+
export { Options, Info }
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
export declare function transformDocument(document: Document): Document
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Unpacks the result of a data object and maps DateTime fields to instances of `Date` inplace
|
|
1357
|
+
* @param options: UnpackOptions
|
|
1358
|
+
*/
|
|
1359
|
+
export declare function unpack({ document, path, data }: UnpackOptions): any
|
|
1360
|
+
|
|
1361
|
+
declare type Unpacker = (data: any) => any
|
|
1362
|
+
|
|
1363
|
+
declare interface UnpackOptions {
|
|
1364
|
+
document: Document
|
|
1365
|
+
path: string[]
|
|
1366
|
+
data: any
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
export declare type Value = string | number | boolean | object | null | undefined
|
|
1370
|
+
|
|
1371
|
+
export declare function warnEnvConflicts(envPaths: any): void
|
|
1372
|
+
|
|
1373
|
+
export {}
|