@forklaunch/core 0.9.4 → 0.9.6
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,8 +1,8 @@
|
|
1
1
|
import { AnySchemaValidator, UnboxedObjectSchema, SchemaValidator, Schema } from '@forklaunch/validator';
|
2
|
-
import { EntityManager } from '@mikro-orm/core';
|
3
2
|
import { TypeboxSchemaValidator } from '@forklaunch/validator/typebox';
|
4
3
|
import { ZodSchemaValidator } from '@forklaunch/validator/zod';
|
5
4
|
import { InstanceTypeRecord } from '@forklaunch/common';
|
5
|
+
import { EntityManager } from '@mikro-orm/core';
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Interface representing a constructor for an entity mapper.
|
@@ -47,7 +47,7 @@ type ResponseDtoMapperConstructor<SchemaValidator extends AnySchemaValidator, Dt
|
|
47
47
|
* @template Dto - The type of the DTO object.
|
48
48
|
* @template Entity - The type of the entity object.
|
49
49
|
*/
|
50
|
-
type RequestDtoMapperConstructor<SchemaValidator extends AnySchemaValidator, Dto, Entity, DeserializeDtoToEntity = unknown> = new (schemaValidator: SchemaValidator
|
50
|
+
type RequestDtoMapperConstructor<SchemaValidator extends AnySchemaValidator, Dto, Entity, DeserializeDtoToEntity = unknown> = new (schemaValidator: SchemaValidator) => {
|
51
51
|
dto: Dto;
|
52
52
|
_Entity: Entity;
|
53
53
|
deserializeDtoToEntity: DeserializeDtoToEntity;
|
@@ -266,7 +266,7 @@ type InternalDtoMapper<DtoMapper extends Record<string, {
|
|
266
266
|
_Entity: unknown;
|
267
267
|
deserializeDtoToEntity: unknown;
|
268
268
|
} ? {
|
269
|
-
deserializeDtoToEntity: (dto: Dto[K], ...additionalArgs: AllAfterFirstParameters<DtoMapper[K]['deserializeDtoToEntity']>) => Promise<Entities[K]>;
|
269
|
+
deserializeDtoToEntity: (dto: Dto[K], em: EntityManager, ...additionalArgs: AllAfterFirstParameters<DtoMapper[K]['deserializeDtoToEntity']>) => Promise<Entities[K]>;
|
270
270
|
} : never;
|
271
271
|
};
|
272
272
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { AnySchemaValidator, UnboxedObjectSchema, SchemaValidator, Schema } from '@forklaunch/validator';
|
2
|
-
import { EntityManager } from '@mikro-orm/core';
|
3
2
|
import { TypeboxSchemaValidator } from '@forklaunch/validator/typebox';
|
4
3
|
import { ZodSchemaValidator } from '@forklaunch/validator/zod';
|
5
4
|
import { InstanceTypeRecord } from '@forklaunch/common';
|
5
|
+
import { EntityManager } from '@mikro-orm/core';
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Interface representing a constructor for an entity mapper.
|
@@ -47,7 +47,7 @@ type ResponseDtoMapperConstructor<SchemaValidator extends AnySchemaValidator, Dt
|
|
47
47
|
* @template Dto - The type of the DTO object.
|
48
48
|
* @template Entity - The type of the entity object.
|
49
49
|
*/
|
50
|
-
type RequestDtoMapperConstructor<SchemaValidator extends AnySchemaValidator, Dto, Entity, DeserializeDtoToEntity = unknown> = new (schemaValidator: SchemaValidator
|
50
|
+
type RequestDtoMapperConstructor<SchemaValidator extends AnySchemaValidator, Dto, Entity, DeserializeDtoToEntity = unknown> = new (schemaValidator: SchemaValidator) => {
|
51
51
|
dto: Dto;
|
52
52
|
_Entity: Entity;
|
53
53
|
deserializeDtoToEntity: DeserializeDtoToEntity;
|
@@ -266,7 +266,7 @@ type InternalDtoMapper<DtoMapper extends Record<string, {
|
|
266
266
|
_Entity: unknown;
|
267
267
|
deserializeDtoToEntity: unknown;
|
268
268
|
} ? {
|
269
|
-
deserializeDtoToEntity: (dto: Dto[K], ...additionalArgs: AllAfterFirstParameters<DtoMapper[K]['deserializeDtoToEntity']>) => Promise<Entities[K]>;
|
269
|
+
deserializeDtoToEntity: (dto: Dto[K], em: EntityManager, ...additionalArgs: AllAfterFirstParameters<DtoMapper[K]['deserializeDtoToEntity']>) => Promise<Entities[K]>;
|
270
270
|
} : never;
|
271
271
|
};
|
272
272
|
|