@pkgverse/prismock 2.0.5-beta.3 → 2.0.5

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.
@@ -1,7 +1,6 @@
1
1
  import type { PrismaClient } from "@prisma/client";
2
+ import type { DMMF } from "@prisma/generator-helper-v7";
2
3
  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';
5
4
  import { Data } from "./prismock";
6
5
  import { type ExtensionsDefinition } from "./extensions";
7
6
  import type { PGlite } from "@electric-sql/pglite";
@@ -22,7 +21,7 @@ export type PrismockOptions = {
22
21
  };
23
22
  export declare class Prismock {
24
23
  schemaPath: string;
25
- datamodel?: DMMFV7.Document | DMMFV6.Document;
24
+ datamodel?: DMMF.Document;
26
25
  PrismaDMMF?: PrismaDMMF;
27
26
  private genPromise;
28
27
  protected constructor(schemaPath: string);
@@ -45,7 +44,7 @@ export declare function getPgLitePrismockData(options: {
45
44
  schemaPath: string;
46
45
  pglite: InstanceType<typeof PGlite>;
47
46
  adapter: InstanceType<typeof PrismaPGlite>;
48
- datamodel: DMMFV7.Document | DMMFV6.Document;
47
+ datamodel: DMMF.Document;
49
48
  prismaClient: Record<string, any>;
50
49
  }): {
51
50
  reset: () => Promise<void>;
@@ -1,5 +1,4 @@
1
- import type { DMMF as DMMFV7 } from '@prisma/generator-helper-v7';
2
- import type { DMMF as DMMFV6 } from '@prisma/generator-helper-v6';
1
+ import type { DMMF } from '@prisma/generator-helper-v7';
3
2
  import type { ConfigMetaFormat } from '@prisma/internals/dist/engine-commands/getConfig';
4
- export declare function generateDMMF(schemaPath?: string): Promise<DMMFV7.Document | DMMFV6.Document>;
3
+ export declare function generateDMMF(schemaPath?: string): Promise<DMMF.Document>;
5
4
  export declare function generateConfig(schemaPath: string): Promise<ConfigMetaFormat>;
@@ -3,9 +3,8 @@ 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';
6
7
  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';
9
8
  export { applyModelExtensions, applyQueryExtensions, applyResultExtensions };
10
9
  export type ExtensionsDefinition = Parameters<ExtendsHook<"define", Prisma.TypeMapCb, DefaultArgs>>[0];
11
- export declare function applyExtensions(client: PrismaClient, extensions: ExtensionsDefinition, datamodel: DMMFV7.Document | DMMFV6.Document, PrismaDMMF: PrismaDMMF): PrismaClient<Prisma.PrismaClientOptions, never, DefaultArgs>;
10
+ export declare function applyExtensions(client: PrismaClient, extensions: ExtensionsDefinition, datamodel: DMMF.Document, PrismaDMMF: PrismaDMMF): PrismaClient<Prisma.PrismaClientOptions, never, DefaultArgs>;
@@ -1,6 +1,5 @@
1
1
  import type { Prisma, PrismaClient } from "@prisma/client";
2
2
  import type { DefaultArgs, ExtendsHook } 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";
3
+ import type { DMMF } from "@prisma/generator-helper-v7";
5
4
  import type { PrismaDMMF } from "../globals";
6
- export declare function applyResultExtensions(client: PrismaClient, extensions: Parameters<ExtendsHook<"define", Prisma.TypeMapCb, DefaultArgs>>[0], datamodel: DMMFV7.Document | DMMFV6.Document, PrismaDMMF: PrismaDMMF): PrismaClient;
5
+ export declare function applyResultExtensions(client: PrismaClient, extensions: Parameters<ExtendsHook<"define", Prisma.TypeMapCb, DefaultArgs>>[0], datamodel: DMMF.Document, PrismaDMMF: PrismaDMMF): PrismaClient;
package/dist/v7/index.mjs CHANGED
@@ -3234,7 +3234,19 @@ var init_dist = __esm(() => {
3234
3234
  function datamodelEnumToSchemaEnum(datamodelEnum) {
3235
3235
  return {
3236
3236
  name: datamodelEnum.name,
3237
- values: datamodelEnum.values.map((v) => v.name)
3237
+ data: datamodelEnum.values.map((v) => ({
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
+ }))
3238
3250
  };
3239
3251
  }
3240
3252
  var init_convert = () => {};
@@ -3272,6 +3284,7 @@ var init_util = () => {};
3272
3284
  // node_modules/@prisma/dmmf-v7/dist/index.mjs
3273
3285
  var exports_dist2 = {};
3274
3286
  __export(exports_dist2, {
3287
+ datamodelSchemaEnumToSchemaEnum: () => datamodelSchemaEnumToSchemaEnum,
3275
3288
  datamodelEnumToSchemaEnum: () => datamodelEnumToSchemaEnum,
3276
3289
  ModelAction: () => ModelAction
3277
3290
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkgverse/prismock",
3
- "version": "2.0.5-beta.3",
3
+ "version": "2.0.5",
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.4.0",
109
+ "@prisma/client-runtime-utils": "npm:@prisma/client-runtime-utils@7.1.0",
110
110
  "@prisma/dmmf-v6": "npm:@prisma/dmmf@6.12.0",
111
- "@prisma/dmmf-v7": "npm:@prisma/dmmf@7.4.0",
111
+ "@prisma/dmmf-v7": "npm:@prisma/dmmf@7.1.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.4.0",
115
- "@prisma/internals": "7.4.0",
114
+ "@prisma/generator-helper-v7": "npm:@prisma/generator-helper@7.1.0",
115
+ "@prisma/internals": "7.1.0",
116
116
  "@prisma/internals-v6": "npm:@prisma/internals@6.12.0",
117
- "@prisma/internals-v7": "npm:@prisma/internals@7.4.0",
117
+ "@prisma/internals-v7": "npm:@prisma/internals@7.1.0",
118
118
  "bson": "6.10.4",
119
119
  "pglite-prisma-adapter": "0.6.1"
120
120
  },