@mondart/nestjs-common-module-core-crud 3.0.0

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.
@@ -0,0 +1,23 @@
1
+ import { PaginateConfig } from 'nestjs-paginate/lib/paginate';
2
+ import { BaseModelEntity, BaseResponse, IdDto, PaginationQueryCustom, SuccessResponse } from '@mondart/nestjs-common-module-core';
3
+ import { CoreCrudService } from '../services/core-crud.service';
4
+ import { CoreBaseServiceOption, CoreFindAllWithPaginationServiceOption, CoreFindOneByIdServiceOption, CoreUpdateServiceOption } from '../interfaces/crud-service-option.interface';
5
+ export declare class CoreCrudController<T extends BaseModelEntity, CreateDto, UpdateDto, ResponseDto extends BaseResponse> {
6
+ protected readonly coreService: CoreCrudService<T, CreateDto, UpdateDto>;
7
+ protected readonly responseDto: {
8
+ new (init?: Partial<BaseResponse>): ResponseDto;
9
+ };
10
+ static responseDto: {
11
+ new (init?: Partial<BaseResponse>): any;
12
+ };
13
+ protected constructor(coreService: CoreCrudService<T, CreateDto, UpdateDto>, responseDto: {
14
+ new (init?: Partial<BaseResponse>): ResponseDto;
15
+ });
16
+ findAllWithPagination(query: PaginationQueryCustom, paginateConfig: PaginateConfig<T>, options?: CoreFindAllWithPaginationServiceOption<T>, ...args: any[]): Promise<SuccessResponse<ResponseDto[]>>;
17
+ findOneById(id: number, options?: CoreFindOneByIdServiceOption<T>, ...args: any[]): Promise<SuccessResponse<ResponseDto>>;
18
+ create(createDto: CreateDto, options?: CoreBaseServiceOption, ...args: any[]): Promise<SuccessResponse<ResponseDto>>;
19
+ update({ id }: IdDto, updateDto: UpdateDto, options?: CoreUpdateServiceOption<T>, ...args: any[]): Promise<SuccessResponse<ResponseDto>>;
20
+ deleteById({ id }: IdDto, options?: CoreBaseServiceOption, ...args: any[]): Promise<SuccessResponse<void>>;
21
+ softDeleteById({ id }: IdDto, options?: CoreBaseServiceOption, ...args: any[]): Promise<SuccessResponse<void>>;
22
+ }
23
+ //# sourceMappingURL=core-crud.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-crud.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/core-crud.controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,KAAK,EAEL,qBAAqB,EAErB,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACL,qBAAqB,EACrB,sCAAsC,EACtC,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,6CAA6C,CAAC;AAErD,qBAAa,kBAAkB,CAC7B,CAAC,SAAS,eAAe,EACzB,SAAS,EACT,SAAS,EACT,WAAW,SAAS,YAAY;IAO9B,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC;IACxE,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE;QAC9B,KAAK,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC;KACjD;IARH,MAAM,CAAC,WAAW,EAAE;QAClB,KAAK,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC;KACzC,CAAC;IAEF,SAAS,aACY,WAAW,EAAE,eAAe,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,EACrD,WAAW,EAAE;QAC9B,KAAK,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC;KACjD;IAKG,qBAAqB,CACzB,KAAK,EAAE,qBAAqB,EAC5B,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,EACjC,OAAO,CAAC,EAAE,sCAAsC,CAAC,CAAC,CAAC,EACnD,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,CAAC;IAwBpC,WAAW,CACf,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,4BAA4B,CAAC,CAAC,CAAC,EACzC,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAYlC,MAAM,CACV,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,qBAAqB,EAC/B,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAWlC,MAAM,CACV,EAAE,EAAE,EAAE,EAAE,KAAK,EACb,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,EACpC,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAiBlC,UAAU,CACd,EAAE,EAAE,EAAE,EAAE,KAAK,EACb,OAAO,CAAC,EAAE,qBAAqB,EAC/B,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAW3B,cAAc,CAClB,EAAE,EAAE,EAAE,EAAE,KAAK,EACb,OAAO,CAAC,EAAE,qBAAqB,EAC/B,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;CAUlC"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoreCrudController = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const nestjs_common_module_core_1 = require("@mondart/nestjs-common-module-core");
6
+ class CoreCrudController {
7
+ constructor(coreService, responseDto) {
8
+ this.coreService = coreService;
9
+ this.responseDto = responseDto;
10
+ CoreCrudController.responseDto = responseDto;
11
+ }
12
+ async findAllWithPagination(query, paginateConfig, options, ...args) {
13
+ const response = await this.coreService.findAllWithPagination(query, paginateConfig, options, ...args);
14
+ if (!response)
15
+ throw new common_1.NotFoundException(nestjs_common_module_core_1.SharedMessages.FETCH_FAILED);
16
+ const serializedData = response.data.map((item) => new this.responseDto(item));
17
+ return new nestjs_common_module_core_1.SuccessResponse(serializedData, nestjs_common_module_core_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK, {
18
+ ...response.meta,
19
+ links: response.links,
20
+ });
21
+ }
22
+ async findOneById(id, options, ...args) {
23
+ const response = await this.coreService.findOneById(id, options, ...args);
24
+ if (!response)
25
+ throw new common_1.NotFoundException(nestjs_common_module_core_1.SharedMessages.RESOURCE_NOT_FOUND);
26
+ return new nestjs_common_module_core_1.SuccessResponse(new this.responseDto(response), nestjs_common_module_core_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK);
27
+ }
28
+ async create(createDto, options, ...args) {
29
+ const response = await this.coreService.create(createDto, options, ...args);
30
+ if (!response)
31
+ throw new common_1.BadRequestException(nestjs_common_module_core_1.SharedMessages.CREATE_FAILED);
32
+ return new nestjs_common_module_core_1.SuccessResponse(new this.responseDto(response), nestjs_common_module_core_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.CREATED);
33
+ }
34
+ async update({ id }, updateDto, options, ...args) {
35
+ const response = await this.coreService.update(id, updateDto, options, ...args);
36
+ if (!response)
37
+ throw new common_1.BadRequestException(nestjs_common_module_core_1.SharedMessages.UPDATE_FAILED);
38
+ const foundItem = await this.coreService.findOneById(id, options);
39
+ return new nestjs_common_module_core_1.SuccessResponse(new this.responseDto(foundItem), nestjs_common_module_core_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK);
40
+ }
41
+ async deleteById({ id }, options, ...args) {
42
+ const result = await this.coreService.deleteById(id, options, ...args);
43
+ if (!result)
44
+ throw new common_1.BadRequestException(nestjs_common_module_core_1.SharedMessages.DELETE_FAILED);
45
+ return new nestjs_common_module_core_1.SuccessResponse(undefined, nestjs_common_module_core_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK);
46
+ }
47
+ async softDeleteById({ id }, options, ...args) {
48
+ const result = await this.coreService.softDeleteById(id, options, ...args);
49
+ if (!result)
50
+ throw new common_1.BadRequestException(nestjs_common_module_core_1.SharedMessages.DELETE_FAILED);
51
+ return new nestjs_common_module_core_1.SuccessResponse(undefined, nestjs_common_module_core_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK);
52
+ }
53
+ }
54
+ exports.CoreCrudController = CoreCrudController;
55
+ //# sourceMappingURL=core-crud.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-crud.controller.js","sourceRoot":"","sources":["../../src/controllers/core-crud.controller.ts"],"names":[],"mappings":";;;AAAA,2CAIwB;AAExB,kFAQ4C;AAS5C,MAAa,kBAAkB;IAU7B,YACqB,WAAqD,EACrD,WAElB;QAHkB,gBAAW,GAAX,WAAW,CAA0C;QACrD,gBAAW,GAAX,WAAW,CAE7B;QAED,kBAAkB,CAAC,WAAW,GAAG,WAAW,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,qBAAqB,CACzB,KAA4B,EAC5B,cAAiC,EACjC,OAAmD,EACnD,GAAG,IAAW;QAEd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAC3D,KAAK,EACL,cAAc,EACd,OAAO,EACP,GAAG,IAAI,CACR,CAAC;QACF,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,0BAAiB,CAAC,0CAAc,CAAC,YAAY,CAAC,CAAC;QAExE,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CACrC,CAAC;QAEF,OAAO,IAAI,2CAAe,CACxB,cAAc,EACd,0CAAc,CAAC,UAAU,EACzB,mBAAU,CAAC,EAAE,EACb;YACE,GAAG,QAAQ,CAAC,IAAI;YAChB,KAAK,EAAE,QAAQ,CAAC,KAAK;SACS,CACjC,CAA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E,EAAE,OAAO,CAAC,CAAC;QAClE,OAAO,IAAI,2CAAe,CACxB,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAC/B,0CAAc,CAAC,UAAU,EACzB,mBAAU,CAAC,EAAE,CACd,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CACd,EAAE,EAAE,EAAS,EACb,OAA+B,EAC/B,GAAG,IAAW;QAEd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,4BAAmB,CAAC,0CAAc,CAAC,aAAa,CAAC,CAAC;QAEzE,OAAO,IAAI,2CAAe,CACxB,SAAS,EACT,0CAAc,CAAC,UAAU,EACzB,mBAAU,CAAC,EAAE,CACd,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,EAAE,EAAE,EAAS,EACb,OAA+B,EAC/B,GAAG,IAAW;QAEd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QAC3E,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,4BAAmB,CAAC,0CAAc,CAAC,aAAa,CAAC,CAAC;QAEzE,OAAO,IAAI,2CAAe,CACxB,SAAS,EACT,0CAAc,CAAC,UAAU,EACzB,mBAAU,CAAC,EAAE,CACd,CAAC;IACJ,CAAC;CACF;AAlID,gDAkIC"}
@@ -0,0 +1,4 @@
1
+ export * from './services/core-crud.service';
2
+ export * from './interfaces/crud-service-option.interface';
3
+ export * from './controllers/core-crud.controller';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./services/core-crud.service"), exports);
18
+ __exportStar(require("./interfaces/crud-service-option.interface"), exports);
19
+ __exportStar(require("./controllers/core-crud.controller"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,6EAA2D;AAC3D,qEAAmD"}
@@ -0,0 +1,28 @@
1
+ import { EntityManager, SelectQueryBuilder } from 'typeorm';
2
+ import { FindOptionsRelations } from 'typeorm/find-options/FindOptionsRelations';
3
+ export interface CoreFindOneServiceOption extends CoreBaseServiceOption {
4
+ enableFirstLevelRelation?: boolean;
5
+ existsCheck?: boolean;
6
+ }
7
+ export interface CoreFindOneByIdServiceOption<T> extends CoreBaseServiceOption {
8
+ enableFirstLevelRelation?: boolean;
9
+ relations?: FindOptionsRelations<T> | string[];
10
+ existsCheck?: boolean;
11
+ }
12
+ export interface CoreFindAllServiceOption extends CoreBaseServiceOption {
13
+ enableFirstLevelRelation?: boolean;
14
+ existsCheck?: boolean;
15
+ }
16
+ export interface CoreFindAllWithPaginationServiceOption<T> {
17
+ selectQueryBuilder?: SelectQueryBuilder<T>;
18
+ relations?: FindOptionsRelations<T> | string[];
19
+ enableFirstLevelRelation?: boolean;
20
+ }
21
+ export interface CoreUpdateServiceOption<T> extends CoreBaseServiceOption {
22
+ relations?: FindOptionsRelations<T> | string[];
23
+ enableFirstLevelRelation?: boolean;
24
+ }
25
+ export interface CoreBaseServiceOption {
26
+ entityManager?: EntityManager;
27
+ }
28
+ //# sourceMappingURL=crud-service-option.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crud-service-option.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/crud-service-option.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC,CAAE,SAAQ,qBAAqB;IAC5E,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,SAAS,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sCAAsC,CAAC,CAAC;IACvD,kBAAkB,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC;IAC/C,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC,CAAE,SAAQ,qBAAqB;IACvE,SAAS,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC;IAC/C,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=crud-service-option.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crud-service-option.interface.js","sourceRoot":"","sources":["../../src/interfaces/crud-service-option.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ import { DeepPartial, DeleteResult, FindManyOptions, FindOptionsWhere, Repository, UpdateResult } from 'typeorm';
2
+ import { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity';
3
+ import { Paginated } from 'nestjs-paginate';
4
+ import { PaginateConfig } from 'nestjs-paginate/lib/paginate';
5
+ import { InsertResult } from 'typeorm/query-builder/result/InsertResult';
6
+ import { UpsertOptions } from 'typeorm/repository/UpsertOptions';
7
+ import { CoreBaseServiceOption, CoreFindAllServiceOption, CoreFindAllWithPaginationServiceOption, CoreFindOneByIdServiceOption, CoreFindOneServiceOption, CoreUpdateServiceOption } from '../interfaces/crud-service-option.interface';
8
+ import { BaseModelEntity, PaginationQueryCustom } from '@mondart/nestjs-common-module-core';
9
+ export declare abstract class CoreCrudService<T extends BaseModelEntity, CreateDto, UpdateDto> {
10
+ protected readonly repository: Repository<T>;
11
+ private readonly relationsPath;
12
+ protected constructor(repository: Repository<T>);
13
+ create(createDto: CreateDto, options?: CoreBaseServiceOption, ...args: any[]): Promise<T>;
14
+ update(id: number, updateDto: Partial<UpdateDto> | DeepPartial<T> | QueryDeepPartialEntity<T>, options?: CoreUpdateServiceOption<T>, ...args: any[]): Promise<UpdateResult>;
15
+ updateMany(query: FindManyOptions<T>, updateDto: Partial<UpdateDto> | DeepPartial<T> | QueryDeepPartialEntity<T>, options?: CoreUpdateServiceOption<T>, ...args: any[]): Promise<void>;
16
+ upsert(upsertDto: QueryDeepPartialEntity<T>, upsertOptions: UpsertOptions<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<InsertResult>;
17
+ findAllWithPagination(query: PaginationQueryCustom, paginateConfig: PaginateConfig<T>, options?: CoreFindAllWithPaginationServiceOption<T>, ...args: any[]): Promise<Paginated<T>>;
18
+ findAll(query: FindManyOptions<T>, options?: CoreFindAllServiceOption, ...args: any[]): Promise<T[]>;
19
+ findOneById(id: number, options?: CoreFindOneByIdServiceOption<T>, ...args: any[]): Promise<T>;
20
+ findOne(query: FindManyOptions<T>, options?: CoreFindOneServiceOption, ...args: any[]): Promise<T>;
21
+ isExists(query: FindManyOptions<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<boolean>;
22
+ count(query: FindManyOptions<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<number>;
23
+ softDelete(query: FindOptionsWhere<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<UpdateResult>;
24
+ softDeleteById(id: string | string[] | number | number[], options?: CoreBaseServiceOption, ...args: any[]): Promise<UpdateResult>;
25
+ restore(query: FindOptionsWhere<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<UpdateResult>;
26
+ restoreById(id: string | string[] | number | number[], options?: CoreBaseServiceOption, ...args: any[]): Promise<UpdateResult>;
27
+ delete(query: FindOptionsWhere<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<DeleteResult>;
28
+ deleteById(id: string | string[] | number | number[], options?: CoreBaseServiceOption, ...args: any[]): Promise<DeleteResult>;
29
+ private relatedPropertyTransformer;
30
+ private whereQueryTransformer;
31
+ private isObject;
32
+ private isArray;
33
+ private isArrayOfObjectId;
34
+ private isArrayOfNumbers;
35
+ }
36
+ //# sourceMappingURL=core-crud.service.d.ts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AC/B,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,YAAY,CAAC;IAQxB,OAAO,CAAC,0BAA0B;IAoBlC,OAAO,CAAC,qBAAqB;IA4C7B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;CAKzB"}
@@ -0,0 +1,343 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoreCrudService = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const common_1 = require("@nestjs/common");
6
+ const nestjs_paginate_1 = require("nestjs-paginate");
7
+ const nestjs_common_module_core_1 = require("@mondart/nestjs-common-module-core");
8
+ class CoreCrudService {
9
+ constructor(repository) {
10
+ this.repository = repository;
11
+ const metadata = this.repository.metadata;
12
+ this.relationsPath = metadata.relations.map((relation) => relation.propertyPath);
13
+ }
14
+ async create(createDto, options, ...args) {
15
+ createDto = this.relatedPropertyTransformer(createDto);
16
+ const entity = this.repository.create(createDto);
17
+ if (options?.entityManager) {
18
+ return await options.entityManager.save(entity);
19
+ }
20
+ else {
21
+ return await this.repository.save(entity);
22
+ }
23
+ }
24
+ async update(id, updateDto, options, ...args) {
25
+ updateDto = this.relatedPropertyTransformer(updateDto);
26
+ if (!options?.entityManager) {
27
+ const selectFields = Object.keys(updateDto);
28
+ const fetchedItem = await this.repository.findOne({
29
+ where: { id },
30
+ select: ['id', ...selectFields],
31
+ relations: options?.relations
32
+ ? options?.relations
33
+ : options?.enableFirstLevelRelation
34
+ ? this.relationsPath
35
+ : undefined,
36
+ });
37
+ if (!fetchedItem)
38
+ throw new common_1.NotFoundException(nestjs_common_module_core_1.MessageFormatter.replace(nestjs_common_module_core_1.SharedMessages.RESOURCE_NOT_FOUND, `${nestjs_common_module_core_1.ConvertStringCaseHelper.toKebabCase(this.repository.metadata?.tableName)}`));
39
+ const merged = this.repository.merge(fetchedItem, updateDto);
40
+ await this.repository.save(merged);
41
+ return {
42
+ generatedMaps: [],
43
+ raw: merged,
44
+ affected: 1,
45
+ };
46
+ }
47
+ else {
48
+ const selectFields = Object.keys(updateDto);
49
+ const fetchedItem = await options?.entityManager.findOne(this.repository.target, {
50
+ where: { id },
51
+ select: ['id', ...selectFields],
52
+ relations: options?.relations
53
+ ? options?.relations
54
+ : options?.enableFirstLevelRelation
55
+ ? this.relationsPath
56
+ : undefined,
57
+ });
58
+ if (!fetchedItem)
59
+ throw new common_1.NotFoundException(nestjs_common_module_core_1.MessageFormatter.replace(nestjs_common_module_core_1.SharedMessages.RESOURCE_NOT_FOUND, `${nestjs_common_module_core_1.ConvertStringCaseHelper.toKebabCase(this.repository.metadata?.tableName)}`));
60
+ const merged = options?.entityManager.merge(this.repository.target, fetchedItem, updateDto);
61
+ await options?.entityManager.save(merged);
62
+ return {
63
+ generatedMaps: [],
64
+ raw: merged,
65
+ affected: 1,
66
+ };
67
+ }
68
+ }
69
+ async updateMany(query, updateDto, options, ...args) {
70
+ const foundEntities = await this.findAll(query, options);
71
+ for await (const entity of foundEntities) {
72
+ await this.update(entity.id, updateDto, options).catch((err) => console.log(err));
73
+ }
74
+ }
75
+ async upsert(upsertDto, upsertOptions, options, ...args) {
76
+ try {
77
+ upsertDto = this.relatedPropertyTransformer(upsertDto);
78
+ let conflictPaths = [];
79
+ let findWhereQuery = {};
80
+ if (this.isArray(upsertOptions.conflictPaths)) {
81
+ conflictPaths = upsertOptions.conflictPaths ?? [];
82
+ }
83
+ else {
84
+ conflictPaths = Object.keys(upsertOptions.conflictPaths);
85
+ }
86
+ conflictPaths.map((path) => {
87
+ findWhereQuery = {
88
+ ...findWhereQuery,
89
+ [path]: upsertDto[path],
90
+ };
91
+ });
92
+ const formatedQuery = this.whereQueryTransformer(findWhereQuery) ?? undefined;
93
+ if (!options?.entityManager) {
94
+ const existEntity = await this.repository.findOne({
95
+ where: formatedQuery,
96
+ select: ['id'],
97
+ });
98
+ return await this.repository.upsert({ id: existEntity.id, ...upsertDto }, upsertOptions);
99
+ }
100
+ else {
101
+ const existEntity = await options?.entityManager.findOne(this.repository.target, {
102
+ where: formatedQuery,
103
+ select: ['id'],
104
+ });
105
+ return await options?.entityManager.upsert(this.repository.target, { id: existEntity.id, ...upsertDto }, upsertOptions);
106
+ }
107
+ }
108
+ catch (error) {
109
+ throw new common_1.BadRequestException(nestjs_common_module_core_1.MessageFormatter.replace(nestjs_common_module_core_1.SharedMessages.UPSERT_FAILED, error));
110
+ }
111
+ }
112
+ async findAllWithPagination(query, paginateConfig, options, ...args) {
113
+ return await (0, nestjs_paginate_1.paginate)(query, options?.selectQueryBuilder
114
+ ? options.selectQueryBuilder
115
+ : this.repository, {
116
+ ...paginateConfig,
117
+ relations: options?.relations
118
+ ? options?.relations
119
+ : options?.enableFirstLevelRelation
120
+ ? this.relationsPath
121
+ : undefined,
122
+ });
123
+ }
124
+ async findAll(query, options, ...args) {
125
+ let result;
126
+ query.where = this.whereQueryTransformer(query.where) ?? undefined;
127
+ if (!options?.entityManager)
128
+ result = await this.repository.find({
129
+ relations: options?.enableFirstLevelRelation
130
+ ? this.relationsPath
131
+ : undefined,
132
+ ...query,
133
+ });
134
+ else
135
+ result = await options.entityManager.find(this.repository.target, {
136
+ relations: options?.enableFirstLevelRelation
137
+ ? this.relationsPath
138
+ : undefined,
139
+ ...query,
140
+ });
141
+ if (options?.existsCheck && !result.length) {
142
+ throw new common_1.NotFoundException(nestjs_common_module_core_1.MessageFormatter.replace(nestjs_common_module_core_1.SharedMessages.RESOURCE_NOT_FOUND, `${nestjs_common_module_core_1.ConvertStringCaseHelper.toKebabCase(this.repository.metadata?.tableName)}`));
143
+ }
144
+ return result;
145
+ }
146
+ async findOneById(id, options, ...args) {
147
+ let result;
148
+ if (options?.entityManager) {
149
+ result = await options.entityManager.findOne(this.repository.target, {
150
+ where: {
151
+ id,
152
+ },
153
+ relations: options?.relations
154
+ ? options?.relations
155
+ : options?.enableFirstLevelRelation
156
+ ? this.relationsPath
157
+ : undefined,
158
+ });
159
+ }
160
+ else {
161
+ result = await this.repository.findOne({
162
+ where: {
163
+ id,
164
+ },
165
+ relations: options?.relations
166
+ ? options?.relations
167
+ : options?.enableFirstLevelRelation
168
+ ? this.relationsPath
169
+ : undefined,
170
+ });
171
+ }
172
+ if (options?.existsCheck && !result) {
173
+ throw new common_1.NotFoundException(nestjs_common_module_core_1.MessageFormatter.replace(nestjs_common_module_core_1.SharedMessages.RESOURCE_NOT_FOUND, `${nestjs_common_module_core_1.ConvertStringCaseHelper.toKebabCase(this.repository.metadata?.tableName)}-id: ${id}`));
174
+ }
175
+ return result;
176
+ }
177
+ async findOne(query, options, ...args) {
178
+ let result;
179
+ query.where = this.whereQueryTransformer(query.where) ?? undefined;
180
+ if (options?.entityManager) {
181
+ result = await options?.entityManager.findOne(this.repository.target, {
182
+ relations: options?.enableFirstLevelRelation
183
+ ? this.relationsPath
184
+ : undefined,
185
+ ...query,
186
+ });
187
+ }
188
+ else {
189
+ result = await this.repository.findOne({
190
+ relations: options?.enableFirstLevelRelation
191
+ ? this.relationsPath
192
+ : undefined,
193
+ ...query,
194
+ });
195
+ }
196
+ if (options?.existsCheck && !result) {
197
+ throw new common_1.NotFoundException(nestjs_common_module_core_1.MessageFormatter.replace(nestjs_common_module_core_1.SharedMessages.RESOURCE_NOT_FOUND, `${nestjs_common_module_core_1.ConvertStringCaseHelper.toKebabCase(this.repository.metadata?.tableName)}`));
198
+ }
199
+ return result;
200
+ }
201
+ async isExists(query, options, ...args) {
202
+ let result;
203
+ query.where = this.whereQueryTransformer(query.where) ?? undefined;
204
+ if (options?.entityManager) {
205
+ result = await options?.entityManager.exists(this.repository.target, query);
206
+ }
207
+ else {
208
+ result = await this.repository.exists(query);
209
+ }
210
+ return result;
211
+ }
212
+ async count(query, options, ...args) {
213
+ let result;
214
+ query.where = this.whereQueryTransformer(query.where) ?? undefined;
215
+ if (options?.entityManager) {
216
+ result = await options?.entityManager.count(this.repository.target, query);
217
+ }
218
+ else {
219
+ result = await this.repository.count(query);
220
+ }
221
+ return result;
222
+ }
223
+ async softDelete(query, options, ...args) {
224
+ const formatedQuery = this.whereQueryTransformer(query) ?? undefined;
225
+ if (options?.entityManager) {
226
+ return await options?.entityManager.softDelete(this.repository.target, formatedQuery);
227
+ }
228
+ else {
229
+ return await this.repository.softDelete(formatedQuery);
230
+ }
231
+ }
232
+ async softDeleteById(id, options, ...args) {
233
+ if (options?.entityManager) {
234
+ return await options?.entityManager.softDelete(this.repository.target, id);
235
+ }
236
+ else {
237
+ return await this.repository.softDelete(id);
238
+ }
239
+ }
240
+ async restore(query, options, ...args) {
241
+ const formatedQuery = this.whereQueryTransformer(query) ?? undefined;
242
+ if (options?.entityManager) {
243
+ return await options?.entityManager.restore(this.repository.target, formatedQuery);
244
+ }
245
+ else {
246
+ return await this.repository.restore(formatedQuery);
247
+ }
248
+ }
249
+ async restoreById(id, options, ...args) {
250
+ if (options?.entityManager) {
251
+ return await options?.entityManager.restore(this.repository.target, id);
252
+ }
253
+ else {
254
+ return await this.repository.restore(id);
255
+ }
256
+ }
257
+ async delete(query, options, ...args) {
258
+ const formatedQuery = this.whereQueryTransformer(query) ?? undefined;
259
+ if (options?.entityManager) {
260
+ return await options?.entityManager.delete(this.repository.target, formatedQuery);
261
+ }
262
+ else {
263
+ return await this.repository.delete(formatedQuery);
264
+ }
265
+ }
266
+ async deleteById(id, options, ...args) {
267
+ if (options?.entityManager) {
268
+ return await options?.entityManager.delete(this.repository.target, id);
269
+ }
270
+ else {
271
+ return await this.repository.delete(id);
272
+ }
273
+ }
274
+ relatedPropertyTransformer(dtoObject) {
275
+ const relationEntityName = Object.keys(dtoObject).filter((item) => this.relationsPath.includes(item) && dtoObject[item]);
276
+ relationEntityName.map((item) => {
277
+ let relatedItem;
278
+ if (this.isArrayOfNumbers(dtoObject[item])) {
279
+ relatedItem = dtoObject[item].map((id) => {
280
+ return { id };
281
+ });
282
+ }
283
+ else {
284
+ relatedItem = dtoObject[item];
285
+ }
286
+ dtoObject[item] = relatedItem;
287
+ });
288
+ return dtoObject;
289
+ }
290
+ whereQueryTransformer(query) {
291
+ if (typeof query === 'object' && Array.isArray(query)) {
292
+ const newArrayQuery = query
293
+ .map((item) => this.whereQueryTransformer(item))
294
+ .filter((item) => item !== undefined);
295
+ return newArrayQuery.length > 0 ? newArrayQuery : undefined;
296
+ }
297
+ else if (this.isObject(query)) {
298
+ const newQuery = {};
299
+ for (const key in query) {
300
+ if (query.hasOwnProperty(key)) {
301
+ const value = query[key];
302
+ if (typeof value === 'object' && Array.isArray(value)) {
303
+ const validatedArray = value
304
+ .map((item) => this.whereQueryTransformer(item))
305
+ .filter((item) => item !== undefined);
306
+ if (validatedArray.length > 0) {
307
+ newQuery[key] = validatedArray;
308
+ }
309
+ }
310
+ else if (value !== null &&
311
+ typeof value === 'object' &&
312
+ !Array.isArray(value) &&
313
+ !typeorm_1.InstanceChecker.isFindOperator(value)) {
314
+ const validatedObject = this.whereQueryTransformer(value);
315
+ if (validatedObject !== undefined) {
316
+ newQuery[key] = validatedObject;
317
+ }
318
+ }
319
+ else if (value !== undefined) {
320
+ newQuery[key] = value;
321
+ }
322
+ }
323
+ }
324
+ return Object.keys(newQuery).length > 0 ? newQuery : undefined;
325
+ }
326
+ return undefined;
327
+ }
328
+ isObject(value) {
329
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
330
+ }
331
+ isArray(value) {
332
+ return value !== null && typeof value === 'object' && Array.isArray(value);
333
+ }
334
+ isArrayOfObjectId(value) {
335
+ return (this.isArray(value) &&
336
+ value.every((item) => this.isObject(item) && item?.id));
337
+ }
338
+ isArrayOfNumbers(value) {
339
+ return (this.isArray(value) && value.every((item) => typeof item === 'number'));
340
+ }
341
+ }
342
+ exports.CoreCrudService = CoreCrudService;
343
+ //# sourceMappingURL=core-crud.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-crud.service.js","sourceRoot":"","sources":["../../src/services/core-crud.service.ts"],"names":[],"mappings":";;;AAAA,qCASi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AAI,IAAI,EAAE,EAAE,CAAC,CACvD,CAAC;IACJ,CAAC;IAEO,gBAAgB,CAAC,KAAU;QACjC,OAAO,CACL,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CACvE,CAAC;IACJ,CAAC;CACF;AAlhBD,0CAkhBC"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@mondart/nestjs-common-module-core-crud",
3
+ "version": "3.0.0",
4
+ "description": "Reusable CRUD controller and service utilities for NestJS.",
5
+ "author": {
6
+ "name": "Mondart"
7
+ },
8
+ "license": "MIT",
9
+ "type": "commonjs",
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "files": [
13
+ "dist",
14
+ "README.md"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsc -p tsconfig.json"
18
+ },
19
+ "dependencies": {
20
+ "@mondart/nestjs-common-module-core": "^3.0.0"
21
+ },
22
+ "peerDependencies": {
23
+ "@nestjs/common": "^11.1.10",
24
+ "@nestjs/core": "^11.1.10",
25
+ "@nestjs/swagger": "^11.0.3",
26
+ "@nestjs/typeorm": "^11.0.0",
27
+ "class-transformer": "^0.5.1",
28
+ "class-validator": "^0.14.3",
29
+ "nestjs-paginate": "^12.8.3",
30
+ "reflect-metadata": "^0.2.0",
31
+ "rxjs": "^7.8.2",
32
+ "typeorm": "^0.3.28"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ }
37
+ }