@friggframework/core 2.0.0-next.45 → 2.0.0-next.47

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