@fabx.vn/core 1.0.5 → 1.0.7

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,11 @@
1
+ export declare abstract class BaseEntity {
2
+ id: number;
3
+ searchKeyword: string;
4
+ createdOrg: number;
5
+ createdBy: number;
6
+ updatedBy: number;
7
+ deletedBy: number;
8
+ createdAt: Date;
9
+ updatedAt: Date;
10
+ deletedAt: Date;
11
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BaseEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ class BaseEntity {
15
+ }
16
+ exports.BaseEntity = BaseEntity;
17
+ __decorate([
18
+ (0, typeorm_1.PrimaryGeneratedColumn)({ type: "bigint" }),
19
+ __metadata("design:type", Number)
20
+ ], BaseEntity.prototype, "id", void 0);
21
+ __decorate([
22
+ (0, typeorm_1.Column)({ name: "search_keyword", type: "text", nullable: true }),
23
+ __metadata("design:type", String)
24
+ ], BaseEntity.prototype, "searchKeyword", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({ name: "created_org", type: "bigint", nullable: true }),
27
+ __metadata("design:type", Number)
28
+ ], BaseEntity.prototype, "createdOrg", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ name: "created_by", type: "bigint", nullable: true }),
31
+ __metadata("design:type", Number)
32
+ ], BaseEntity.prototype, "createdBy", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ name: "updated_by", type: "bigint", nullable: true }),
35
+ __metadata("design:type", Number)
36
+ ], BaseEntity.prototype, "updatedBy", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ name: "deleted_by", type: "bigint", nullable: true }),
39
+ __metadata("design:type", Number)
40
+ ], BaseEntity.prototype, "deletedBy", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.CreateDateColumn)({ name: "created_at" }),
43
+ __metadata("design:type", Date)
44
+ ], BaseEntity.prototype, "createdAt", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.UpdateDateColumn)({ name: "updated_at", nullable: true }),
47
+ __metadata("design:type", Date)
48
+ ], BaseEntity.prototype, "updatedAt", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.DeleteDateColumn)({ name: "deleted_at", nullable: true }),
51
+ __metadata("design:type", Date)
52
+ ], BaseEntity.prototype, "deletedAt", void 0);
53
+ //# sourceMappingURL=base.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.entity.js","sourceRoot":"","sources":["../../../src/core/entities/base.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AAEjB,MAAsB,UAAU;CA2B/B;AA3BD,gCA2BC;AAzBC;IADC,IAAA,gCAAsB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;sCAChC;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC3C;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC7C;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC7C;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC7C;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC7C;AAGlB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC9B,IAAI;6CAAC;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC9C,IAAI;6CAAC;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC9C,IAAI;6CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Repository, SelectQueryBuilder } from "typeorm";
2
+ import { PaginationDto, PaginationResponseDto } from "../dtos/pagination.dto";
3
+ export declare abstract class BasePaginationService<T> {
4
+ protected repository: Repository<T>;
5
+ protected constructor(repository: Repository<T>);
6
+ protected paginate<TEntity>(queryBuilder: SelectQueryBuilder<TEntity>, paginationDto: PaginationDto): Promise<PaginationResponseDto<TEntity>>;
7
+ protected buildSearchQuery(queryBuilder: SelectQueryBuilder<T>, searchFields: string[], search?: string): SelectQueryBuilder<T>;
8
+ protected buildOrderQuery(queryBuilder: SelectQueryBuilder<T>, sortBy?: string, sortType?: "ASC" | "DESC", fieldMapping?: Record<string, string>): SelectQueryBuilder<T>;
9
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BasePaginationService = void 0;
4
+ class BasePaginationService {
5
+ constructor(repository) {
6
+ this.repository = repository;
7
+ }
8
+ async paginate(queryBuilder, paginationDto) {
9
+ const { page = 1, limit = 10 } = paginationDto;
10
+ const skip = (page - 1) * limit;
11
+ const total = await queryBuilder.getCount();
12
+ const data = await queryBuilder.skip(skip).take(limit).getMany();
13
+ const totalPages = Math.ceil(total / limit);
14
+ const meta = {
15
+ page,
16
+ limit,
17
+ total,
18
+ totalPages,
19
+ };
20
+ return {
21
+ data,
22
+ meta,
23
+ };
24
+ }
25
+ buildSearchQuery(queryBuilder, searchFields, search) {
26
+ if (!search || !search.trim()) {
27
+ return queryBuilder;
28
+ }
29
+ const searchTerm = `%${search.trim()}%`;
30
+ const conditions = searchFields.map((field, index) => `${field} LIKE :search${index}`);
31
+ return queryBuilder.andWhere(`(${conditions.join(" OR ")})`, searchFields.reduce((params, field, index) => {
32
+ params[`search${index}`] = searchTerm;
33
+ return params;
34
+ }, {}));
35
+ }
36
+ buildOrderQuery(queryBuilder, sortBy, sortType = "DESC", fieldMapping) {
37
+ if (sortBy && fieldMapping?.[sortBy]) {
38
+ const dbField = fieldMapping[sortBy];
39
+ return queryBuilder.orderBy(dbField, sortType);
40
+ }
41
+ return queryBuilder;
42
+ }
43
+ }
44
+ exports.BasePaginationService = BasePaginationService;
45
+ //# sourceMappingURL=base-pagination.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-pagination.service.js","sourceRoot":"","sources":["../../../src/core/services/base-pagination.service.ts"],"names":[],"mappings":";;;AAOA,MAAsB,qBAAqB;IACzC,YAAgC,UAAyB;QAAzB,eAAU,GAAV,UAAU,CAAe;IAAG,CAAC;IAEnD,KAAK,CAAC,QAAQ,CACtB,YAAyC,EACzC,aAA4B;QAE5B,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,aAAa,CAAC;QAC/C,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC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AM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;YACrC,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAtED,sDAsEC"}
@@ -1,8 +1,10 @@
1
- import { DataSource, EntitySubscriberInterface, InsertEvent, UpdateEvent } from "typeorm";
1
+ import { DataSource, EntitySubscriberInterface, InsertEvent, UpdateEvent, RemoveEvent, SoftRemoveEvent } from "typeorm";
2
2
  export declare class AuditSubscriber implements EntitySubscriberInterface {
3
3
  private dataSource;
4
4
  constructor(dataSource: DataSource);
5
- private enrichEntity;
6
- beforeInsert(event: InsertEvent<any>): void;
5
+ private safeSetProperty;
6
+ beforeInsert(event: InsertEvent<any>): Promise<void>;
7
7
  beforeUpdate(event: UpdateEvent<any>): void;
8
+ beforeRemove(event: RemoveEvent<any>): void;
9
+ beforeSoftRemove(event: SoftRemoveEvent<any>): void;
8
10
  }
@@ -18,17 +18,55 @@ let AuditSubscriber = class AuditSubscriber {
18
18
  this.dataSource = dataSource;
19
19
  this.dataSource.subscribers.push(this);
20
20
  }
21
- enrichEntity(entity, context) {
21
+ safeSetProperty(entity, property, value) {
22
+ if (!entity)
23
+ return;
24
+ try {
25
+ entity[property] = value;
26
+ }
27
+ catch (error) {
28
+ }
22
29
  }
23
- beforeInsert(event) {
24
- const context = request_context_service_1.RequestContextService.getCurrentContext();
25
- if (context && event.entity)
26
- this.enrichEntity(event.entity, context);
30
+ async beforeInsert(event) {
31
+ if (!event.entity)
32
+ return;
33
+ const user = request_context_service_1.RequestContextService.getCurrentUser();
34
+ if (user?.userId) {
35
+ this.safeSetProperty(event.entity, "createdBy", user.userId);
36
+ const orgUnitId = user.orgUnitIds && user.orgUnitIds.length > 0
37
+ ? user.orgUnitIds[0]
38
+ : event.entity.orgUnitId || null;
39
+ this.safeSetProperty(event.entity, "orgUnitId", orgUnitId);
40
+ }
27
41
  }
28
42
  beforeUpdate(event) {
29
- const context = request_context_service_1.RequestContextService.getCurrentContext();
30
- if (context && event.entity)
31
- this.enrichEntity(event.entity, context);
43
+ if (!event.entity)
44
+ return;
45
+ const user = request_context_service_1.RequestContextService.getCurrentUser();
46
+ if (user?.userId) {
47
+ if (event.entity.deletedAt) {
48
+ this.safeSetProperty(event.entity, "deletedBy", user.userId);
49
+ }
50
+ else {
51
+ this.safeSetProperty(event.entity, "updatedBy", user.userId);
52
+ }
53
+ }
54
+ }
55
+ beforeRemove(event) {
56
+ if (!event.entity)
57
+ return;
58
+ const user = request_context_service_1.RequestContextService.getCurrentUser();
59
+ if (user?.userId) {
60
+ this.safeSetProperty(event.entity, "deletedBy", user.userId);
61
+ }
62
+ }
63
+ beforeSoftRemove(event) {
64
+ if (!event.entity)
65
+ return;
66
+ const user = request_context_service_1.RequestContextService.getCurrentUser();
67
+ if (user?.userId) {
68
+ this.safeSetProperty(event.entity, "deletedBy", user.userId);
69
+ }
32
70
  }
33
71
  };
34
72
  exports.AuditSubscriber = AuditSubscriber;
@@ -1 +1 @@
1
- {"version":3,"file":"audit.subscriber.js","sourceRoot":"","sources":["../../../src/core/subscribers/audit.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AACjB,2CAA4C;AAC5C,oFAA+E;AAIxE,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QACxC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAEO,YAAY,CAAC,MAAW,EAAE,OAAY;IAE9C,CAAC;IAED,YAAY,CAAC,KAAuB;QAClC,MAAM,OAAO,GAAG,+CAAqB,CAAC,iBAAiB,EAAE,CAAC;QAC1D,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM;YAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC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AAC,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;CACF,CAAA;AAxEY,0CAAe;0BAAf,eAAe;IAF3B,IAAA,mBAAU,GAAE;IACZ,IAAA,yBAAe,GAAE;qCAEgB,oBAAU;GAD/B,eAAe,CAwE3B"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { CookieService, ExtractedTokensDto, } from "./core/services/cookie.servi
6
6
  export { RabbitMQPublisher } from "./core/services/rabbitmq-publisher.service";
7
7
  export { RequestContextService, RequestContext, } from "./core/services/request-context.service";
8
8
  export { RequestInfoService } from "./core/services/request-info.service";
9
+ export { BasePaginationService } from "./core/services/base-pagination.service";
9
10
  export { JwtAuthGuard } from "./core/guards/jwt-auth.guard";
10
11
  export { InternalAuthGuard } from "./core/guards/internal-auth.guard";
11
12
  export { PermissionGuard } from "./core/guards/permission.guard";
@@ -18,6 +19,7 @@ export { HttpExceptionFilter } from "./core/filters/http-exception.filter";
18
19
  export { RequestContextInterceptor } from "./core/interceptors/request-context.interceptor";
19
20
  export { JwtStrategy } from "./core/strategies/jwt.strategy";
20
21
  export { AuditSubscriber } from "./core/subscribers/audit.subscriber";
22
+ export { BaseEntity } from "./core/entities/base.entity";
21
23
  export { jwtConfig } from "./config/jwt.config";
22
24
  export { redisConfig } from "./config/redis.config";
23
25
  export { databaseConfig } from "./config/database.config";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createServiceClient = exports.apiClient = exports.AxiosClient = exports.DateUtils = exports.SUCCESS_RESPONSES = exports.SUCCESS_MESSAGES = exports.ERROR_RESPONSES = exports.ERROR_MESSAGES = exports.MESSAGES = exports.googleOAuthConfig = exports.corsConfig = exports.internalConfig = exports.cookieConfig = exports.RABBITMQ_ROUTING_KEYS = exports.rabbitmqConfig = exports.databaseConfig = exports.redisConfig = exports.jwtConfig = exports.AuditSubscriber = exports.JwtStrategy = exports.RequestContextInterceptor = exports.HttpExceptionFilter = exports.PaginationMetaDto = exports.PaginationResponseDto = exports.PaginationDto = exports.ApiResponseDto = exports.ANY_PERMISSIONS_KEY = exports.PERMISSIONS_KEY = exports.RequireAnyPermission = exports.RequirePermissions = exports.IS_PUBLIC_KEY = exports.Public = exports.CurrentUser = exports.PermissionGuard = exports.InternalAuthGuard = exports.JwtAuthGuard = exports.RequestInfoService = exports.RequestContextService = exports.RabbitMQPublisher = exports.CookieService = exports.RedisService = exports.SessionService = exports.CoreJwtService = exports.CoreModule = void 0;
3
+ exports.createServiceClient = exports.apiClient = exports.AxiosClient = exports.DateUtils = exports.SUCCESS_RESPONSES = exports.SUCCESS_MESSAGES = exports.ERROR_RESPONSES = exports.ERROR_MESSAGES = exports.MESSAGES = exports.googleOAuthConfig = exports.corsConfig = exports.internalConfig = exports.cookieConfig = exports.RABBITMQ_ROUTING_KEYS = exports.rabbitmqConfig = exports.databaseConfig = exports.redisConfig = exports.jwtConfig = exports.BaseEntity = exports.AuditSubscriber = exports.JwtStrategy = exports.RequestContextInterceptor = exports.HttpExceptionFilter = exports.PaginationMetaDto = exports.PaginationResponseDto = exports.PaginationDto = exports.ApiResponseDto = exports.ANY_PERMISSIONS_KEY = exports.PERMISSIONS_KEY = exports.RequireAnyPermission = exports.RequirePermissions = exports.IS_PUBLIC_KEY = exports.Public = exports.CurrentUser = exports.PermissionGuard = exports.InternalAuthGuard = exports.JwtAuthGuard = exports.BasePaginationService = exports.RequestInfoService = exports.RequestContextService = exports.RabbitMQPublisher = exports.CookieService = exports.RedisService = exports.SessionService = exports.CoreJwtService = exports.CoreModule = void 0;
4
4
  var core_module_1 = require("./core/core.module");
5
5
  Object.defineProperty(exports, "CoreModule", { enumerable: true, get: function () { return core_module_1.CoreModule; } });
6
6
  var jwt_service_1 = require("./core/services/jwt.service");
@@ -17,6 +17,8 @@ var request_context_service_1 = require("./core/services/request-context.service
17
17
  Object.defineProperty(exports, "RequestContextService", { enumerable: true, get: function () { return request_context_service_1.RequestContextService; } });
18
18
  var request_info_service_1 = require("./core/services/request-info.service");
19
19
  Object.defineProperty(exports, "RequestInfoService", { enumerable: true, get: function () { return request_info_service_1.RequestInfoService; } });
20
+ var base_pagination_service_1 = require("./core/services/base-pagination.service");
21
+ Object.defineProperty(exports, "BasePaginationService", { enumerable: true, get: function () { return base_pagination_service_1.BasePaginationService; } });
20
22
  var jwt_auth_guard_1 = require("./core/guards/jwt-auth.guard");
21
23
  Object.defineProperty(exports, "JwtAuthGuard", { enumerable: true, get: function () { return jwt_auth_guard_1.JwtAuthGuard; } });
22
24
  var internal_auth_guard_1 = require("./core/guards/internal-auth.guard");
@@ -47,6 +49,8 @@ var jwt_strategy_1 = require("./core/strategies/jwt.strategy");
47
49
  Object.defineProperty(exports, "JwtStrategy", { enumerable: true, get: function () { return jwt_strategy_1.JwtStrategy; } });
48
50
  var audit_subscriber_1 = require("./core/subscribers/audit.subscriber");
49
51
  Object.defineProperty(exports, "AuditSubscriber", { enumerable: true, get: function () { return audit_subscriber_1.AuditSubscriber; } });
52
+ var base_entity_1 = require("./core/entities/base.entity");
53
+ Object.defineProperty(exports, "BaseEntity", { enumerable: true, get: function () { return base_entity_1.BaseEntity; } });
50
54
  var jwt_config_1 = require("./config/jwt.config");
51
55
  Object.defineProperty(exports, "jwtConfig", { enumerable: true, get: function () { return jwt_config_1.jwtConfig; } });
52
56
  var redis_config_1 = require("./config/redis.config");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAYA,iDAA+C;AAAtC,yGAAA,UAAU,OAAA;AAGnB,0DAA4D;AAAnD,6GAAA,cAAc,OAAA;AACvB,kEAAgF;AAAvE,iHAAA,cAAc,OAAA;AACvB,8DAA4D;AAAnD,6GAAA,YAAY,OAAA;AACrB,gEAGuC;AAFrC,+GAAA,aAAa,O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