@creator.co/creatorco-prisma-client 1.0.19 → 1.0.20
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/edge.d.ts +1 -1
- package/edge.js +12 -12
- package/index-browser.js +20 -19
- package/index.d.ts +456 -84
- package/index.js +13 -13
- package/libquery_engine-darwin-arm64.dylib.node +0 -0
- package/libquery_engine-darwin.dylib.node +0 -0
- package/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/libquery_engine-linux-arm64-openssl-1.0.x.so.node +0 -0
- package/libquery_engine-linux-arm64-openssl-3.0.x.so.node +0 -0
- package/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/package.json +2 -67
- package/query_engine-windows.dll.node +0 -0
- package/runtime/edge-esm.js +74 -27
- package/runtime/edge.js +74 -27
- package/runtime/index-browser.js +1 -1
- package/runtime/library.d.ts +152 -207
- package/runtime/library.js +57 -59
- package/schema.prisma +5 -1
- package/default.d.ts +0 -1
- package/default.js +0 -1
- package/runtime/wasm.js +0 -94
- package/wasm.d.ts +0 -1
- package/wasm.js +0 -1274
package/runtime/library.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ declare type BatchQueryOptionsCbArgs = {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
declare type BatchTransactionOptions = {
|
|
82
|
-
isolationLevel?:
|
|
82
|
+
isolationLevel?: Transaction.IsolationLevel;
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
declare interface BinaryTargetsEnvValue {
|
|
@@ -165,10 +165,6 @@ declare type ComputedFieldsMap = {
|
|
|
165
165
|
[fieldName: string]: ComputedField;
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
-
declare type ConnectionInfo = {
|
|
169
|
-
schemaName?: string;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
168
|
declare interface Context {
|
|
173
169
|
/**
|
|
174
170
|
* Get a value from the context.
|
|
@@ -558,27 +554,6 @@ declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Clien
|
|
|
558
554
|
|
|
559
555
|
declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"];
|
|
560
556
|
|
|
561
|
-
/**
|
|
562
|
-
* Detect the current JavaScript runtime following
|
|
563
|
-
* the WinterCG Runtime Keys proposal:
|
|
564
|
-
*
|
|
565
|
-
* - `edge-routine` Alibaba Cloud Edge Routine
|
|
566
|
-
* - `workerd` Cloudflare Workers
|
|
567
|
-
* - `deno` Deno and Deno Deploy
|
|
568
|
-
* - `lagon` Lagon
|
|
569
|
-
* - `react-native` React Native
|
|
570
|
-
* - `netlify` Netlify Edge Functions
|
|
571
|
-
* - `electron` Electron
|
|
572
|
-
* - `node` Node.js
|
|
573
|
-
* - `bun` Bun
|
|
574
|
-
* - `edge-light` Vercel Edge Functions
|
|
575
|
-
* - `fastly` Fastly Compute@Edge
|
|
576
|
-
*
|
|
577
|
-
* @see https://runtime-keys.proposal.wintercg.org/
|
|
578
|
-
* @returns {Runtime}
|
|
579
|
-
*/
|
|
580
|
-
export declare function detectRuntime(): Runtime;
|
|
581
|
-
|
|
582
557
|
export declare type DevTypeMapDef = {
|
|
583
558
|
meta: {
|
|
584
559
|
modelProps: string;
|
|
@@ -599,59 +574,59 @@ export declare type DevTypeMapFnDef = {
|
|
|
599
574
|
payload: OperationPayload;
|
|
600
575
|
};
|
|
601
576
|
|
|
602
|
-
declare
|
|
603
|
-
[key: string]: T | undefined;
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
declare interface Dictionary_2<T> {
|
|
577
|
+
declare interface Dictionary<T> {
|
|
607
578
|
[key: string]: T;
|
|
608
579
|
}
|
|
609
580
|
|
|
581
|
+
declare type Dictionary_2<T> = {
|
|
582
|
+
[key: string]: T | undefined;
|
|
583
|
+
};
|
|
584
|
+
|
|
610
585
|
export declare namespace DMMF {
|
|
611
|
-
export
|
|
586
|
+
export interface Document {
|
|
612
587
|
datamodel: Datamodel;
|
|
613
588
|
schema: Schema;
|
|
614
589
|
mappings: Mappings;
|
|
615
|
-
}
|
|
616
|
-
export
|
|
590
|
+
}
|
|
591
|
+
export interface Mappings {
|
|
617
592
|
modelOperations: ModelMapping[];
|
|
618
593
|
otherOperations: {
|
|
619
594
|
read: string[];
|
|
620
595
|
write: string[];
|
|
621
596
|
};
|
|
622
|
-
}
|
|
623
|
-
export
|
|
597
|
+
}
|
|
598
|
+
export interface OtherOperationMappings {
|
|
624
599
|
read: string[];
|
|
625
600
|
write: string[];
|
|
626
|
-
}
|
|
627
|
-
export
|
|
601
|
+
}
|
|
602
|
+
export interface DatamodelEnum {
|
|
628
603
|
name: string;
|
|
629
604
|
values: EnumValue[];
|
|
630
605
|
dbName?: string | null;
|
|
631
606
|
documentation?: string;
|
|
632
|
-
}
|
|
633
|
-
export
|
|
607
|
+
}
|
|
608
|
+
export interface SchemaEnum {
|
|
634
609
|
name: string;
|
|
635
610
|
values: string[];
|
|
636
|
-
}
|
|
637
|
-
export
|
|
611
|
+
}
|
|
612
|
+
export interface EnumValue {
|
|
638
613
|
name: string;
|
|
639
614
|
dbName: string | null;
|
|
640
|
-
}
|
|
641
|
-
export
|
|
615
|
+
}
|
|
616
|
+
export interface Datamodel {
|
|
642
617
|
models: Model[];
|
|
643
618
|
enums: DatamodelEnum[];
|
|
644
619
|
types: Model[];
|
|
645
|
-
}
|
|
646
|
-
export
|
|
620
|
+
}
|
|
621
|
+
export interface uniqueIndex {
|
|
647
622
|
name: string;
|
|
648
623
|
fields: string[];
|
|
649
|
-
}
|
|
650
|
-
export
|
|
624
|
+
}
|
|
625
|
+
export interface PrimaryKey {
|
|
651
626
|
name: string | null;
|
|
652
627
|
fields: string[];
|
|
653
|
-
}
|
|
654
|
-
export
|
|
628
|
+
}
|
|
629
|
+
export interface Model {
|
|
655
630
|
name: string;
|
|
656
631
|
dbName: string | null;
|
|
657
632
|
fields: Field[];
|
|
@@ -660,11 +635,11 @@ export declare namespace DMMF {
|
|
|
660
635
|
documentation?: string;
|
|
661
636
|
primaryKey: PrimaryKey | null;
|
|
662
637
|
isGenerated?: boolean;
|
|
663
|
-
}
|
|
638
|
+
}
|
|
664
639
|
export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
|
|
665
640
|
export type FieldNamespace = 'model' | 'prisma';
|
|
666
641
|
export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes';
|
|
667
|
-
export
|
|
642
|
+
export interface Field {
|
|
668
643
|
kind: FieldKind;
|
|
669
644
|
name: string;
|
|
670
645
|
isRequired: boolean;
|
|
@@ -687,13 +662,13 @@ export declare namespace DMMF {
|
|
|
687
662
|
relationOnDelete?: string;
|
|
688
663
|
relationName?: string;
|
|
689
664
|
documentation?: string;
|
|
690
|
-
}
|
|
691
|
-
export
|
|
665
|
+
}
|
|
666
|
+
export interface FieldDefault {
|
|
692
667
|
name: string;
|
|
693
668
|
args: any[];
|
|
694
|
-
}
|
|
669
|
+
}
|
|
695
670
|
export type FieldDefaultScalar = string | boolean | number;
|
|
696
|
-
export
|
|
671
|
+
export interface Schema {
|
|
697
672
|
rootQueryType?: string;
|
|
698
673
|
rootMutationType?: string;
|
|
699
674
|
inputObjectTypes: {
|
|
@@ -711,17 +686,17 @@ export declare namespace DMMF {
|
|
|
711
686
|
fieldRefTypes: {
|
|
712
687
|
prisma?: FieldRefType[];
|
|
713
688
|
};
|
|
714
|
-
}
|
|
715
|
-
export
|
|
689
|
+
}
|
|
690
|
+
export interface Query {
|
|
716
691
|
name: string;
|
|
717
692
|
args: SchemaArg[];
|
|
718
693
|
output: QueryOutput;
|
|
719
|
-
}
|
|
720
|
-
export
|
|
694
|
+
}
|
|
695
|
+
export interface QueryOutput {
|
|
721
696
|
name: string;
|
|
722
697
|
isRequired: boolean;
|
|
723
698
|
isList: boolean;
|
|
724
|
-
}
|
|
699
|
+
}
|
|
725
700
|
export type TypeRef<AllowedLocations extends FieldLocation> = {
|
|
726
701
|
isList: boolean;
|
|
727
702
|
type: string;
|
|
@@ -729,33 +704,33 @@ export declare namespace DMMF {
|
|
|
729
704
|
namespace?: FieldNamespace;
|
|
730
705
|
};
|
|
731
706
|
export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>;
|
|
732
|
-
export
|
|
707
|
+
export interface SchemaArg {
|
|
733
708
|
name: string;
|
|
734
709
|
comment?: string;
|
|
735
710
|
isNullable: boolean;
|
|
736
711
|
isRequired: boolean;
|
|
737
712
|
inputTypes: InputTypeRef[];
|
|
738
713
|
deprecation?: Deprecation;
|
|
739
|
-
}
|
|
740
|
-
export
|
|
714
|
+
}
|
|
715
|
+
export interface OutputType {
|
|
741
716
|
name: string;
|
|
742
717
|
fields: SchemaField[];
|
|
743
|
-
}
|
|
744
|
-
export
|
|
718
|
+
}
|
|
719
|
+
export interface SchemaField {
|
|
745
720
|
name: string;
|
|
746
721
|
isNullable?: boolean;
|
|
747
722
|
outputType: OutputTypeRef;
|
|
748
723
|
args: SchemaArg[];
|
|
749
724
|
deprecation?: Deprecation;
|
|
750
725
|
documentation?: string;
|
|
751
|
-
}
|
|
726
|
+
}
|
|
752
727
|
export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>;
|
|
753
|
-
export
|
|
728
|
+
export interface Deprecation {
|
|
754
729
|
sinceVersion: string;
|
|
755
730
|
reason: string;
|
|
756
731
|
plannedRemovalVersion?: string;
|
|
757
|
-
}
|
|
758
|
-
export
|
|
732
|
+
}
|
|
733
|
+
export interface InputType {
|
|
759
734
|
name: string;
|
|
760
735
|
constraints: {
|
|
761
736
|
maxNumFields: number | null;
|
|
@@ -766,14 +741,14 @@ export declare namespace DMMF {
|
|
|
766
741
|
source?: string;
|
|
767
742
|
};
|
|
768
743
|
fields: SchemaArg[];
|
|
769
|
-
}
|
|
770
|
-
export
|
|
744
|
+
}
|
|
745
|
+
export interface FieldRefType {
|
|
771
746
|
name: string;
|
|
772
747
|
allowTypes: FieldRefAllowType[];
|
|
773
748
|
fields: SchemaArg[];
|
|
774
|
-
}
|
|
749
|
+
}
|
|
775
750
|
export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>;
|
|
776
|
-
export
|
|
751
|
+
export interface ModelMapping {
|
|
777
752
|
model: string;
|
|
778
753
|
plural: string;
|
|
779
754
|
findUnique?: string | null;
|
|
@@ -793,7 +768,7 @@ export declare namespace DMMF {
|
|
|
793
768
|
count?: string | null;
|
|
794
769
|
findRaw?: string | null;
|
|
795
770
|
aggregateRaw?: string | null;
|
|
796
|
-
}
|
|
771
|
+
}
|
|
797
772
|
export enum ModelAction {
|
|
798
773
|
findUnique = "findUnique",
|
|
799
774
|
findUniqueOrThrow = "findUniqueOrThrow",
|
|
@@ -817,24 +792,24 @@ export declare namespace DMMF {
|
|
|
817
792
|
|
|
818
793
|
export declare class DMMFClass implements DMMF.Document {
|
|
819
794
|
document: DMMF.Document;
|
|
820
|
-
private
|
|
821
|
-
private
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
795
|
+
private compositeNames;
|
|
796
|
+
private inputTypesByName;
|
|
797
|
+
readonly typeAndModelMap: Dictionary<DMMF.Model>;
|
|
798
|
+
readonly mappingsMap: Dictionary<DMMF.ModelMapping>;
|
|
799
|
+
readonly outputTypeMap: NamespacedTypeMap<DMMF.OutputType>;
|
|
800
|
+
readonly rootFieldMap: Dictionary<DMMF.SchemaField>;
|
|
826
801
|
constructor(document: DMMF.Document);
|
|
827
|
-
private get compositeNames();
|
|
828
|
-
private get inputTypesByName();
|
|
829
|
-
get typeAndModelMap(): Dictionary_2<DMMF.Model>;
|
|
830
|
-
get mappingsMap(): Dictionary_2<DMMF.ModelMapping>;
|
|
831
|
-
get outputTypeMap(): NamespacedTypeMap<DMMF.OutputType>;
|
|
832
|
-
get rootFieldMap(): Dictionary_2<DMMF.SchemaField>;
|
|
833
802
|
get datamodel(): DMMF.Datamodel;
|
|
834
803
|
get mappings(): DMMF.Mappings;
|
|
835
804
|
get schema(): DMMF.Schema;
|
|
836
|
-
get inputObjectTypes():
|
|
837
|
-
|
|
805
|
+
get inputObjectTypes(): {
|
|
806
|
+
model?: DMMF.InputType[] | undefined;
|
|
807
|
+
prisma: DMMF.InputType[];
|
|
808
|
+
};
|
|
809
|
+
get outputObjectTypes(): {
|
|
810
|
+
model: DMMF.OutputType[];
|
|
811
|
+
prisma: DMMF.OutputType[];
|
|
812
|
+
};
|
|
838
813
|
isComposite(modelOrTypeName: string): boolean;
|
|
839
814
|
getOtherOperationNames(): string[];
|
|
840
815
|
hasEnumInNamespace(enumName: string, namespace: DMMF.FieldNamespace): boolean;
|
|
@@ -853,11 +828,11 @@ export declare interface DriverAdapter extends Queryable {
|
|
|
853
828
|
/**
|
|
854
829
|
* Starts new transation.
|
|
855
830
|
*/
|
|
856
|
-
startTransaction(): Promise<
|
|
831
|
+
startTransaction(): Promise<Result_3<Transaction_2>>;
|
|
857
832
|
/**
|
|
858
|
-
*
|
|
833
|
+
* Closes the connection to the database, if any.
|
|
859
834
|
*/
|
|
860
|
-
|
|
835
|
+
close: () => Promise<Result_3<void>>;
|
|
861
836
|
}
|
|
862
837
|
|
|
863
838
|
/** Client */
|
|
@@ -1006,15 +981,15 @@ export declare const empty: Sql;
|
|
|
1006
981
|
export declare type EmptyToUnknown<T> = T;
|
|
1007
982
|
|
|
1008
983
|
declare abstract class Engine<InteractiveTransactionPayload = unknown> {
|
|
1009
|
-
abstract
|
|
984
|
+
abstract on(event: EngineEventType, listener: (args?: any) => any): void;
|
|
1010
985
|
abstract start(): Promise<void>;
|
|
1011
986
|
abstract stop(): Promise<void>;
|
|
1012
987
|
abstract version(forceRun?: boolean): Promise<string> | string;
|
|
1013
|
-
abstract request<T>(query: JsonQuery, options:
|
|
988
|
+
abstract request<T>(query: JsonQuery, options: RequestOptions<InteractiveTransactionPayload>): Promise<QueryEngineResult<T>>;
|
|
1014
989
|
abstract requestBatch<T>(queries: JsonQuery[], options: RequestBatchOptions<InteractiveTransactionPayload>): Promise<BatchQueryEngineResult<T>[]>;
|
|
1015
|
-
abstract transaction(action: 'start', headers:
|
|
1016
|
-
abstract transaction(action: 'commit', headers:
|
|
1017
|
-
abstract transaction(action: 'rollback', headers:
|
|
990
|
+
abstract transaction(action: 'start', headers: Transaction.TransactionHeaders, options?: Transaction.Options): Promise<Transaction.InteractiveTransactionInfo<unknown>>;
|
|
991
|
+
abstract transaction(action: 'commit', headers: Transaction.TransactionHeaders, info: Transaction.InteractiveTransactionInfo<unknown>): Promise<void>;
|
|
992
|
+
abstract transaction(action: 'rollback', headers: Transaction.TransactionHeaders, info: Transaction.InteractiveTransactionInfo<unknown>): Promise<void>;
|
|
1018
993
|
abstract metrics(options: MetricsOptionsJson): Promise<Metrics>;
|
|
1019
994
|
abstract metrics(options: MetricsOptionsPrometheus): Promise<string>;
|
|
1020
995
|
}
|
|
@@ -1038,27 +1013,26 @@ declare interface EngineConfig {
|
|
|
1038
1013
|
previewFeatures?: string[];
|
|
1039
1014
|
engineEndpoint?: string;
|
|
1040
1015
|
activeProvider?: string;
|
|
1041
|
-
logEmitter:
|
|
1016
|
+
logEmitter: EventEmitter;
|
|
1042
1017
|
/**
|
|
1043
1018
|
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`.
|
|
1044
1019
|
* If set, this is only used in the library engine, and all queries would be performed through it,
|
|
1045
1020
|
* rather than Prisma's Rust drivers.
|
|
1046
|
-
* @remarks only used by LibraryEngine.ts
|
|
1047
1021
|
*/
|
|
1048
1022
|
adapter?: ErrorCapturingDriverAdapter;
|
|
1049
1023
|
/**
|
|
1050
1024
|
* The contents of the schema encoded into a string
|
|
1051
|
-
* @remarks only used
|
|
1025
|
+
* @remarks only used for the purpose of data proxy
|
|
1052
1026
|
*/
|
|
1053
1027
|
inlineSchema: string;
|
|
1054
1028
|
/**
|
|
1055
1029
|
* The contents of the datasource url saved in a string
|
|
1056
|
-
* @remarks only used
|
|
1030
|
+
* @remarks only used for the purpose of data proxy
|
|
1057
1031
|
*/
|
|
1058
1032
|
inlineDatasources: GetPrismaClientConfig['inlineDatasources'];
|
|
1059
1033
|
/**
|
|
1060
1034
|
* The string hash that was produced for a given schema
|
|
1061
|
-
* @remarks only used
|
|
1035
|
+
* @remarks only used for the purpose of data proxy
|
|
1062
1036
|
*/
|
|
1063
1037
|
inlineSchemaHash: string;
|
|
1064
1038
|
/**
|
|
@@ -1077,14 +1051,11 @@ declare interface EngineConfig {
|
|
|
1077
1051
|
* generated specifically for each type of client, eg. Node.js client and Edge
|
|
1078
1052
|
* clients will have different implementations.
|
|
1079
1053
|
* @remarks this is a callback on purpose, we only load the wasm if needed.
|
|
1080
|
-
* @remarks only used by LibraryEngine.ts
|
|
1081
1054
|
*/
|
|
1082
1055
|
getQueryEngineWasmModule?: () => Promise<unknown>;
|
|
1083
1056
|
}
|
|
1084
1057
|
|
|
1085
|
-
declare type
|
|
1086
|
-
|
|
1087
|
-
declare type EngineEventType = QueryEventType | LogEventType;
|
|
1058
|
+
declare type EngineEventType = 'query' | 'info' | 'warn' | 'error' | 'beforeExit';
|
|
1088
1059
|
|
|
1089
1060
|
declare type EngineSpan = {
|
|
1090
1061
|
span: boolean;
|
|
@@ -1159,7 +1130,10 @@ declare interface ErrorWithBatchIndex {
|
|
|
1159
1130
|
batchRequestIdx?: number;
|
|
1160
1131
|
}
|
|
1161
1132
|
|
|
1162
|
-
declare
|
|
1133
|
+
declare interface EventEmitter {
|
|
1134
|
+
on(event: string, listener: (...args: any[]) => void): unknown;
|
|
1135
|
+
emit(event: string, args?: any): boolean;
|
|
1136
|
+
}
|
|
1163
1137
|
|
|
1164
1138
|
export declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
|
|
1165
1139
|
[K in keyof A]: Exact<A[K], W[K]>;
|
|
@@ -1193,8 +1167,6 @@ declare interface ExceptionWithName {
|
|
|
1193
1167
|
stack?: string;
|
|
1194
1168
|
}
|
|
1195
1169
|
|
|
1196
|
-
declare type ExtendedEventType = LogLevel | 'beforeExit';
|
|
1197
|
-
|
|
1198
1170
|
declare type ExtendedSpanOptions = SpanOptions & {
|
|
1199
1171
|
/** The name of the span */
|
|
1200
1172
|
name: string;
|
|
@@ -1311,7 +1283,7 @@ declare interface GeneratorConfig {
|
|
|
1311
1283
|
output: EnvValue | null;
|
|
1312
1284
|
isCustomOutput?: boolean;
|
|
1313
1285
|
provider: EnvValue;
|
|
1314
|
-
config:
|
|
1286
|
+
config: Dictionary_2<string | string[]>;
|
|
1315
1287
|
binaryTargets: BinaryTargetsEnvValue[];
|
|
1316
1288
|
previewFeatures: string[];
|
|
1317
1289
|
}
|
|
@@ -1389,7 +1361,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
|
|
|
1389
1361
|
* @param middleware to hook
|
|
1390
1362
|
*/
|
|
1391
1363
|
$use(middleware: QueryMiddleware): void;
|
|
1392
|
-
$on
|
|
1364
|
+
$on(eventType: EngineEventType, callback: (event: any) => void): void;
|
|
1393
1365
|
$connect(): Promise<void>;
|
|
1394
1366
|
/**
|
|
1395
1367
|
* Disconnect from the database
|
|
@@ -1463,7 +1435,7 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
|
|
|
1463
1435
|
*/
|
|
1464
1436
|
_transactionWithCallback({ callback, options, }: {
|
|
1465
1437
|
callback: (client: Client) => Promise<unknown>;
|
|
1466
|
-
options?:
|
|
1438
|
+
options?: Options_2 | undefined;
|
|
1467
1439
|
}): Promise<unknown>;
|
|
1468
1440
|
_createItxClient(transaction: PrismaPromiseInteractiveTransaction): Client;
|
|
1469
1441
|
/**
|
|
@@ -1608,7 +1580,6 @@ declare type HandleErrorParams = {
|
|
|
1608
1580
|
clientMethod: string;
|
|
1609
1581
|
callsite?: CallSite;
|
|
1610
1582
|
transaction?: PrismaPromiseTransaction;
|
|
1611
|
-
modelName?: string;
|
|
1612
1583
|
};
|
|
1613
1584
|
|
|
1614
1585
|
/**
|
|
@@ -1638,7 +1609,7 @@ declare type InteractiveTransactionInfo<Payload = unknown> = {
|
|
|
1638
1609
|
payload: Payload;
|
|
1639
1610
|
};
|
|
1640
1611
|
|
|
1641
|
-
declare type InteractiveTransactionOptions<Payload> =
|
|
1612
|
+
declare type InteractiveTransactionOptions<Payload> = Transaction.InteractiveTransactionInfo<Payload>;
|
|
1642
1613
|
|
|
1643
1614
|
export declare type InternalArgs<R = {
|
|
1644
1615
|
[K in string]: {
|
|
@@ -1733,7 +1704,7 @@ export declare type JsInputValue = null | undefined | string | number | boolean
|
|
|
1733
1704
|
[key: string]: JsInputValue;
|
|
1734
1705
|
};
|
|
1735
1706
|
|
|
1736
|
-
declare type JsonArgumentValue = number | string | boolean | null |
|
|
1707
|
+
declare type JsonArgumentValue = number | string | boolean | null | JsonTaggedValue | JsonArgumentValue[] | {
|
|
1737
1708
|
[key: string]: JsonArgumentValue;
|
|
1738
1709
|
};
|
|
1739
1710
|
|
|
@@ -1745,7 +1716,7 @@ export declare interface JsonConvertible {
|
|
|
1745
1716
|
}
|
|
1746
1717
|
|
|
1747
1718
|
declare type JsonFieldSelection = {
|
|
1748
|
-
arguments?: Record<string, JsonArgumentValue
|
|
1719
|
+
arguments?: Record<string, JsonArgumentValue>;
|
|
1749
1720
|
selection: JsonSelectionSet;
|
|
1750
1721
|
};
|
|
1751
1722
|
|
|
@@ -1771,6 +1742,11 @@ declare type JsonSelectionSet = {
|
|
|
1771
1742
|
[fieldName: string]: boolean | JsonFieldSelection;
|
|
1772
1743
|
};
|
|
1773
1744
|
|
|
1745
|
+
declare type JsonTaggedValue = {
|
|
1746
|
+
$type: 'Json';
|
|
1747
|
+
value: string;
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1774
1750
|
export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null;
|
|
1775
1751
|
|
|
1776
1752
|
export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | {
|
|
@@ -1828,20 +1804,6 @@ declare type LogDefinition = {
|
|
|
1828
1804
|
emit: 'stdout' | 'event';
|
|
1829
1805
|
};
|
|
1830
1806
|
|
|
1831
|
-
declare type LogEmitter = {
|
|
1832
|
-
on<E extends EngineEventType>(event: E, listener: (event: EngineEvent<E>) => void): LogEmitter;
|
|
1833
|
-
emit(event: QueryEventType, payload: QueryEvent): void;
|
|
1834
|
-
emit(event: LogEventType, payload: LogEvent): void;
|
|
1835
|
-
};
|
|
1836
|
-
|
|
1837
|
-
declare type LogEvent = {
|
|
1838
|
-
timestamp: Date;
|
|
1839
|
-
message: string;
|
|
1840
|
-
target: string;
|
|
1841
|
-
};
|
|
1842
|
-
|
|
1843
|
-
declare type LogEventType = 'info' | 'warn' | 'error';
|
|
1844
|
-
|
|
1845
1807
|
declare type LogLevel = 'info' | 'query' | 'warn' | 'error';
|
|
1846
1808
|
|
|
1847
1809
|
/**
|
|
@@ -2007,7 +1969,7 @@ export declare type NeverToUnknown<T> = [T] extends [never] ? unknown : T;
|
|
|
2007
1969
|
* @param options
|
|
2008
1970
|
* @returns
|
|
2009
1971
|
*/
|
|
2010
|
-
declare function nodeFetch(url: string, options?:
|
|
1972
|
+
declare function nodeFetch(url: string, options?: RequestOptions_2): Promise<RequestResponse>;
|
|
2011
1973
|
|
|
2012
1974
|
declare class NodeHeaders {
|
|
2013
1975
|
readonly headers: Map<string, string>;
|
|
@@ -2095,20 +2057,20 @@ export declare type OptionalKeys<O> = {
|
|
|
2095
2057
|
[K in keyof O]-?: {} extends Pick_2<O, K> ? K : never;
|
|
2096
2058
|
}[keyof O];
|
|
2097
2059
|
|
|
2060
|
+
declare type Options = {
|
|
2061
|
+
clientVersion: string;
|
|
2062
|
+
};
|
|
2063
|
+
|
|
2098
2064
|
/**
|
|
2099
2065
|
* maxWait ?= 2000
|
|
2100
2066
|
* timeout ?= 5000
|
|
2101
2067
|
*/
|
|
2102
|
-
declare type
|
|
2068
|
+
declare type Options_2 = {
|
|
2103
2069
|
maxWait?: number;
|
|
2104
2070
|
timeout?: number;
|
|
2105
2071
|
isolationLevel?: IsolationLevel;
|
|
2106
2072
|
};
|
|
2107
2073
|
|
|
2108
|
-
declare type Options_2 = {
|
|
2109
|
-
clientVersion: string;
|
|
2110
|
-
};
|
|
2111
|
-
|
|
2112
2074
|
export declare type Or<A extends 1 | 0, B extends 1 | 0> = {
|
|
2113
2075
|
0: {
|
|
2114
2076
|
0: 0;
|
|
@@ -2166,7 +2128,7 @@ export declare type PrismaClientOptions = {
|
|
|
2166
2128
|
/**
|
|
2167
2129
|
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale.
|
|
2168
2130
|
*/
|
|
2169
|
-
adapter?: DriverAdapter
|
|
2131
|
+
adapter?: DriverAdapter;
|
|
2170
2132
|
/**
|
|
2171
2133
|
* Overwrites the datasource url from your schema.prisma file
|
|
2172
2134
|
*/
|
|
@@ -2203,8 +2165,6 @@ export declare type PrismaClientOptions = {
|
|
|
2203
2165
|
endpoint?: string;
|
|
2204
2166
|
allowTriggerPanic?: boolean;
|
|
2205
2167
|
};
|
|
2206
|
-
/** This can be used for testing purposes */
|
|
2207
|
-
configOverride?: Partial<GetPrismaClientConfig>;
|
|
2208
2168
|
};
|
|
2209
2169
|
};
|
|
2210
2170
|
|
|
@@ -2224,7 +2184,7 @@ export declare class PrismaClientUnknownRequestError extends Error implements Er
|
|
|
2224
2184
|
export declare class PrismaClientValidationError extends Error {
|
|
2225
2185
|
name: string;
|
|
2226
2186
|
clientVersion: string;
|
|
2227
|
-
constructor(message: string, { clientVersion }:
|
|
2187
|
+
constructor(message: string, { clientVersion }: Options);
|
|
2228
2188
|
get [Symbol.toStringTag](): string;
|
|
2229
2189
|
}
|
|
2230
2190
|
|
|
@@ -2317,14 +2277,14 @@ declare type Query = {
|
|
|
2317
2277
|
};
|
|
2318
2278
|
|
|
2319
2279
|
declare interface Queryable {
|
|
2320
|
-
readonly
|
|
2280
|
+
readonly flavour: 'mysql' | 'postgres' | 'sqlite';
|
|
2321
2281
|
/**
|
|
2322
2282
|
* Execute a query given as SQL, interpolating the given parameters,
|
|
2323
2283
|
* and returning the type-aware result set of the query.
|
|
2324
2284
|
*
|
|
2325
2285
|
* This is the preferred way of executing `SELECT` queries.
|
|
2326
2286
|
*/
|
|
2327
|
-
queryRaw(params: Query): Promise<
|
|
2287
|
+
queryRaw(params: Query): Promise<Result_3<ResultSet>>;
|
|
2328
2288
|
/**
|
|
2329
2289
|
* Execute a query given as SQL, interpolating the given parameters,
|
|
2330
2290
|
* and returning the number of affected rows.
|
|
@@ -2332,7 +2292,7 @@ declare interface Queryable {
|
|
|
2332
2292
|
* This is the preferred way of executing `INSERT`, `UPDATE`, `DELETE` queries,
|
|
2333
2293
|
* as well as transactional queries.
|
|
2334
2294
|
*/
|
|
2335
|
-
executeRaw(params: Query): Promise<
|
|
2295
|
+
executeRaw(params: Query): Promise<Result_3<number>>;
|
|
2336
2296
|
}
|
|
2337
2297
|
|
|
2338
2298
|
declare type QueryEngineResult<T> = {
|
|
@@ -2340,16 +2300,6 @@ declare type QueryEngineResult<T> = {
|
|
|
2340
2300
|
elapsed: number;
|
|
2341
2301
|
};
|
|
2342
2302
|
|
|
2343
|
-
declare type QueryEvent = {
|
|
2344
|
-
timestamp: Date;
|
|
2345
|
-
query: string;
|
|
2346
|
-
params: string;
|
|
2347
|
-
duration: number;
|
|
2348
|
-
target: string;
|
|
2349
|
-
};
|
|
2350
|
-
|
|
2351
|
-
declare type QueryEventType = 'query';
|
|
2352
|
-
|
|
2353
2303
|
declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise<unknown>) => Promise<unknown>;
|
|
2354
2304
|
|
|
2355
2305
|
declare type QueryMiddlewareParams = {
|
|
@@ -2393,11 +2343,6 @@ export declare type RawParameters = {
|
|
|
2393
2343
|
|
|
2394
2344
|
export declare type RawQueryArgs = Sql | [query: string, ...values: RawValue[]];
|
|
2395
2345
|
|
|
2396
|
-
declare type RawTaggedValue = {
|
|
2397
|
-
$type: 'Raw';
|
|
2398
|
-
value: unknown;
|
|
2399
|
-
};
|
|
2400
|
-
|
|
2401
2346
|
/**
|
|
2402
2347
|
* Supported value or SQL instance.
|
|
2403
2348
|
*/
|
|
@@ -2407,10 +2352,6 @@ export declare type ReadonlyDeep<T> = {
|
|
|
2407
2352
|
readonly [K in keyof T]: ReadonlyDeep<T[K]>;
|
|
2408
2353
|
};
|
|
2409
2354
|
|
|
2410
|
-
declare type ReadonlyDeep_2<O> = {
|
|
2411
|
-
+readonly [K in keyof O]: ReadonlyDeep_2<O[K]>;
|
|
2412
|
-
};
|
|
2413
|
-
|
|
2414
2355
|
declare type Record_2<T extends string | number | symbol, U> = {
|
|
2415
2356
|
[P in T]: U;
|
|
2416
2357
|
};
|
|
@@ -2421,7 +2362,7 @@ export declare type RenameAndNestPayloadKeys<P> = {
|
|
|
2421
2362
|
};
|
|
2422
2363
|
|
|
2423
2364
|
declare type RequestBatchOptions<InteractiveTransactionPayload> = {
|
|
2424
|
-
transaction?:
|
|
2365
|
+
transaction?: TransactionOptions<InteractiveTransactionPayload>;
|
|
2425
2366
|
traceparent?: string;
|
|
2426
2367
|
numTry?: number;
|
|
2427
2368
|
containsWrite: boolean;
|
|
@@ -2432,7 +2373,7 @@ declare class RequestHandler {
|
|
|
2432
2373
|
client: Client;
|
|
2433
2374
|
dataloader: DataLoader<RequestParams>;
|
|
2434
2375
|
private logEmitter?;
|
|
2435
|
-
constructor(client: Client, logEmitter?:
|
|
2376
|
+
constructor(client: Client, logEmitter?: EventEmitter);
|
|
2436
2377
|
request(params: RequestParams): Promise<any>;
|
|
2437
2378
|
mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult<any>): any;
|
|
2438
2379
|
/**
|
|
@@ -2440,19 +2381,13 @@ declare class RequestHandler {
|
|
|
2440
2381
|
* handlers to finish.
|
|
2441
2382
|
*/
|
|
2442
2383
|
handleAndLogRequestError(params: HandleErrorParams): never;
|
|
2443
|
-
handleRequestError({ error, clientMethod, callsite, transaction, args
|
|
2384
|
+
handleRequestError({ error, clientMethod, callsite, transaction, args }: HandleErrorParams): never;
|
|
2444
2385
|
sanitizeMessage(message: any): any;
|
|
2445
2386
|
unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any;
|
|
2446
2387
|
get [Symbol.toStringTag](): string;
|
|
2447
2388
|
}
|
|
2448
2389
|
|
|
2449
|
-
declare type RequestOptions = {
|
|
2450
|
-
method?: string;
|
|
2451
|
-
headers?: Record<string, string>;
|
|
2452
|
-
body?: string;
|
|
2453
|
-
};
|
|
2454
|
-
|
|
2455
|
-
declare type RequestOptions_2<InteractiveTransactionPayload> = {
|
|
2390
|
+
declare type RequestOptions<InteractiveTransactionPayload> = {
|
|
2456
2391
|
traceparent?: string;
|
|
2457
2392
|
numTry?: number;
|
|
2458
2393
|
interactiveTransaction?: InteractiveTransactionOptions<InteractiveTransactionPayload>;
|
|
@@ -2460,6 +2395,12 @@ declare type RequestOptions_2<InteractiveTransactionPayload> = {
|
|
|
2460
2395
|
customDataProxyFetch?: (fetch: Fetch) => Fetch;
|
|
2461
2396
|
};
|
|
2462
2397
|
|
|
2398
|
+
declare type RequestOptions_2 = {
|
|
2399
|
+
method?: string;
|
|
2400
|
+
headers?: Record<string, string>;
|
|
2401
|
+
body?: string;
|
|
2402
|
+
};
|
|
2403
|
+
|
|
2463
2404
|
declare type RequestParams = {
|
|
2464
2405
|
modelName?: string;
|
|
2465
2406
|
action: Action;
|
|
@@ -2509,7 +2450,18 @@ export declare type Result<T, A, F extends Operation> = T extends {
|
|
|
2509
2450
|
|
|
2510
2451
|
export declare type Result_2<T, A, F extends Operation> = Result<T, A, F>;
|
|
2511
2452
|
|
|
2512
|
-
declare
|
|
2453
|
+
declare type Result_3<T> = {
|
|
2454
|
+
map<U>(fn: (value: T) => U): Result_3<U>;
|
|
2455
|
+
flatMap<U>(fn: (value: T) => Result_3<U>): Result_3<U>;
|
|
2456
|
+
} & ({
|
|
2457
|
+
readonly ok: true;
|
|
2458
|
+
readonly value: T;
|
|
2459
|
+
} | {
|
|
2460
|
+
readonly ok: false;
|
|
2461
|
+
readonly error: Error_2;
|
|
2462
|
+
});
|
|
2463
|
+
|
|
2464
|
+
declare namespace Result_4 {
|
|
2513
2465
|
export {
|
|
2514
2466
|
Operation,
|
|
2515
2467
|
FluentOperation,
|
|
@@ -2528,17 +2480,6 @@ declare namespace Result_3 {
|
|
|
2528
2480
|
}
|
|
2529
2481
|
}
|
|
2530
2482
|
|
|
2531
|
-
declare type Result_4<T> = {
|
|
2532
|
-
map<U>(fn: (value: T) => U): Result_4<U>;
|
|
2533
|
-
flatMap<U>(fn: (value: T) => Result_4<U>): Result_4<U>;
|
|
2534
|
-
} & ({
|
|
2535
|
-
readonly ok: true;
|
|
2536
|
-
readonly value: T;
|
|
2537
|
-
} | {
|
|
2538
|
-
readonly ok: false;
|
|
2539
|
-
readonly error: Error_2;
|
|
2540
|
-
});
|
|
2541
|
-
|
|
2542
2483
|
export declare type ResultArg = {
|
|
2543
2484
|
[FieldName in string]: ResultFieldDefinition;
|
|
2544
2485
|
};
|
|
@@ -2575,15 +2516,13 @@ declare interface ResultSet {
|
|
|
2575
2516
|
rows: Array<Array<unknown>>;
|
|
2576
2517
|
/**
|
|
2577
2518
|
* The last ID of an `INSERT` statement, if any.
|
|
2578
|
-
* This is required for `AUTO_INCREMENT` columns in
|
|
2519
|
+
* This is required for `AUTO_INCREMENT` columns in MySQL and SQLite-flavoured databases.
|
|
2579
2520
|
*/
|
|
2580
2521
|
lastInsertId?: string;
|
|
2581
2522
|
}
|
|
2582
2523
|
|
|
2583
2524
|
export declare type Return<T> = T extends (...args: any[]) => infer R ? R : T;
|
|
2584
2525
|
|
|
2585
|
-
declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown";
|
|
2586
|
-
|
|
2587
2526
|
declare type RuntimeDataModel = {
|
|
2588
2527
|
readonly models: Record<string, RuntimeModel>;
|
|
2589
2528
|
readonly enums: Record<string, RuntimeEnum>;
|
|
@@ -2856,7 +2795,6 @@ export declare class Sql {
|
|
|
2856
2795
|
constructor(rawStrings: readonly string[], rawValues: readonly RawValue[]);
|
|
2857
2796
|
get text(): string;
|
|
2858
2797
|
get sql(): string;
|
|
2859
|
-
get statement(): string;
|
|
2860
2798
|
inspect(): {
|
|
2861
2799
|
text: string;
|
|
2862
2800
|
sql: string;
|
|
@@ -2924,39 +2862,42 @@ declare interface TracingHelper {
|
|
|
2924
2862
|
runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R;
|
|
2925
2863
|
}
|
|
2926
2864
|
|
|
2927
|
-
declare
|
|
2865
|
+
declare namespace Transaction {
|
|
2866
|
+
export {
|
|
2867
|
+
IsolationLevel,
|
|
2868
|
+
Options_2 as Options,
|
|
2869
|
+
InteractiveTransactionInfo,
|
|
2870
|
+
TransactionHeaders
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
declare interface Transaction_2 extends Queryable {
|
|
2928
2875
|
/**
|
|
2929
2876
|
* Transaction options.
|
|
2930
2877
|
*/
|
|
2931
|
-
readonly options:
|
|
2878
|
+
readonly options: TransactionOptions_2;
|
|
2932
2879
|
/**
|
|
2933
2880
|
* Commit the transaction.
|
|
2934
2881
|
*/
|
|
2935
|
-
commit(): Promise<
|
|
2882
|
+
commit(): Promise<Result_3<void>>;
|
|
2936
2883
|
/**
|
|
2937
2884
|
* Rolls back the transaction.
|
|
2938
2885
|
*/
|
|
2939
|
-
rollback(): Promise<
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
TransactionHeaders
|
|
2948
|
-
}
|
|
2886
|
+
rollback(): Promise<Result_3<void>>;
|
|
2887
|
+
/**
|
|
2888
|
+
* Discards and closes the transaction which may or may not have been committed or rolled back.
|
|
2889
|
+
* This operation must be synchronous. If the implementation requires calling creating new
|
|
2890
|
+
* asynchronous tasks on the event loop, the driver is responsible for handling the errors
|
|
2891
|
+
* appropriately to ensure they don't crash the application.
|
|
2892
|
+
*/
|
|
2893
|
+
dispose(): Result_3<void>;
|
|
2949
2894
|
}
|
|
2950
2895
|
|
|
2951
2896
|
declare type TransactionHeaders = {
|
|
2952
2897
|
traceparent?: string;
|
|
2953
2898
|
};
|
|
2954
2899
|
|
|
2955
|
-
declare type TransactionOptions = {
|
|
2956
|
-
usePhantomQuery: boolean;
|
|
2957
|
-
};
|
|
2958
|
-
|
|
2959
|
-
declare type TransactionOptions_2<InteractiveTransactionPayload> = {
|
|
2900
|
+
declare type TransactionOptions<InteractiveTransactionPayload> = {
|
|
2960
2901
|
kind: 'itx';
|
|
2961
2902
|
options: InteractiveTransactionOptions<InteractiveTransactionPayload>;
|
|
2962
2903
|
} | {
|
|
@@ -2964,6 +2905,10 @@ declare type TransactionOptions_2<InteractiveTransactionPayload> = {
|
|
|
2964
2905
|
options: BatchTransactionOptions;
|
|
2965
2906
|
};
|
|
2966
2907
|
|
|
2908
|
+
declare type TransactionOptions_2 = {
|
|
2909
|
+
usePhantomQuery: boolean;
|
|
2910
|
+
};
|
|
2911
|
+
|
|
2967
2912
|
export declare type TypeMapCbDef = Fn<{
|
|
2968
2913
|
extArgs: InternalArgs;
|
|
2969
2914
|
}, TypeMapDef>;
|
|
@@ -2973,7 +2918,7 @@ export declare type TypeMapDef = Record<any, any>;
|
|
|
2973
2918
|
|
|
2974
2919
|
declare namespace Types {
|
|
2975
2920
|
export {
|
|
2976
|
-
|
|
2921
|
+
Result_4 as Result,
|
|
2977
2922
|
Extensions_2 as Extensions,
|
|
2978
2923
|
Utils,
|
|
2979
2924
|
Public_2 as Public,
|