@punks/backend-entity-manager 0.0.139 → 0.0.141
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/cjs/index.js +46 -46
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/commands.d.ts +9 -0
- package/dist/cjs/types/abstractions/index.d.ts +1 -1
- package/dist/cjs/types/abstractions/manager.d.ts +2 -1
- package/dist/cjs/types/commands/version.d.ts +7 -0
- package/dist/cjs/types/concrete/index.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/__test__/server/database/core/entities/foo.entity.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/__test__/server/entities/foos/foo.snapshot.d.ts +3 -3
- package/dist/cjs/types/platforms/nest/base/entitySnapshotService.d.ts +1 -1
- package/dist/cjs/types/providers/services.d.ts +4 -1
- package/dist/cjs/types/symbols/ioc.d.ts +1 -0
- package/dist/esm/index.js +46 -46
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/commands.d.ts +9 -0
- package/dist/esm/types/abstractions/index.d.ts +1 -1
- package/dist/esm/types/abstractions/manager.d.ts +2 -1
- package/dist/esm/types/commands/version.d.ts +7 -0
- package/dist/esm/types/concrete/index.d.ts +2 -1
- package/dist/esm/types/platforms/nest/__test__/server/database/core/entities/foo.entity.d.ts +2 -1
- package/dist/esm/types/platforms/nest/__test__/server/entities/foos/foo.snapshot.d.ts +3 -3
- package/dist/esm/types/platforms/nest/base/entitySnapshotService.d.ts +1 -1
- package/dist/esm/types/providers/services.d.ts +4 -1
- package/dist/esm/types/symbols/ioc.d.ts +1 -0
- package/dist/index.d.ts +41 -29
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { SortingType } from "./common";
|
|
|
2
2
|
import { EntitiesExportInput, EntitiesExportResult, EntitiesSampleDownloadOptions, EntitiesSampleDownloadResult } from "./export";
|
|
3
3
|
import { EntitiesImportInput, EntitiesImportResult } from "./import";
|
|
4
4
|
import { IEntitySearchParameters, ISearchFilters, ISearchSorting } from "./searchParameters";
|
|
5
|
+
import { EntityVersionOperation } from "./versioning";
|
|
5
6
|
export interface IEntityCreateCommand<TEntity, TEntityCreateData> {
|
|
6
7
|
execute(input: TEntityCreateData): Promise<TEntity>;
|
|
7
8
|
}
|
|
@@ -14,6 +15,14 @@ export interface IEntityUpsertCommand<TEntity, TEntityId, TEntityUpdateData> {
|
|
|
14
15
|
export interface IEntityDeleteCommand<TEntity, TEntityId> {
|
|
15
16
|
execute(id: TEntityId): Promise<void>;
|
|
16
17
|
}
|
|
18
|
+
export type EntityVersionCommandInput<TEntity, TEntityId> = {
|
|
19
|
+
operation: EntityVersionOperation;
|
|
20
|
+
id: TEntityId;
|
|
21
|
+
entity?: TEntity;
|
|
22
|
+
};
|
|
23
|
+
export interface IEntityVersionCommand<TEntity, TEntityId> {
|
|
24
|
+
execute(input: EntityVersionCommandInput<TEntity, TEntityId>): Promise<void>;
|
|
25
|
+
}
|
|
17
26
|
export interface IEntitiesDeleteParameters<TSorting> {
|
|
18
27
|
filters?: ISearchFilters;
|
|
19
28
|
sorting?: ISearchSorting<TSorting>;
|
|
@@ -3,7 +3,7 @@ export { IEntityAdapter } from "./adapters";
|
|
|
3
3
|
export * from "./authentication";
|
|
4
4
|
export * from "./buckets";
|
|
5
5
|
export { IAuthorizationResult, IEntityAuthorizationMiddleware, } from "./authorization";
|
|
6
|
-
export { IEntityCreateCommand, IEntityUpdateCommand, IEntityUpsertCommand, IEntityDeleteCommand, IEntitiesImportCommand, IEntitiesExportCommand, IEntitiesDeleteParameters, IEntitiesDeleteCommand, IEntitiesDeleteResult, IEntitiesSampleDownloadCommand, } from "./commands";
|
|
6
|
+
export { IEntityCreateCommand, IEntityUpdateCommand, IEntityUpsertCommand, IEntityDeleteCommand, IEntityVersionCommand, IEntitiesImportCommand, IEntitiesExportCommand, IEntitiesDeleteParameters, IEntitiesDeleteCommand, IEntitiesDeleteResult, IEntitiesSampleDownloadCommand, } from "./commands";
|
|
7
7
|
export { SortingType, ClassType, EnumType } from "./common";
|
|
8
8
|
export { IEntityManagerServiceRoot, IEntityManagerServiceCollection, } from "./configuration";
|
|
9
9
|
export { IEntityConverter } from "./converters";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntitiesDeleteCommand, IEntitiesDeleteParameters, IEntitiesExportCommand, IEntitiesImportCommand, IEntitiesSampleDownloadCommand, IEntityCreateCommand, IEntityDeleteCommand, IEntityUpdateCommand, IEntityUpsertCommand } from "./commands";
|
|
1
|
+
import { IEntitiesDeleteCommand, IEntitiesDeleteParameters, IEntitiesExportCommand, IEntitiesImportCommand, IEntitiesSampleDownloadCommand, IEntityCreateCommand, IEntityDeleteCommand, IEntityUpdateCommand, IEntityUpsertCommand, IEntityVersionCommand } from "./commands";
|
|
2
2
|
import { SortingType } from "./common";
|
|
3
3
|
import { IEntitiesCountQuery, IEntitiesFindQuery, IEntitiesSearchQuery, IEntityExistsQuery, IEntityGetQuery, IEntityVersionsSearchQuery } from "./queries";
|
|
4
4
|
import { IEntitySearchParameters } from "./searchParameters";
|
|
@@ -9,6 +9,7 @@ export interface IEntityManager<TEntity, TEntityId, TEntityCreateData, TEntityUp
|
|
|
9
9
|
get find(): IEntitiesFindQuery<TEntity, TEntitySearchParameters, TSorting, TCursor>;
|
|
10
10
|
get exists(): IEntityExistsQuery<TEntity, NonNullable<TEntitySearchParameters["filters"]>>;
|
|
11
11
|
get count(): IEntitiesCountQuery<TEntity, NonNullable<TEntitySearchParameters["filters"]>>;
|
|
12
|
+
get version(): IEntityVersionCommand<TEntity, TEntityId>;
|
|
12
13
|
get create(): IEntityCreateCommand<TEntity, TEntityCreateData>;
|
|
13
14
|
get update(): IEntityUpdateCommand<TEntity, TEntityId, TEntityUpdateData>;
|
|
14
15
|
get upsert(): IEntityUpsertCommand<TEntity, TEntityId, TEntityUpdateData>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityVersionCommandInput, IEntityVersionCommand } from "../abstractions/commands";
|
|
2
|
+
import { EntityServiceLocator } from "../providers/services";
|
|
3
|
+
export declare class EntityVersionCommand<TEntity, TEntityId> implements IEntityVersionCommand<TEntity, TEntityId> {
|
|
4
|
+
private readonly services;
|
|
5
|
+
constructor(services: EntityServiceLocator<TEntity, TEntityId>);
|
|
6
|
+
execute({ id, operation, entity, }: EntityVersionCommandInput<TEntity, TEntityId>): Promise<void>;
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IEntitiesCountAction, IEntitiesDeleteAction, IEntitiesExportAction, IEntitiesImportAction, IEntitiesSampleDownloadAction, IEntitiesSearchAction, IEntityActions, IEntityCreateAction, IEntityDeleteAction, IEntityExistsAction, IEntityGetAction, IEntityUpdateAction, IEntityUpsertAction, IEntityVersionsSearchAction } from "../abstractions/actions";
|
|
2
|
-
import { IEntitiesDeleteCommand, IEntitiesDeleteParameters, IEntitiesExportCommand, IEntitiesImportCommand, IEntitiesSampleDownloadCommand, IEntityCreateCommand, IEntityDeleteCommand, IEntityUpdateCommand, IEntityUpsertCommand } from "../abstractions/commands";
|
|
2
|
+
import { IEntitiesDeleteCommand, IEntitiesDeleteParameters, IEntitiesExportCommand, IEntitiesImportCommand, IEntitiesSampleDownloadCommand, IEntityCreateCommand, IEntityDeleteCommand, IEntityUpdateCommand, IEntityUpsertCommand, IEntityVersionCommand } from "../abstractions/commands";
|
|
3
3
|
import { SortingType } from "../abstractions/common";
|
|
4
4
|
import { IEntityManager } from "../abstractions/manager";
|
|
5
5
|
import { IEntitiesCountQuery, IEntitiesFindQuery, IEntitiesSearchQuery, IEntityExistsQuery, IEntityGetQuery, IEntityVersionsSearchQuery } from "../abstractions/queries";
|
|
@@ -15,6 +15,7 @@ export declare class EntityManager<TEntity, TEntityId, TEntityCreateData, TEntit
|
|
|
15
15
|
get get(): IEntityGetQuery<TEntity, TEntityId>;
|
|
16
16
|
get search(): IEntitiesSearchQuery<TEntity, TEntitySearchParameters, TSorting, TCursor, TFacets>;
|
|
17
17
|
get find(): IEntitiesFindQuery<TEntity, TEntitySearchParameters, TSorting, TCursor>;
|
|
18
|
+
get version(): IEntityVersionCommand<TEntity, TEntityId>;
|
|
18
19
|
get create(): IEntityCreateCommand<TEntity, TEntityCreateData>;
|
|
19
20
|
get update(): IEntityUpdateCommand<TEntity, TEntityId, TEntityUpdateData>;
|
|
20
21
|
get upsert(): IEntityUpsertCommand<TEntity, TEntityId, TEntityUpdateData>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EntityManagerRegistry } from "../../../../../..";
|
|
2
2
|
import { NestEntitySnapshotService } from "../../../../base/entitySnapshotService";
|
|
3
|
-
import { FooEntity } from "../../database/core/entities/foo.entity";
|
|
3
|
+
import { FooEntity, FooEntityId } from "../../database/core/entities/foo.entity";
|
|
4
4
|
import { FooRepository } from "../../database/core/repositories/foo.repository";
|
|
5
|
-
export declare class FooEntitySnapshotService extends NestEntitySnapshotService<FooEntity,
|
|
5
|
+
export declare class FooEntitySnapshotService extends NestEntitySnapshotService<FooEntity, FooEntityId, FooRepository, FooEntity> {
|
|
6
6
|
constructor(registry: EntityManagerRegistry);
|
|
7
|
-
getSnapshot(id:
|
|
7
|
+
getSnapshot(id: FooEntityId): Promise<FooEntity>;
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EntitySnapshotService } from "../../../base/snapshot";
|
|
2
2
|
import { EntityServiceLocator } from "../../../providers/services";
|
|
3
3
|
import { EntityManagerRegistry } from "../ioc";
|
|
4
|
-
export declare abstract class NestEntitySnapshotService<TEntity, TEntityId, TEntityRepository> extends EntitySnapshotService<
|
|
4
|
+
export declare abstract class NestEntitySnapshotService<TEntity, TEntityId, TEntityRepository, TEntitySnapshot> extends EntitySnapshotService<TEntityId, TEntitySnapshot> {
|
|
5
5
|
protected readonly services: EntityServiceLocator<TEntity, unknown>;
|
|
6
6
|
constructor(entityName: string, registry: EntityManagerRegistry);
|
|
7
7
|
get repository(): TEntityRepository;
|
|
@@ -2,7 +2,7 @@ import { IAuthenticationContext, IAuthenticationContextProvider, IBucketProvider
|
|
|
2
2
|
import { IEntitiesCountAction, IEntitiesDeleteAction, IEntitiesExportAction, IEntitiesImportAction, IEntitiesSampleDownloadAction, IEntitiesSearchAction, IEntityActions, IEntityCreateAction, IEntityDeleteAction, IEntityExistsAction, IEntityGetAction, IEntityUpdateAction, IEntityUpsertAction, IEntityVersionsSearchAction } from "../abstractions/actions";
|
|
3
3
|
import { IEntityAdapter } from "../abstractions/adapters";
|
|
4
4
|
import { IEntityAuthorizationMiddleware } from "../abstractions/authorization";
|
|
5
|
-
import { IEntitiesDeleteCommand, IEntitiesDeleteParameters, IEntitiesExportCommand, IEntitiesImportCommand, IEntitiesSampleDownloadCommand, IEntityCreateCommand, IEntityDeleteCommand, IEntityUpdateCommand, IEntityUpsertCommand } from "../abstractions/commands";
|
|
5
|
+
import { IEntitiesDeleteCommand, IEntitiesDeleteParameters, IEntitiesExportCommand, IEntitiesImportCommand, IEntitiesSampleDownloadCommand, IEntityCreateCommand, IEntityDeleteCommand, IEntityUpdateCommand, IEntityUpsertCommand, IEntityVersionCommand } from "../abstractions/commands";
|
|
6
6
|
import { SortingType } from "../abstractions/common";
|
|
7
7
|
import { IConnectorsConfiguration, IEntityConnectorDeleteManager, IEntityConnectorSyncManager } from "../abstractions/connectors";
|
|
8
8
|
import { IEntityConverter } from "../abstractions/converters";
|
|
@@ -49,6 +49,7 @@ export declare class EntityServiceLocator<TEntity, TEntityId> {
|
|
|
49
49
|
resolveUpsertCommand<TEntityUpdateData>(): IEntityUpsertCommand<TEntity, TEntityId, TEntityUpdateData>;
|
|
50
50
|
resolveDeleteCommand<TEntityId>(): IEntityDeleteCommand<TEntity, TEntityId>;
|
|
51
51
|
resolveDeleteItemsCommand<TEntitiesDeleteParameters extends IEntitiesDeleteParameters<TSorting>, TSorting>(): IEntitiesDeleteCommand<TEntity, TEntitiesDeleteParameters, TSorting>;
|
|
52
|
+
resolveVersionCommand(): IEntityVersionCommand<TEntity, TEntityId>;
|
|
52
53
|
resolveSampleDownloadCommand(): IEntitiesSampleDownloadCommand<TEntity>;
|
|
53
54
|
resolveImportCommand(): IEntitiesImportCommand<TEntity>;
|
|
54
55
|
resolveExportCommand<TEntitySearchParameters extends IEntitySearchParameters<TSorting, TCursor>, TSorting extends SortingType, TCursor>(): IEntitiesExportCommand<TEntity, TEntitySearchParameters, TSorting, TCursor>;
|
|
@@ -150,6 +151,8 @@ export declare class EntitiesServiceLocator {
|
|
|
150
151
|
registerDeleteItemsCommand<TEntity, TEntitiesDeleteParameters extends IEntitiesDeleteParameters<TSorting>, TSorting>(entityName: string, instance: IEntitiesDeleteCommand<TEntity, TEntitiesDeleteParameters, TSorting>): void;
|
|
151
152
|
resolveDeleteCommand<TEntity, TEntityId>(entityName: string): IEntityDeleteCommand<TEntity, TEntityId>;
|
|
152
153
|
registerDeleteCommand<TEntity, TEntityId>(entityName: string, instance: IEntityDeleteCommand<TEntity, TEntityId>): void;
|
|
154
|
+
resolveVersionCommand<TEntity, TEntityId>(entityName: string): IEntityVersionCommand<TEntity, TEntityId>;
|
|
155
|
+
registerVersionCommand<TEntity, TEntityId>(entityName: string, instance: IEntityVersionCommand<TEntity, TEntityId>): void;
|
|
153
156
|
resolveExportCommand<TEntity, TEntitySearchParameters extends IEntitySearchParameters<TSorting, TCursor>, TSorting extends SortingType, TCursor>(entityName: string): IEntitiesExportCommand<TEntity, TEntitySearchParameters, TSorting, TCursor>;
|
|
154
157
|
registerExportCommand<TEntity, TEntitySearchParameters extends IEntitySearchParameters<TSorting, TCursor>, TSorting extends SortingType, TCursor>(entityName: string, instance: IEntitiesExportCommand<TEntity, TEntitySearchParameters, TSorting, TCursor>): void;
|
|
155
158
|
resolveImportCommand<TEntity>(entityName: string): IEntitiesImportCommand<TEntity>;
|
|
@@ -24,6 +24,7 @@ export declare const EntityServices: {
|
|
|
24
24
|
IEntityUpsertCommand: string;
|
|
25
25
|
IEntityMergeCommand: string;
|
|
26
26
|
IEntityDeleteCommand: string;
|
|
27
|
+
IEntityVersionCommand: string;
|
|
27
28
|
IEntitiesDeleteCommand: string;
|
|
28
29
|
IEntitiesExportCommand: string;
|
|
29
30
|
IEntitiesImportCommand: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -520,16 +520,10 @@ class EntityCreateCommand {
|
|
|
520
520
|
if (!versioning) {
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
await versioning.createVersion({
|
|
528
|
-
operationType: EntityVersionOperation.Create,
|
|
529
|
-
entityId: id,
|
|
530
|
-
entityType: this.services.getEntityName(),
|
|
531
|
-
data: snapshot,
|
|
532
|
-
modifiedByUserId: context?.userId,
|
|
523
|
+
await this.services.resolveVersionCommand().execute({
|
|
524
|
+
id,
|
|
525
|
+
entity,
|
|
526
|
+
operation: EntityVersionOperation.Create,
|
|
533
527
|
});
|
|
534
528
|
}
|
|
535
529
|
isVersioningEnabled() {
|
|
@@ -572,20 +566,9 @@ class EntityDeleteCommand {
|
|
|
572
566
|
if (!this.isVersioningEnabled()) {
|
|
573
567
|
return;
|
|
574
568
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
}
|
|
579
|
-
const contextService = this.services.resolveAuthenticationContextProvider();
|
|
580
|
-
const context = await contextService?.getContext();
|
|
581
|
-
const snapshotService = this.services.resolveSnapshotService();
|
|
582
|
-
const snapshot = await snapshotService?.getSnapshot(id);
|
|
583
|
-
await versioning.createVersion({
|
|
584
|
-
operationType: EntityVersionOperation.Delete,
|
|
585
|
-
entityId: id,
|
|
586
|
-
entityType: this.services.getEntityName(),
|
|
587
|
-
data: snapshot,
|
|
588
|
-
modifiedByUserId: context?.userId,
|
|
569
|
+
await this.services.resolveVersionCommand().execute({
|
|
570
|
+
id,
|
|
571
|
+
operation: EntityVersionOperation.Delete,
|
|
589
572
|
});
|
|
590
573
|
}
|
|
591
574
|
isVersioningEnabled() {
|
|
@@ -818,20 +801,10 @@ class EntityUpdateCommand {
|
|
|
818
801
|
if (!this.isVersioningEnabled()) {
|
|
819
802
|
return;
|
|
820
803
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
const contextService = this.services.resolveAuthenticationContextProvider();
|
|
826
|
-
const context = await contextService?.getContext();
|
|
827
|
-
const snapshotService = this.services.resolveSnapshotService();
|
|
828
|
-
const snapshot = (await snapshotService?.getSnapshot(id)) ?? entity;
|
|
829
|
-
await versioning.createVersion({
|
|
830
|
-
operationType: EntityVersionOperation.Update,
|
|
831
|
-
entityId: id,
|
|
832
|
-
entityType: this.services.getEntityName(),
|
|
833
|
-
data: snapshot,
|
|
834
|
-
modifiedByUserId: context?.userId,
|
|
804
|
+
await this.services.resolveVersionCommand().execute({
|
|
805
|
+
id,
|
|
806
|
+
entity,
|
|
807
|
+
operation: EntityVersionOperation.Update,
|
|
835
808
|
});
|
|
836
809
|
}
|
|
837
810
|
isVersioningEnabled() {
|
|
@@ -887,25 +860,38 @@ class EntityUpsertCommand {
|
|
|
887
860
|
if (!this.isVersioningEnabled()) {
|
|
888
861
|
return;
|
|
889
862
|
}
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
863
|
+
await this.services.resolveVersionCommand().execute({
|
|
864
|
+
id,
|
|
865
|
+
entity,
|
|
866
|
+
operation: EntityVersionOperation.Upsert,
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
isVersioningEnabled() {
|
|
870
|
+
return (this.services.resolveEntityConfiguration().versioning?.enabled ?? false);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
class EntityVersionCommand {
|
|
875
|
+
constructor(services) {
|
|
876
|
+
this.services = services;
|
|
877
|
+
}
|
|
878
|
+
async execute({ id, operation, entity, }) {
|
|
879
|
+
const versioningProvider = this.services.resolveVersioningProvider();
|
|
880
|
+
if (!versioningProvider) {
|
|
881
|
+
throw new Error("Versioning provider is not configured");
|
|
893
882
|
}
|
|
894
883
|
const contextService = this.services.resolveAuthenticationContextProvider();
|
|
895
884
|
const context = await contextService?.getContext();
|
|
896
885
|
const snapshotService = this.services.resolveSnapshotService();
|
|
897
886
|
const snapshot = (await snapshotService?.getSnapshot(id)) ?? entity;
|
|
898
|
-
await
|
|
899
|
-
operationType:
|
|
887
|
+
await versioningProvider.createVersion({
|
|
888
|
+
operationType: operation,
|
|
900
889
|
entityId: id,
|
|
901
890
|
entityType: this.services.getEntityName(),
|
|
902
891
|
data: snapshot,
|
|
903
892
|
modifiedByUserId: context?.userId,
|
|
904
893
|
});
|
|
905
894
|
}
|
|
906
|
-
isVersioningEnabled() {
|
|
907
|
-
return (this.services.resolveEntityConfiguration().versioning?.enabled ?? false);
|
|
908
|
-
}
|
|
909
895
|
}
|
|
910
896
|
|
|
911
897
|
class EntityManager {
|
|
@@ -930,6 +916,9 @@ class EntityManager {
|
|
|
930
916
|
get find() {
|
|
931
917
|
return this.services.resolveFindQuery();
|
|
932
918
|
}
|
|
919
|
+
get version() {
|
|
920
|
+
return this.services.resolveVersionCommand();
|
|
921
|
+
}
|
|
933
922
|
get create() {
|
|
934
923
|
return this.services.resolveCreateCommand();
|
|
935
924
|
}
|
|
@@ -1092,6 +1081,7 @@ const EntityServices = {
|
|
|
1092
1081
|
IEntityUpsertCommand: "IEntityUpsertCommand",
|
|
1093
1082
|
IEntityMergeCommand: "IEntityMergeCommand",
|
|
1094
1083
|
IEntityDeleteCommand: "IEntityDeleteCommand",
|
|
1084
|
+
IEntityVersionCommand: "IEntityVersionCommand",
|
|
1095
1085
|
IEntitiesDeleteCommand: "IEntitiesDeleteCommand",
|
|
1096
1086
|
IEntitiesExportCommand: "IEntitiesExportCommand",
|
|
1097
1087
|
IEntitiesImportCommand: "IEntitiesImportCommand",
|
|
@@ -1259,6 +1249,9 @@ class EntityServiceLocator {
|
|
|
1259
1249
|
resolveDeleteItemsCommand() {
|
|
1260
1250
|
return this.services.resolveDeleteItemsCommand(this.entityName);
|
|
1261
1251
|
}
|
|
1252
|
+
resolveVersionCommand() {
|
|
1253
|
+
return this.services.resolveVersionCommand(this.entityName);
|
|
1254
|
+
}
|
|
1262
1255
|
resolveSampleDownloadCommand() {
|
|
1263
1256
|
return this.services.resolveSampleDownloadCommand(this.entityName);
|
|
1264
1257
|
}
|
|
@@ -1572,6 +1565,12 @@ class EntitiesServiceLocator {
|
|
|
1572
1565
|
registerDeleteCommand(entityName, instance) {
|
|
1573
1566
|
this.provider.registerEntityService(EntityServices.Commands.IEntityDeleteCommand, entityName, instance);
|
|
1574
1567
|
}
|
|
1568
|
+
resolveVersionCommand(entityName) {
|
|
1569
|
+
return this.provider.resolveEntityService(EntityServices.Commands.IEntityVersionCommand, entityName);
|
|
1570
|
+
}
|
|
1571
|
+
registerVersionCommand(entityName, instance) {
|
|
1572
|
+
this.provider.registerEntityService(EntityServices.Commands.IEntityVersionCommand, entityName, instance);
|
|
1573
|
+
}
|
|
1575
1574
|
resolveExportCommand(entityName) {
|
|
1576
1575
|
return this.provider.resolveEntityService(EntityServices.Commands.IEntitiesExportCommand, entityName);
|
|
1577
1576
|
}
|
|
@@ -2198,6 +2197,7 @@ class EntityManagerServiceCollection {
|
|
|
2198
2197
|
return this;
|
|
2199
2198
|
}
|
|
2200
2199
|
mapImportExport(settings) {
|
|
2200
|
+
this.locator.registerVersionCommand(this.entityName, new EntityVersionCommand(this.resolver));
|
|
2201
2201
|
this.locator.registerExportCommand(this.entityName, new EntitiesExportCommand(this.resolver, settings));
|
|
2202
2202
|
this.locator.registerExportAction(this.entityName, new EntitiesExportAction(this.resolver));
|
|
2203
2203
|
this.locator.registerImportCommand(this.entityName, new EntitiesImportCommand(this.resolver, settings));
|