prisma 5.23.0-dev.6 → 5.23.0-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +3 -3
- package/package.json +11 -11
- package/preinstall/index.js +5 -5
- package/prisma-client/generator-build/index.js +2 -6
- package/prisma-client/package.json +2 -2
- package/prisma-client/runtime/binary.js +80 -80
- package/prisma-client/runtime/edge-esm.js +18 -18
- package/prisma-client/runtime/edge.js +18 -18
- package/prisma-client/runtime/library.d.ts +39 -60
- package/prisma-client/runtime/library.js +56 -56
- package/prisma-client/runtime/react-native.d.ts +39 -60
- package/prisma-client/runtime/react-native.js +26 -26
- package/prisma-client/scripts/default-index.js +1 -1
|
@@ -101,7 +101,7 @@ declare type BatchQuery = {
|
|
|
101
101
|
args: JsArgs | RawQueryArgs;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
declare type BatchQueryEngineResult<T> =
|
|
104
|
+
declare type BatchQueryEngineResult<T> = QueryEngineResultData<T> | Error;
|
|
105
105
|
|
|
106
106
|
declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise<any>;
|
|
107
107
|
|
|
@@ -266,7 +266,36 @@ export declare type Count<O> = {
|
|
|
266
266
|
[K in keyof O]: Count<number>;
|
|
267
267
|
} & {};
|
|
268
268
|
|
|
269
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Custom fetch function for `DataProxyEngine`.
|
|
271
|
+
*
|
|
272
|
+
* We can't use the actual type of `globalThis.fetch` because this will result
|
|
273
|
+
* in API Extractor referencing Node.js type definitions in the `.d.ts` bundle
|
|
274
|
+
* for the client runtime. We can only use such types in internal types that
|
|
275
|
+
* don't end up exported anywhere.
|
|
276
|
+
|
|
277
|
+
* It's also not possible to write a definition of `fetch` that would accept the
|
|
278
|
+
* actual `fetch` function from different environments such as Node.js and
|
|
279
|
+
* Cloudflare Workers (with their extensions to `RequestInit` and `Response`).
|
|
280
|
+
* `fetch` is used in both covariant and contravariant positions in
|
|
281
|
+
* `CustomDataProxyFetch`, making it invariant, so we need the exact same type.
|
|
282
|
+
* Even if we removed the argument and left `fetch` in covariant position only,
|
|
283
|
+
* then for an extension-supplied function to be assignable to `customDataProxyFetch`,
|
|
284
|
+
* the platform-specific (or custom) `fetch` function needs to be assignable
|
|
285
|
+
* to our `fetch` definition. This, in turn, requires the third-party `Response`
|
|
286
|
+
* to be a subtype of our `Response` (which is not a problem, we could declare
|
|
287
|
+
* a minimal `Response` type that only includes what we use) *and* requires the
|
|
288
|
+
* third-party `RequestInit` to be a supertype of our `RequestInit` (i.e. we
|
|
289
|
+
* have to declare all properties any `RequestInit` implementation in existence
|
|
290
|
+
* could possibly have), which is not possible.
|
|
291
|
+
*
|
|
292
|
+
* Since `@prisma/extension-accelerate` redefines the type of
|
|
293
|
+
* `__internalParams.customDataProxyFetch` to its own type anyway (probably for
|
|
294
|
+
* exactly this reason), our definition is never actually used and is completely
|
|
295
|
+
* ignored, so it doesn't matter, and we can just use `unknown` as the type of
|
|
296
|
+
* `fetch` here.
|
|
297
|
+
*/
|
|
298
|
+
declare type CustomDataProxyFetch = (fetch: unknown) => unknown;
|
|
270
299
|
|
|
271
300
|
declare class DataLoader<T = unknown> {
|
|
272
301
|
private options;
|
|
@@ -1037,7 +1066,7 @@ declare interface Engine<InteractiveTransactionPayload = unknown> {
|
|
|
1037
1066
|
start(): Promise<void>;
|
|
1038
1067
|
stop(): Promise<void>;
|
|
1039
1068
|
version(forceRun?: boolean): Promise<string> | string;
|
|
1040
|
-
request<T>(query: JsonQuery, options:
|
|
1069
|
+
request<T>(query: JsonQuery, options: RequestOptions<InteractiveTransactionPayload>): Promise<QueryEngineResultData<T>>;
|
|
1041
1070
|
requestBatch<T>(queries: JsonQuery[], options: RequestBatchOptions<InteractiveTransactionPayload>): Promise<BatchQueryEngineResult<T>[]>;
|
|
1042
1071
|
transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise<Transaction_2.InteractiveTransactionInfo<unknown>>;
|
|
1043
1072
|
transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo<unknown>): Promise<void>;
|
|
@@ -1348,8 +1377,6 @@ export declare type ExtractGlobalOmit<Options, ModelName extends string> = Optio
|
|
|
1348
1377
|
};
|
|
1349
1378
|
} ? GlobalOmit : {};
|
|
1350
1379
|
|
|
1351
|
-
declare type Fetch = typeof nodeFetch;
|
|
1352
|
-
|
|
1353
1380
|
/**
|
|
1354
1381
|
* A reference to a specific field of a specific model
|
|
1355
1382
|
*/
|
|
@@ -1836,7 +1863,7 @@ declare type InternalRequestParams = {
|
|
|
1836
1863
|
/** Used to convert args for middleware and back */
|
|
1837
1864
|
middlewareArgsMapper?: MiddlewareArgsMapper<unknown, unknown>;
|
|
1838
1865
|
/** Used for Accelerate client extension via Data Proxy */
|
|
1839
|
-
customDataProxyFetch?:
|
|
1866
|
+
customDataProxyFetch?: CustomDataProxyFetch;
|
|
1840
1867
|
} & Omit<QueryMiddlewareParams, 'runInTransaction'>;
|
|
1841
1868
|
|
|
1842
1869
|
declare enum IsolationLevel {
|
|
@@ -2166,37 +2193,6 @@ export declare type Narrowable = string | number | bigint | boolean | [];
|
|
|
2166
2193
|
|
|
2167
2194
|
export declare type NeverToUnknown<T> = [T] extends [never] ? unknown : T;
|
|
2168
2195
|
|
|
2169
|
-
/**
|
|
2170
|
-
* Imitates `fetch` via `https` to only suit our needs, it does nothing more.
|
|
2171
|
-
* This is because we cannot bundle `node-fetch` as it uses many other Node.js
|
|
2172
|
-
* utilities, while also bloating our bundles. This approach is much leaner.
|
|
2173
|
-
* @param url
|
|
2174
|
-
* @param options
|
|
2175
|
-
* @returns
|
|
2176
|
-
*/
|
|
2177
|
-
declare function nodeFetch(url: string, options?: RequestOptions): Promise<RequestResponse>;
|
|
2178
|
-
|
|
2179
|
-
declare class NodeHeaders {
|
|
2180
|
-
readonly headers: Map<string, string>;
|
|
2181
|
-
constructor(init?: Record<any, any>);
|
|
2182
|
-
append(name: string, value: string): void;
|
|
2183
|
-
delete(name: string): void;
|
|
2184
|
-
get(name: string): string | null;
|
|
2185
|
-
has(name: string): boolean;
|
|
2186
|
-
set(name: string, value: string): void;
|
|
2187
|
-
forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void;
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
/**
|
|
2191
|
-
* @deprecated Please don´t rely on type checks to this error anymore.
|
|
2192
|
-
* This will become a regular `PrismaClientKnownRequestError` with code `P2025`
|
|
2193
|
-
* in the future major version of the client.
|
|
2194
|
-
* Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`.
|
|
2195
|
-
*/
|
|
2196
|
-
export declare class NotFoundError extends PrismaClientKnownRequestError {
|
|
2197
|
-
constructor(message: string, clientVersion: string);
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
2196
|
declare class NullTypesEnumValue extends ObjectEnumValue {
|
|
2201
2197
|
_getNamespace(): string;
|
|
2202
2198
|
}
|
|
@@ -2566,9 +2562,8 @@ declare type QueryEngineRequest = {
|
|
|
2566
2562
|
variables: Object;
|
|
2567
2563
|
};
|
|
2568
2564
|
|
|
2569
|
-
declare type
|
|
2565
|
+
declare type QueryEngineResultData<T> = {
|
|
2570
2566
|
data: T;
|
|
2571
|
-
elapsed: number;
|
|
2572
2567
|
};
|
|
2573
2568
|
|
|
2574
2569
|
declare type QueryEngineTelemetry = {
|
|
@@ -2661,7 +2656,7 @@ declare type RequestBatchOptions<InteractiveTransactionPayload> = {
|
|
|
2661
2656
|
traceparent?: string;
|
|
2662
2657
|
numTry?: number;
|
|
2663
2658
|
containsWrite: boolean;
|
|
2664
|
-
customDataProxyFetch?:
|
|
2659
|
+
customDataProxyFetch?: CustomDataProxyFetch;
|
|
2665
2660
|
};
|
|
2666
2661
|
|
|
2667
2662
|
declare interface RequestError {
|
|
@@ -2681,7 +2676,7 @@ declare class RequestHandler {
|
|
|
2681
2676
|
private logEmitter?;
|
|
2682
2677
|
constructor(client: Client, logEmitter?: LogEmitter);
|
|
2683
2678
|
request(params: RequestParams): Promise<any>;
|
|
2684
|
-
mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response:
|
|
2679
|
+
mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResultData<any>): any;
|
|
2685
2680
|
/**
|
|
2686
2681
|
* Handles the error and logs it, logging the error is done synchronously waiting for the event
|
|
2687
2682
|
* handlers to finish.
|
|
@@ -2693,18 +2688,12 @@ declare class RequestHandler {
|
|
|
2693
2688
|
get [Symbol.toStringTag](): string;
|
|
2694
2689
|
}
|
|
2695
2690
|
|
|
2696
|
-
declare type RequestOptions = {
|
|
2697
|
-
method?: string;
|
|
2698
|
-
headers?: Record<string, string>;
|
|
2699
|
-
body?: string;
|
|
2700
|
-
};
|
|
2701
|
-
|
|
2702
|
-
declare type RequestOptions_2<InteractiveTransactionPayload> = {
|
|
2691
|
+
declare type RequestOptions<InteractiveTransactionPayload> = {
|
|
2703
2692
|
traceparent?: string;
|
|
2704
2693
|
numTry?: number;
|
|
2705
2694
|
interactiveTransaction?: InteractiveTransactionOptions<InteractiveTransactionPayload>;
|
|
2706
2695
|
isWrite: boolean;
|
|
2707
|
-
customDataProxyFetch?:
|
|
2696
|
+
customDataProxyFetch?: CustomDataProxyFetch;
|
|
2708
2697
|
};
|
|
2709
2698
|
|
|
2710
2699
|
declare type RequestParams = {
|
|
@@ -2722,17 +2711,7 @@ declare type RequestParams = {
|
|
|
2722
2711
|
otelParentCtx?: Context;
|
|
2723
2712
|
otelChildCtx?: Context;
|
|
2724
2713
|
globalOmit?: GlobalOmitOptions;
|
|
2725
|
-
customDataProxyFetch?:
|
|
2726
|
-
};
|
|
2727
|
-
|
|
2728
|
-
declare type RequestResponse = {
|
|
2729
|
-
ok: boolean;
|
|
2730
|
-
url: string;
|
|
2731
|
-
statusText?: string;
|
|
2732
|
-
status: number;
|
|
2733
|
-
headers: NodeHeaders;
|
|
2734
|
-
text: () => Promise<string>;
|
|
2735
|
-
json: () => Promise<any>;
|
|
2714
|
+
customDataProxyFetch?: CustomDataProxyFetch;
|
|
2736
2715
|
};
|
|
2737
2716
|
|
|
2738
2717
|
declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions;
|