@pkgverse/prismock 2.0.0 → 2.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +7535 -419
- package/dist/lib/client.d.ts +39 -13
- package/dist/lib/dmmf.d.ts +4 -0
- package/dist/lib/operations/create.d.ts +1 -23
- package/dist/lib/operations/find/find.d.ts +5 -141
- package/dist/lib/prismock.d.ts +11 -270
- package/package.json +9 -7
package/dist/lib/client.d.ts
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import type { PrismaClient } from
|
|
2
|
-
import type * as runtime from
|
|
3
|
-
import { Delegate } from
|
|
4
|
-
import { Data } from
|
|
5
|
-
import { type ExtensionsDefinition } from
|
|
6
|
-
type GetData = () => Data
|
|
7
|
-
type SetData = (data: Data) => void
|
|
1
|
+
import type { Prisma, PrismaClient } from "@prisma/client";
|
|
2
|
+
import type * as runtime from "@prisma/client/runtime/library";
|
|
3
|
+
import type { Delegate } from "./delegate";
|
|
4
|
+
import { Data } from "./prismock";
|
|
5
|
+
import { type ExtensionsDefinition } from "./extensions";
|
|
6
|
+
type GetData = () => Promise<Data>;
|
|
7
|
+
type SetData = (data: Data) => Promise<void>;
|
|
8
8
|
export interface PrismockData {
|
|
9
9
|
getData: GetData;
|
|
10
10
|
setData: SetData;
|
|
11
|
-
reset: () => void
|
|
11
|
+
reset: () => Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
export type PrismockClientType<T = PrismaClient> = T & PrismockData;
|
|
14
|
+
export type PrismockOptions = {
|
|
15
|
+
usePgLite?: undefined | null | {
|
|
16
|
+
schemaPath: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
14
19
|
export declare class Prismock<PC = PrismaClient> {
|
|
15
20
|
__prismaModule: PrismaModule<PC>;
|
|
16
21
|
protected constructor(prismaModule: PrismaModule<PC>);
|
|
17
22
|
static create<PC = PrismaClient>(prismaModule: PrismaModule<PC>): Promise<PrismockClientType<PC>>;
|
|
18
|
-
static createDefault(): Promise<PrismaClient<
|
|
23
|
+
static createDefault(): Promise<PrismaClient<Prisma.PrismaClientOptions, never, runtime.DefaultArgs> & PrismockData>;
|
|
19
24
|
reset(): void;
|
|
20
25
|
private generate;
|
|
21
26
|
$connect(): Promise<void>;
|
|
@@ -26,14 +31,35 @@ export declare class Prismock<PC = PrismaClient> {
|
|
|
26
31
|
$executeRawUnsafe(): Promise<number>;
|
|
27
32
|
$queryRaw(): Promise<never[]>;
|
|
28
33
|
$queryRawUnsafe(): Promise<never[]>;
|
|
29
|
-
$extends(extensionDefs: ExtensionsDefinition): PrismaClient<
|
|
34
|
+
$extends(extensionDefs: ExtensionsDefinition): PrismaClient<Prisma.PrismaClientOptions, never, runtime.DefaultArgs>;
|
|
30
35
|
$transaction(args: any): Promise<any>;
|
|
31
36
|
}
|
|
32
37
|
export declare function generateClient<T = PrismaClient>(delegates: Record<string, Delegate>, getData: GetData, setData: SetData): PrismockClientType<T>;
|
|
33
38
|
export type PrismaModule<PC = PrismaClient> = {
|
|
34
39
|
dmmf: runtime.BaseDMMF;
|
|
35
40
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
type GetClientOptions<PrismaClientClassType extends new (...args: any[]) => any> = {
|
|
42
|
+
prismaModule: PrismaModule<InstanceType<PrismaClientClassType>>;
|
|
43
|
+
prismaClient: PrismaClientClassType;
|
|
44
|
+
schemaPath: string;
|
|
45
|
+
usePgLite?: boolean | null | undefined;
|
|
46
|
+
};
|
|
47
|
+
export declare function getClient<PrismaClientType extends new (options: {
|
|
48
|
+
adapter?: runtime.SqlDriverAdapterFactory | null;
|
|
49
|
+
}, ...args: any[]) => any>(options: GetClientOptions<PrismaClientType>): Promise<PrismockClientType<InstanceType<PrismaClientType>>>;
|
|
50
|
+
type GetClientClassOptions<PrismaClientClassType extends new (...args: any[]) => any> = {
|
|
51
|
+
prismaModule: PrismaModule<InstanceType<PrismaClientClassType>>;
|
|
52
|
+
PrismaClient: PrismaClientClassType;
|
|
53
|
+
schemaPath: string;
|
|
54
|
+
usePgLite?: boolean | null | undefined;
|
|
55
|
+
};
|
|
56
|
+
type PrismaClientClassMocked<PrismaClientType extends new (...args: any[]) => any> = PrismaClientType extends new (...args: infer Args) => infer Instance ? (new (...args: Args) => Instance & PrismockData) & PrismaClientType : never;
|
|
57
|
+
export declare function getClientClass<PrismaClientType extends new (...args: any[]) => any>(options: GetClientClassOptions<PrismaClientType>): Promise<PrismaClientClassMocked<PrismaClientType>>;
|
|
58
|
+
export declare function getDefaultClient(): Promise<PrismockClientType<PrismaClient<Prisma.PrismaClientOptions, unknown, runtime.InternalArgs>>>;
|
|
59
|
+
export declare function getDefaultClientClass(): Promise<(new (optionsArg?: Prisma.Subset<Prisma.PrismaClientOptions, Prisma.PrismaClientOptions> | undefined) => PrismaClient<Prisma.PrismaClientOptions, unknown, runtime.InternalArgs> & PrismockData) & typeof import(".prisma").PrismaClient>;
|
|
60
|
+
/**
|
|
61
|
+
* For backwards compatibility
|
|
62
|
+
*/
|
|
63
|
+
export declare const createPrismock: typeof getDefaultClient;
|
|
64
|
+
export declare const createPrismockClass: typeof getDefaultClientClass;
|
|
39
65
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DMMF } from '@prisma/generator-helper';
|
|
2
|
+
import type { ConfigMetaFormat } from '@prisma/internals/dist/engine-commands/getConfig';
|
|
3
|
+
export declare function generateDMMF(schemaPath?: string): Promise<DMMF.Document>;
|
|
4
|
+
export declare function generateConfig(schemaPath: string): Promise<ConfigMetaFormat>;
|
|
@@ -2,29 +2,7 @@ import { DMMF } from '@prisma/generator-helper';
|
|
|
2
2
|
import { Delegate, DelegateProperties, Item } from '../delegate';
|
|
3
3
|
import { Delegates } from '../prismock';
|
|
4
4
|
import { CreateArgs } from '../types';
|
|
5
|
-
export declare const isAutoIncrement: (field:
|
|
6
|
-
kind: DMMF.FieldKind;
|
|
7
|
-
name: string;
|
|
8
|
-
isRequired: boolean;
|
|
9
|
-
isList: boolean;
|
|
10
|
-
isUnique: boolean;
|
|
11
|
-
isId: boolean;
|
|
12
|
-
isReadOnly: boolean;
|
|
13
|
-
isGenerated?: boolean | undefined;
|
|
14
|
-
isUpdatedAt?: boolean | undefined;
|
|
15
|
-
type: string;
|
|
16
|
-
dbName?: string | null | undefined;
|
|
17
|
-
hasDefaultValue: boolean;
|
|
18
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
19
|
-
name: string;
|
|
20
|
-
args: any[];
|
|
21
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
22
|
-
relationFromFields?: string[] | undefined;
|
|
23
|
-
relationToFields?: string[] | undefined;
|
|
24
|
-
relationOnDelete?: string | undefined;
|
|
25
|
-
relationName?: string | undefined;
|
|
26
|
-
documentation?: string | undefined;
|
|
27
|
-
}>) => boolean;
|
|
5
|
+
export declare const isAutoIncrement: (field: DMMF.Field) => boolean;
|
|
28
6
|
export declare function calculateDefaultFieldValue(field: DMMF.Field, properties: DelegateProperties): unknown;
|
|
29
7
|
export declare function createDefaultValues(fields: DMMF.Field[], properties: DelegateProperties): Record<string, unknown>;
|
|
30
8
|
export declare function connectOrCreate(delegate: Delegate, delegates: Delegates): (item: Item) => Item;
|
|
@@ -11,145 +11,9 @@ export declare function order(args: FindArgs, delegate: Delegate, delegates: Del
|
|
|
11
11
|
export declare function paginate(skip?: number, take?: number): (items: Item[]) => Item[];
|
|
12
12
|
export declare function includes(args: FindArgs, current: Delegate, delegates: Delegates): (item: Item) => Item;
|
|
13
13
|
export declare function select(selectArgs: FindArgs['select']): (item: Item) => Item;
|
|
14
|
-
export declare const getJoinField: (field:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
isUnique: boolean;
|
|
20
|
-
isId: boolean;
|
|
21
|
-
isReadOnly: boolean;
|
|
22
|
-
isGenerated?: boolean | undefined;
|
|
23
|
-
isUpdatedAt?: boolean | undefined;
|
|
24
|
-
type: string;
|
|
25
|
-
dbName?: string | null | undefined;
|
|
26
|
-
hasDefaultValue: boolean;
|
|
27
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
28
|
-
name: string;
|
|
29
|
-
args: any[];
|
|
30
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
31
|
-
relationFromFields?: string[] | undefined;
|
|
32
|
-
relationToFields?: string[] | undefined;
|
|
33
|
-
relationOnDelete?: string | undefined;
|
|
34
|
-
relationName?: string | undefined;
|
|
35
|
-
documentation?: string | undefined;
|
|
36
|
-
}>, delegates: Delegates) => import("@prisma/generator-helper").ReadonlyDeep<import("@prisma/generator-helper").ReadonlyDeep<{
|
|
37
|
-
kind: DMMF.FieldKind;
|
|
38
|
-
name: string;
|
|
39
|
-
isRequired: boolean;
|
|
40
|
-
isList: boolean;
|
|
41
|
-
isUnique: boolean;
|
|
42
|
-
isId: boolean;
|
|
43
|
-
isReadOnly: boolean;
|
|
44
|
-
isGenerated?: boolean | undefined;
|
|
45
|
-
isUpdatedAt?: boolean | undefined;
|
|
46
|
-
type: string;
|
|
47
|
-
dbName?: string | null | undefined;
|
|
48
|
-
hasDefaultValue: boolean;
|
|
49
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
50
|
-
name: string;
|
|
51
|
-
args: any[];
|
|
52
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
53
|
-
relationFromFields?: string[] | undefined;
|
|
54
|
-
relationToFields?: string[] | undefined;
|
|
55
|
-
relationOnDelete?: string | undefined;
|
|
56
|
-
relationName?: string | undefined;
|
|
57
|
-
documentation?: string | undefined;
|
|
58
|
-
}>> | undefined;
|
|
59
|
-
export declare const getDelegateFromField: (field: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
60
|
-
kind: DMMF.FieldKind;
|
|
61
|
-
name: string;
|
|
62
|
-
isRequired: boolean;
|
|
63
|
-
isList: boolean;
|
|
64
|
-
isUnique: boolean;
|
|
65
|
-
isId: boolean;
|
|
66
|
-
isReadOnly: boolean;
|
|
67
|
-
isGenerated?: boolean | undefined;
|
|
68
|
-
isUpdatedAt?: boolean | undefined;
|
|
69
|
-
type: string;
|
|
70
|
-
dbName?: string | null | undefined;
|
|
71
|
-
hasDefaultValue: boolean;
|
|
72
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
73
|
-
name: string;
|
|
74
|
-
args: any[];
|
|
75
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
76
|
-
relationFromFields?: string[] | undefined;
|
|
77
|
-
relationToFields?: string[] | undefined;
|
|
78
|
-
relationOnDelete?: string | undefined;
|
|
79
|
-
relationName?: string | undefined;
|
|
80
|
-
documentation?: string | undefined;
|
|
81
|
-
}>, delegates: Delegates) => Delegate;
|
|
82
|
-
export declare const getFieldRelationshipWhere: (item: Item, field: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
83
|
-
kind: DMMF.FieldKind;
|
|
84
|
-
name: string;
|
|
85
|
-
isRequired: boolean;
|
|
86
|
-
isList: boolean;
|
|
87
|
-
isUnique: boolean;
|
|
88
|
-
isId: boolean;
|
|
89
|
-
isReadOnly: boolean;
|
|
90
|
-
isGenerated?: boolean | undefined;
|
|
91
|
-
isUpdatedAt?: boolean | undefined;
|
|
92
|
-
type: string;
|
|
93
|
-
dbName?: string | null | undefined;
|
|
94
|
-
hasDefaultValue: boolean;
|
|
95
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
96
|
-
name: string;
|
|
97
|
-
args: any[];
|
|
98
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
99
|
-
relationFromFields?: string[] | undefined;
|
|
100
|
-
relationToFields?: string[] | undefined;
|
|
101
|
-
relationOnDelete?: string | undefined;
|
|
102
|
-
relationName?: string | undefined;
|
|
103
|
-
documentation?: string | undefined;
|
|
104
|
-
}>, delegates: Delegates) => Record<string, GroupByFieldArg>;
|
|
105
|
-
export declare const getFieldFromRelationshipWhere: (item: Item, field: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
106
|
-
kind: DMMF.FieldKind;
|
|
107
|
-
name: string;
|
|
108
|
-
isRequired: boolean;
|
|
109
|
-
isList: boolean;
|
|
110
|
-
isUnique: boolean;
|
|
111
|
-
isId: boolean;
|
|
112
|
-
isReadOnly: boolean;
|
|
113
|
-
isGenerated?: boolean | undefined;
|
|
114
|
-
isUpdatedAt?: boolean | undefined;
|
|
115
|
-
type: string;
|
|
116
|
-
dbName?: string | null | undefined;
|
|
117
|
-
hasDefaultValue: boolean;
|
|
118
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
119
|
-
name: string;
|
|
120
|
-
args: any[];
|
|
121
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
122
|
-
relationFromFields?: string[] | undefined;
|
|
123
|
-
relationToFields?: string[] | undefined;
|
|
124
|
-
relationOnDelete?: string | undefined;
|
|
125
|
-
relationName?: string | undefined;
|
|
126
|
-
documentation?: string | undefined;
|
|
127
|
-
}>) => {
|
|
128
|
-
[x: string]: GroupByFieldArg;
|
|
129
|
-
};
|
|
130
|
-
export declare const getFieldToRelationshipWhere: (item: Item, field: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
131
|
-
kind: DMMF.FieldKind;
|
|
132
|
-
name: string;
|
|
133
|
-
isRequired: boolean;
|
|
134
|
-
isList: boolean;
|
|
135
|
-
isUnique: boolean;
|
|
136
|
-
isId: boolean;
|
|
137
|
-
isReadOnly: boolean;
|
|
138
|
-
isGenerated?: boolean | undefined;
|
|
139
|
-
isUpdatedAt?: boolean | undefined;
|
|
140
|
-
type: string;
|
|
141
|
-
dbName?: string | null | undefined;
|
|
142
|
-
hasDefaultValue: boolean;
|
|
143
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
144
|
-
name: string;
|
|
145
|
-
args: any[];
|
|
146
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
147
|
-
relationFromFields?: string[] | undefined;
|
|
148
|
-
relationToFields?: string[] | undefined;
|
|
149
|
-
relationOnDelete?: string | undefined;
|
|
150
|
-
relationName?: string | undefined;
|
|
151
|
-
documentation?: string | undefined;
|
|
152
|
-
}>) => {
|
|
153
|
-
[x: string]: GroupByFieldArg;
|
|
154
|
-
};
|
|
14
|
+
export declare const getJoinField: (field: DMMF.Field, delegates: Delegates) => DMMF.Field | undefined;
|
|
15
|
+
export declare const getDelegateFromField: (field: DMMF.Field, delegates: Delegates) => Delegate;
|
|
16
|
+
export declare const getFieldRelationshipWhere: (item: Item, field: DMMF.Field, delegates: Delegates) => Record<string, GroupByFieldArg>;
|
|
17
|
+
export declare const getFieldFromRelationshipWhere: (item: Item, field: DMMF.Field) => Record<string, GroupByFieldArg>;
|
|
18
|
+
export declare const getFieldToRelationshipWhere: (item: Item, field: DMMF.Field) => Record<string, GroupByFieldArg>;
|
|
155
19
|
export declare function findMany(args: FindArgs, current: Delegate, delegates: Delegates): Item[];
|
package/dist/lib/prismock.d.ts
CHANGED
|
@@ -12,279 +12,20 @@ type OptionsSync = {
|
|
|
12
12
|
export type Data = Record<string, Item[]>;
|
|
13
13
|
export type Properties = Record<string, DelegateProperties>;
|
|
14
14
|
export type Delegates = Record<string, Delegate>;
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
isList: boolean;
|
|
25
|
-
isUnique: boolean;
|
|
26
|
-
isId: boolean;
|
|
27
|
-
isReadOnly: boolean;
|
|
28
|
-
isGenerated?: boolean | undefined;
|
|
29
|
-
isUpdatedAt?: boolean | undefined;
|
|
30
|
-
type: string;
|
|
31
|
-
dbName?: string | null | undefined;
|
|
32
|
-
hasDefaultValue: boolean;
|
|
33
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
34
|
-
name: string;
|
|
35
|
-
args: any[];
|
|
36
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
37
|
-
relationFromFields?: string[] | undefined;
|
|
38
|
-
relationToFields?: string[] | undefined;
|
|
39
|
-
relationOnDelete?: string | undefined;
|
|
40
|
-
relationName?: string | undefined;
|
|
41
|
-
documentation?: string | undefined;
|
|
42
|
-
}>[];
|
|
43
|
-
uniqueFields: string[][];
|
|
44
|
-
uniqueIndexes: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
45
|
-
name: string;
|
|
46
|
-
fields: string[];
|
|
47
|
-
}>[];
|
|
48
|
-
documentation?: string | undefined;
|
|
49
|
-
primaryKey: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
50
|
-
name: string | null;
|
|
51
|
-
fields: string[];
|
|
52
|
-
}> | null;
|
|
53
|
-
isGenerated?: boolean | undefined;
|
|
54
|
-
}>[];
|
|
55
|
-
enums: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
56
|
-
name: string;
|
|
57
|
-
values: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
58
|
-
name: string;
|
|
59
|
-
dbName: string | null;
|
|
60
|
-
}>[];
|
|
61
|
-
dbName?: string | null | undefined;
|
|
62
|
-
documentation?: string | undefined;
|
|
63
|
-
}>[];
|
|
64
|
-
types: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
65
|
-
name: string;
|
|
66
|
-
dbName: string | null;
|
|
67
|
-
fields: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
68
|
-
kind: DMMF.FieldKind;
|
|
69
|
-
name: string;
|
|
70
|
-
isRequired: boolean;
|
|
71
|
-
isList: boolean;
|
|
72
|
-
isUnique: boolean;
|
|
73
|
-
isId: boolean;
|
|
74
|
-
isReadOnly: boolean;
|
|
75
|
-
isGenerated?: boolean | undefined;
|
|
76
|
-
isUpdatedAt?: boolean | undefined;
|
|
77
|
-
type: string;
|
|
78
|
-
dbName?: string | null | undefined;
|
|
79
|
-
hasDefaultValue: boolean;
|
|
80
|
-
default?: DMMF.FieldDefaultScalar[] | import("@prisma/generator-helper").ReadonlyDeep<{
|
|
81
|
-
name: string;
|
|
82
|
-
args: any[];
|
|
83
|
-
}> | DMMF.FieldDefaultScalar | undefined;
|
|
84
|
-
relationFromFields?: string[] | undefined;
|
|
85
|
-
relationToFields?: string[] | undefined;
|
|
86
|
-
relationOnDelete?: string | undefined;
|
|
87
|
-
relationName?: string | undefined;
|
|
88
|
-
documentation?: string | undefined;
|
|
89
|
-
}>[];
|
|
90
|
-
uniqueFields: string[][];
|
|
91
|
-
uniqueIndexes: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
92
|
-
name: string;
|
|
93
|
-
fields: string[];
|
|
94
|
-
}>[];
|
|
95
|
-
documentation?: string | undefined;
|
|
96
|
-
primaryKey: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
97
|
-
name: string | null;
|
|
98
|
-
fields: string[];
|
|
99
|
-
}> | null;
|
|
100
|
-
isGenerated?: boolean | undefined;
|
|
101
|
-
}>[];
|
|
102
|
-
indexes: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
103
|
-
model: string;
|
|
104
|
-
type: DMMF.IndexType;
|
|
105
|
-
isDefinedOnField: boolean;
|
|
106
|
-
name?: string | undefined;
|
|
107
|
-
dbName?: string | undefined;
|
|
108
|
-
algorithm?: string | undefined;
|
|
109
|
-
clustered?: boolean | undefined;
|
|
110
|
-
fields: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
111
|
-
name: string;
|
|
112
|
-
sortOrder?: DMMF.SortOrder | undefined;
|
|
113
|
-
length?: number | undefined;
|
|
114
|
-
operatorClass?: string | undefined;
|
|
115
|
-
}>[];
|
|
116
|
-
}>[];
|
|
117
|
-
}>;
|
|
118
|
-
schema: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
119
|
-
rootQueryType?: string | undefined;
|
|
120
|
-
rootMutationType?: string | undefined;
|
|
121
|
-
inputObjectTypes: {
|
|
122
|
-
model?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
123
|
-
name: string;
|
|
124
|
-
constraints: {
|
|
125
|
-
maxNumFields: number | null;
|
|
126
|
-
minNumFields: number | null;
|
|
127
|
-
fields?: string[] | undefined;
|
|
128
|
-
};
|
|
129
|
-
meta?: {
|
|
130
|
-
source?: string | undefined;
|
|
131
|
-
} | undefined;
|
|
132
|
-
fields: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
133
|
-
name: string;
|
|
134
|
-
comment?: string | undefined;
|
|
135
|
-
isNullable: boolean;
|
|
136
|
-
isRequired: boolean;
|
|
137
|
-
inputTypes: DMMF.InputTypeRef[];
|
|
138
|
-
deprecation?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
139
|
-
sinceVersion: string;
|
|
140
|
-
reason: string;
|
|
141
|
-
plannedRemovalVersion?: string | undefined;
|
|
142
|
-
}> | undefined;
|
|
143
|
-
}>[];
|
|
144
|
-
}>[] | undefined;
|
|
145
|
-
prisma: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
146
|
-
name: string;
|
|
147
|
-
constraints: {
|
|
148
|
-
maxNumFields: number | null;
|
|
149
|
-
minNumFields: number | null;
|
|
150
|
-
fields?: string[] | undefined;
|
|
151
|
-
};
|
|
152
|
-
meta?: {
|
|
153
|
-
source?: string | undefined;
|
|
154
|
-
} | undefined;
|
|
155
|
-
fields: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
156
|
-
name: string;
|
|
157
|
-
comment?: string | undefined;
|
|
158
|
-
isNullable: boolean;
|
|
159
|
-
isRequired: boolean;
|
|
160
|
-
inputTypes: DMMF.InputTypeRef[];
|
|
161
|
-
deprecation?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
162
|
-
sinceVersion: string;
|
|
163
|
-
reason: string;
|
|
164
|
-
plannedRemovalVersion?: string | undefined;
|
|
165
|
-
}> | undefined;
|
|
166
|
-
}>[];
|
|
167
|
-
}>[];
|
|
168
|
-
};
|
|
169
|
-
outputObjectTypes: {
|
|
170
|
-
model: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
171
|
-
name: string;
|
|
172
|
-
fields: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
173
|
-
name: string;
|
|
174
|
-
isNullable?: boolean | undefined;
|
|
175
|
-
outputType: DMMF.OutputTypeRef;
|
|
176
|
-
args: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
177
|
-
name: string;
|
|
178
|
-
comment?: string | undefined;
|
|
179
|
-
isNullable: boolean;
|
|
180
|
-
isRequired: boolean;
|
|
181
|
-
inputTypes: DMMF.InputTypeRef[];
|
|
182
|
-
deprecation?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
183
|
-
sinceVersion: string;
|
|
184
|
-
reason: string;
|
|
185
|
-
plannedRemovalVersion?: string | undefined;
|
|
186
|
-
}> | undefined;
|
|
187
|
-
}>[];
|
|
188
|
-
deprecation?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
189
|
-
sinceVersion: string;
|
|
190
|
-
reason: string;
|
|
191
|
-
plannedRemovalVersion?: string | undefined;
|
|
192
|
-
}> | undefined;
|
|
193
|
-
documentation?: string | undefined;
|
|
194
|
-
}>[];
|
|
195
|
-
}>[];
|
|
196
|
-
prisma: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
197
|
-
name: string;
|
|
198
|
-
fields: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
199
|
-
name: string;
|
|
200
|
-
isNullable?: boolean | undefined;
|
|
201
|
-
outputType: DMMF.OutputTypeRef;
|
|
202
|
-
args: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
203
|
-
name: string;
|
|
204
|
-
comment?: string | undefined;
|
|
205
|
-
isNullable: boolean;
|
|
206
|
-
isRequired: boolean;
|
|
207
|
-
inputTypes: DMMF.InputTypeRef[];
|
|
208
|
-
deprecation?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
209
|
-
sinceVersion: string;
|
|
210
|
-
reason: string;
|
|
211
|
-
plannedRemovalVersion?: string | undefined;
|
|
212
|
-
}> | undefined;
|
|
213
|
-
}>[];
|
|
214
|
-
deprecation?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
215
|
-
sinceVersion: string;
|
|
216
|
-
reason: string;
|
|
217
|
-
plannedRemovalVersion?: string | undefined;
|
|
218
|
-
}> | undefined;
|
|
219
|
-
documentation?: string | undefined;
|
|
220
|
-
}>[];
|
|
221
|
-
}>[];
|
|
222
|
-
};
|
|
223
|
-
enumTypes: {
|
|
224
|
-
model?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
225
|
-
name: string;
|
|
226
|
-
values: string[];
|
|
227
|
-
}>[] | undefined;
|
|
228
|
-
prisma: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
229
|
-
name: string;
|
|
230
|
-
values: string[];
|
|
231
|
-
}>[];
|
|
232
|
-
};
|
|
233
|
-
fieldRefTypes: {
|
|
234
|
-
prisma?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
235
|
-
name: string;
|
|
236
|
-
allowTypes: DMMF.FieldRefAllowType[];
|
|
237
|
-
fields: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
238
|
-
name: string;
|
|
239
|
-
comment?: string | undefined;
|
|
240
|
-
isNullable: boolean;
|
|
241
|
-
isRequired: boolean;
|
|
242
|
-
inputTypes: DMMF.InputTypeRef[];
|
|
243
|
-
deprecation?: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
244
|
-
sinceVersion: string;
|
|
245
|
-
reason: string;
|
|
246
|
-
plannedRemovalVersion?: string | undefined;
|
|
247
|
-
}> | undefined;
|
|
248
|
-
}>[];
|
|
249
|
-
}>[] | undefined;
|
|
250
|
-
};
|
|
251
|
-
}>;
|
|
252
|
-
mappings: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
253
|
-
modelOperations: import("@prisma/generator-helper").ReadonlyDeep<{
|
|
254
|
-
model: string;
|
|
255
|
-
plural: string;
|
|
256
|
-
findUnique?: string | null | undefined;
|
|
257
|
-
findUniqueOrThrow?: string | null | undefined;
|
|
258
|
-
findFirst?: string | null | undefined;
|
|
259
|
-
findFirstOrThrow?: string | null | undefined;
|
|
260
|
-
findMany?: string | null | undefined;
|
|
261
|
-
create?: string | null | undefined;
|
|
262
|
-
createMany?: string | null | undefined;
|
|
263
|
-
createManyAndReturn?: string | null | undefined;
|
|
264
|
-
update?: string | null | undefined;
|
|
265
|
-
updateMany?: string | null | undefined;
|
|
266
|
-
upsert?: string | null | undefined;
|
|
267
|
-
delete?: string | null | undefined;
|
|
268
|
-
deleteMany?: string | null | undefined;
|
|
269
|
-
aggregate?: string | null | undefined;
|
|
270
|
-
groupBy?: string | null | undefined;
|
|
271
|
-
count?: string | null | undefined;
|
|
272
|
-
findRaw?: string | null | undefined;
|
|
273
|
-
aggregateRaw?: string | null | undefined;
|
|
274
|
-
}>[];
|
|
275
|
-
otherOperations: {
|
|
276
|
-
read: string[];
|
|
277
|
-
write: string[];
|
|
278
|
-
};
|
|
279
|
-
}>;
|
|
280
|
-
}>>;
|
|
281
|
-
export declare function fetchGenerator(schemaPath?: string): Promise<Generator>;
|
|
282
|
-
export declare function getProvider(generator: Generator): import("@prisma/generator-helper").ActiveConnectorType | undefined;
|
|
15
|
+
// export async function fetchGenerator(schemaPath?: string) {
|
|
16
|
+
// const pathToModule = schemaPath ?? require.resolve(path.resolve(process.cwd(), 'prisma/schema.prisma'));
|
|
17
|
+
// const config = await generateConfig(pathToModule);
|
|
18
|
+
// return getGenerator({
|
|
19
|
+
// schemaPath: pathToModule,
|
|
20
|
+
// });
|
|
21
|
+
// }
|
|
22
|
+
export declare function fetchProvider(schemaPath?: string): Promise<string>;
|
|
23
|
+
export declare function getProvider(generator: Generator): import("@prisma/generator").ActiveConnectorType | undefined;
|
|
283
24
|
export declare function generatePrismock<T = PrismaClient>(options?: Options): Promise<PrismockClientType<T>>;
|
|
284
25
|
export declare function generatePrismockSync<T = PrismockClientType>(options: OptionsSync): PrismockClientType<T>;
|
|
285
26
|
export declare function generateDelegates(options: OptionsSync): {
|
|
286
27
|
delegates: Delegates;
|
|
287
|
-
getData: () => Data
|
|
288
|
-
setData: (d: Data) => void
|
|
28
|
+
getData: () => Promise<Data>;
|
|
29
|
+
setData: (d: Data) => Promise<void>;
|
|
289
30
|
};
|
|
290
31
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pkgverse/prismock",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1-beta.1",
|
|
4
4
|
"description": "A mock for PrismaClient, dedicated to unit testing.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/JQuezada0/prismock"
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@commitlint/cli": "19.8.1",
|
|
45
45
|
"@commitlint/config-conventional": "19.8.1",
|
|
46
|
-
"@
|
|
46
|
+
"@electric-sql/pglite": "0.3.14",
|
|
47
|
+
"@prisma/client": "6.10.0",
|
|
47
48
|
"@semantic-release/changelog": "6.0.3",
|
|
48
49
|
"@semantic-release/commit-analyzer": "13.0.1",
|
|
49
50
|
"@semantic-release/git": "10.0.1",
|
|
@@ -72,8 +73,9 @@
|
|
|
72
73
|
"fs-jetpack": "5.1.0",
|
|
73
74
|
"husky": "9.1.7",
|
|
74
75
|
"lint-staged": "16.1.6",
|
|
76
|
+
"pglite-prisma-adapter": "0.6.1",
|
|
75
77
|
"prettier": "2.8.8",
|
|
76
|
-
"prisma": "
|
|
78
|
+
"prisma": "6.10.0",
|
|
77
79
|
"release-it": "19.0.6",
|
|
78
80
|
"semantic-release": "24.2.7",
|
|
79
81
|
"ts-node": "10.9.2",
|
|
@@ -101,12 +103,12 @@
|
|
|
101
103
|
},
|
|
102
104
|
"dependencies": {
|
|
103
105
|
"@paralleldrive/cuid2": "2.2.2",
|
|
104
|
-
"@prisma/generator-helper": "
|
|
105
|
-
"@prisma/internals": "
|
|
106
|
+
"@prisma/generator-helper": "6.10.0",
|
|
107
|
+
"@prisma/internals": "6.10.0",
|
|
106
108
|
"bson": "6.10.4"
|
|
107
109
|
},
|
|
108
110
|
"peerDependencies": {
|
|
109
|
-
"@prisma/client": "
|
|
110
|
-
"prisma": "
|
|
111
|
+
"@prisma/client": ">= 6.10.0",
|
|
112
|
+
"prisma": ">= 6.10.0"
|
|
111
113
|
}
|
|
112
114
|
}
|