@pkgverse/prismock 2.0.5-beta.2 → 2.0.5-beta.4
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/lib/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PrismaClient } from "@prisma/client";
|
|
2
|
-
import type { DMMF } from "@prisma/generator-helper-v7";
|
|
3
2
|
import type * as runtime from "@prisma/client/runtime/library";
|
|
3
|
+
import type { DMMF as DMMFV7 } from '@prisma/generator-helper-v7';
|
|
4
|
+
import type { DMMF as DMMFV6 } from '@prisma/generator-helper-v6';
|
|
4
5
|
import { Data } from "./prismock";
|
|
5
6
|
import { type ExtensionsDefinition } from "./extensions";
|
|
6
7
|
import type { PGlite } from "@electric-sql/pglite";
|
|
@@ -21,7 +22,7 @@ export type PrismockOptions = {
|
|
|
21
22
|
};
|
|
22
23
|
export declare class Prismock {
|
|
23
24
|
schemaPath: string;
|
|
24
|
-
datamodel?:
|
|
25
|
+
datamodel?: DMMFV7.Document | DMMFV6.Document;
|
|
25
26
|
PrismaDMMF?: PrismaDMMF;
|
|
26
27
|
private genPromise;
|
|
27
28
|
protected constructor(schemaPath: string);
|
|
@@ -44,7 +45,7 @@ export declare function getPgLitePrismockData(options: {
|
|
|
44
45
|
schemaPath: string;
|
|
45
46
|
pglite: InstanceType<typeof PGlite>;
|
|
46
47
|
adapter: InstanceType<typeof PrismaPGlite>;
|
|
47
|
-
datamodel:
|
|
48
|
+
datamodel: DMMFV7.Document | DMMFV6.Document;
|
|
48
49
|
prismaClient: Record<string, any>;
|
|
49
50
|
}): {
|
|
50
51
|
reset: () => Promise<void>;
|
package/dist/lib/dmmf.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DMMF } from '@prisma/generator-helper-v7';
|
|
1
|
+
import type { DMMF as DMMFV7 } from '@prisma/generator-helper-v7';
|
|
2
|
+
import type { DMMF as DMMFV6 } from '@prisma/generator-helper-v6';
|
|
2
3
|
import type { ConfigMetaFormat } from '@prisma/internals/dist/engine-commands/getConfig';
|
|
3
|
-
export declare function generateDMMF(schemaPath?: string): Promise<
|
|
4
|
+
export declare function generateDMMF(schemaPath?: string): Promise<DMMFV7.Document | DMMFV6.Document>;
|
|
4
5
|
export declare function generateConfig(schemaPath: string): Promise<ConfigMetaFormat>;
|
|
@@ -3,8 +3,9 @@ import { applyModelExtensions } from './model';
|
|
|
3
3
|
import { applyQueryExtensions } from './query';
|
|
4
4
|
import { applyResultExtensions } from './result';
|
|
5
5
|
import type { ExtendsHook, DefaultArgs } from '@prisma/client/runtime/library';
|
|
6
|
-
import type { DMMF } from '@prisma/generator-helper-v7';
|
|
7
6
|
import type { PrismaDMMF } from '../globals';
|
|
7
|
+
import type { DMMF as DMMFV7 } from '@prisma/generator-helper-v7';
|
|
8
|
+
import type { DMMF as DMMFV6 } from '@prisma/generator-helper-v6';
|
|
8
9
|
export { applyModelExtensions, applyQueryExtensions, applyResultExtensions };
|
|
9
10
|
export type ExtensionsDefinition = Parameters<ExtendsHook<"define", Prisma.TypeMapCb, DefaultArgs>>[0];
|
|
10
|
-
export declare function applyExtensions(client: PrismaClient, extensions: ExtensionsDefinition, datamodel:
|
|
11
|
+
export declare function applyExtensions(client: PrismaClient, extensions: ExtensionsDefinition, datamodel: DMMFV7.Document | DMMFV6.Document, PrismaDMMF: PrismaDMMF): PrismaClient<Prisma.PrismaClientOptions, never, DefaultArgs>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Prisma, PrismaClient } from "@prisma/client";
|
|
2
2
|
import type { DefaultArgs, ExtendsHook } from "@prisma/client/runtime/library";
|
|
3
|
-
import type { DMMF } from "@prisma/generator-helper-v7";
|
|
3
|
+
import type { DMMF as DMMFV7 } from "@prisma/generator-helper-v7";
|
|
4
|
+
import type { DMMF as DMMFV6 } from "@prisma/generator-helper-v6";
|
|
4
5
|
import type { PrismaDMMF } from "../globals";
|
|
5
|
-
export declare function applyResultExtensions(client: PrismaClient, extensions: Parameters<ExtendsHook<"define", Prisma.TypeMapCb, DefaultArgs>>[0], datamodel:
|
|
6
|
+
export declare function applyResultExtensions(client: PrismaClient, extensions: Parameters<ExtendsHook<"define", Prisma.TypeMapCb, DefaultArgs>>[0], datamodel: DMMFV7.Document | DMMFV6.Document, PrismaDMMF: PrismaDMMF): PrismaClient;
|
package/dist/v7/index.mjs
CHANGED
|
@@ -3234,19 +3234,7 @@ var init_dist = __esm(() => {
|
|
|
3234
3234
|
function datamodelEnumToSchemaEnum(datamodelEnum) {
|
|
3235
3235
|
return {
|
|
3236
3236
|
name: datamodelEnum.name,
|
|
3237
|
-
|
|
3238
|
-
key: v.name,
|
|
3239
|
-
value: v.dbName ?? v.name
|
|
3240
|
-
}))
|
|
3241
|
-
};
|
|
3242
|
-
}
|
|
3243
|
-
function datamodelSchemaEnumToSchemaEnum(datamodelSchemaEnum) {
|
|
3244
|
-
return {
|
|
3245
|
-
name: datamodelSchemaEnum.name,
|
|
3246
|
-
data: datamodelSchemaEnum.values.map((v) => ({
|
|
3247
|
-
key: v,
|
|
3248
|
-
value: v
|
|
3249
|
-
}))
|
|
3237
|
+
values: datamodelEnum.values.map((v) => v.name)
|
|
3250
3238
|
};
|
|
3251
3239
|
}
|
|
3252
3240
|
var init_convert = () => {};
|
|
@@ -3284,7 +3272,6 @@ var init_util = () => {};
|
|
|
3284
3272
|
// node_modules/@prisma/dmmf-v7/dist/index.mjs
|
|
3285
3273
|
var exports_dist2 = {};
|
|
3286
3274
|
__export(exports_dist2, {
|
|
3287
|
-
datamodelSchemaEnumToSchemaEnum: () => datamodelSchemaEnumToSchemaEnum,
|
|
3288
3275
|
datamodelEnumToSchemaEnum: () => datamodelEnumToSchemaEnum,
|
|
3289
3276
|
ModelAction: () => ModelAction
|
|
3290
3277
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pkgverse/prismock",
|
|
3
|
-
"version": "2.0.5-beta.
|
|
3
|
+
"version": "2.0.5-beta.4",
|
|
4
4
|
"description": "An in-memory implementation of PrismaClient, dedicated to unit testing.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/JQuezada0/prismock"
|
|
@@ -106,15 +106,15 @@
|
|
|
106
106
|
"dependencies": {
|
|
107
107
|
"@electric-sql/pglite": "0.3.14",
|
|
108
108
|
"@paralleldrive/cuid2": "2.2.2",
|
|
109
|
-
"@prisma/client-runtime-utils": "npm:@prisma/client-runtime-utils@7.
|
|
109
|
+
"@prisma/client-runtime-utils": "npm:@prisma/client-runtime-utils@7.4.0",
|
|
110
110
|
"@prisma/dmmf-v6": "npm:@prisma/dmmf@6.12.0",
|
|
111
|
-
"@prisma/dmmf-v7": "npm:@prisma/dmmf@7.
|
|
111
|
+
"@prisma/dmmf-v7": "npm:@prisma/dmmf@7.4.0",
|
|
112
112
|
"@prisma/generator-helper": "6.12.0",
|
|
113
113
|
"@prisma/generator-helper-v6": "npm:@prisma/generator-helper@6.12.0",
|
|
114
|
-
"@prisma/generator-helper-v7": "npm:@prisma/generator-helper@7.
|
|
115
|
-
"@prisma/internals": "7.
|
|
114
|
+
"@prisma/generator-helper-v7": "npm:@prisma/generator-helper@7.4.0",
|
|
115
|
+
"@prisma/internals": "7.4.0",
|
|
116
116
|
"@prisma/internals-v6": "npm:@prisma/internals@6.12.0",
|
|
117
|
-
"@prisma/internals-v7": "npm:@prisma/internals@7.
|
|
117
|
+
"@prisma/internals-v7": "npm:@prisma/internals@7.4.0",
|
|
118
118
|
"bson": "6.10.4",
|
|
119
119
|
"pglite-prisma-adapter": "0.6.1"
|
|
120
120
|
},
|