@nest-util/nest-crud 0.1.1 → 1.0.1
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/README.md +12 -4
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -4
- package/dist/lib/controllers/nest-crud.controller.d.ts +2 -1
- package/dist/lib/controllers/nest-crud.controller.d.ts.map +1 -1
- package/dist/lib/controllers/nest-crud.controller.js +41 -5
- package/dist/lib/decorators/audit-log.decorator.d.ts +7 -0
- package/dist/lib/decorators/audit-log.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/audit-log.decorator.js +7 -0
- package/dist/lib/dtos/cursor-pagination.dto.d.ts +6 -0
- package/dist/lib/dtos/cursor-pagination.dto.d.ts.map +1 -0
- package/dist/lib/dtos/cursor-pagination.dto.js +47 -0
- package/dist/lib/dtos/list-audit-logs.dto.d.ts +8 -0
- package/dist/lib/dtos/list-audit-logs.dto.d.ts.map +1 -0
- package/dist/lib/dtos/list-audit-logs.dto.js +65 -0
- package/dist/lib/entities/audit-log.entity.d.ts +13 -0
- package/dist/lib/entities/audit-log.entity.d.ts.map +1 -0
- package/dist/lib/entities/audit-log.entity.js +58 -0
- package/dist/lib/helpers/cursor-pagination.helper.d.ts +9 -0
- package/dist/lib/helpers/cursor-pagination.helper.d.ts.map +1 -0
- package/dist/lib/helpers/cursor-pagination.helper.js +93 -0
- package/dist/lib/interceptors/audit-log.interceptor.d.ts +12 -0
- package/dist/lib/interceptors/audit-log.interceptor.d.ts.map +1 -0
- package/dist/lib/interceptors/audit-log.interceptor.js +72 -0
- package/dist/lib/interfaces/audit-log.interface.d.ts +11 -0
- package/dist/lib/interfaces/audit-log.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/audit-log.interface.js +2 -0
- package/dist/lib/interfaces/crud.interface.d.ts +16 -1
- package/dist/lib/interfaces/crud.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/cursor-strategy.interface.d.ts +30 -0
- package/dist/lib/interfaces/cursor-strategy.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/cursor-strategy.interface.js +2 -0
- package/dist/lib/interfaces/find-mine.interface.d.ts +6 -0
- package/dist/lib/interfaces/find-mine.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/find-mine.interface.js +2 -0
- package/dist/lib/interfaces/hooks.interface.d.ts +52 -0
- package/dist/lib/interfaces/hooks.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/hooks.interface.js +2 -0
- package/dist/lib/nest-crud.module.d.ts.map +1 -1
- package/dist/lib/nest-crud.module.js +6 -3
- package/dist/lib/services/audit-log.service.d.ts +43 -0
- package/dist/lib/services/audit-log.service.d.ts.map +1 -0
- package/dist/lib/services/audit-log.service.js +154 -0
- package/dist/lib/services/nest-crud.service.d.ts +23 -4
- package/dist/lib/services/nest-crud.service.d.ts.map +1 -1
- package/dist/lib/services/nest-crud.service.js +163 -8
- package/dist/lib/testing/crud-controller.test-suites.d.ts +4 -0
- package/dist/lib/testing/crud-controller.test-suites.d.ts.map +1 -0
- package/dist/lib/testing/crud-controller.test-suites.js +165 -0
- package/dist/lib/testing/crud-service.test-suites.d.ts +4 -0
- package/dist/lib/testing/crud-service.test-suites.d.ts.map +1 -0
- package/dist/lib/testing/crud-service.test-suites.js +279 -0
- package/dist/lib/testing/index.d.ts +5 -0
- package/dist/lib/testing/index.d.ts.map +1 -0
- package/dist/lib/testing/index.js +7 -0
- package/dist/lib/testing/mock-repository.d.ts +7 -0
- package/dist/lib/testing/mock-repository.d.ts.map +1 -0
- package/dist/lib/testing/mock-repository.js +97 -0
- package/dist/lib/testing/testing.interface.d.ts +52 -0
- package/dist/lib/testing/testing.interface.d.ts.map +1 -0
- package/dist/lib/testing/testing.interface.js +2 -0
- package/package.json +21 -5
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CreateAuditLogInput {
|
|
2
|
+
action: string;
|
|
3
|
+
tenantId?: string;
|
|
4
|
+
entity?: string;
|
|
5
|
+
entityId?: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
ip?: string;
|
|
9
|
+
userAgent?: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=audit-log.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-log.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/audit-log.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FilterDto } from '../dtos/filter.dto';
|
|
2
2
|
import { PaginationDto } from '../dtos/pagination.dto';
|
|
3
|
-
|
|
3
|
+
import { CursorPaginationDto } from '../dtos/cursor-pagination.dto';
|
|
4
|
+
export type CrudEndpoint = 'findAll' | 'findOne' | 'create' | 'update' | 'remove' | 'findAuditLogs' | 'findMine';
|
|
4
5
|
export interface AuditLogQuery {
|
|
5
6
|
user_id?: string;
|
|
6
7
|
start_date?: string;
|
|
@@ -8,16 +9,30 @@ export interface AuditLogQuery {
|
|
|
8
9
|
page?: number;
|
|
9
10
|
limit?: number;
|
|
10
11
|
}
|
|
12
|
+
export interface CursorPaginationResult<T> {
|
|
13
|
+
data: T[];
|
|
14
|
+
meta: {
|
|
15
|
+
limit: number;
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
nextCursor: string | null;
|
|
18
|
+
total?: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
11
21
|
export interface CrudInterface<CreateDto, UpdateDto, ResponseDto> {
|
|
12
22
|
disabledEndpoints?: readonly CrudEndpoint[];
|
|
13
23
|
findAll(query: PaginationDto & FilterDto): Promise<{
|
|
14
24
|
data: ResponseDto[];
|
|
15
25
|
meta?: unknown;
|
|
16
26
|
}>;
|
|
27
|
+
findAllWithCursor?(query: CursorPaginationDto & FilterDto): Promise<CursorPaginationResult<ResponseDto>>;
|
|
17
28
|
findOne(id: number): Promise<ResponseDto>;
|
|
18
29
|
create(dto: CreateDto): Promise<ResponseDto>;
|
|
19
30
|
update(id: number, dto: UpdateDto): Promise<ResponseDto>;
|
|
20
31
|
remove(id: number): Promise<boolean>;
|
|
21
32
|
findAuditLogs?(query: AuditLogQuery): Promise<unknown>;
|
|
33
|
+
findMine?(userId: string | number, query: PaginationDto & FilterDto): Promise<{
|
|
34
|
+
data: ResponseDto[];
|
|
35
|
+
meta?: unknown;
|
|
36
|
+
}>;
|
|
22
37
|
}
|
|
23
38
|
//# sourceMappingURL=crud.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/crud.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"crud.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/crud.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,e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O,CAAC,OAAO,CAAC,CAAC;IAEvD,QAAQ,CAAC,CACP,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,KAAK,EAAE,aAAa,GAAG,SAAS,GAC/B,OAAO,CAAC;QAAE,IAAI,EAAE,WAAW,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines how the cursor-based WHERE clause is built.
|
|
3
|
+
*
|
|
4
|
+
* - 'integer': simple `id > :cursorId` (for auto-increment integer PKs)
|
|
5
|
+
* - 'uuid': composite `(createdAt, id) < (cursorCreatedAt, cursorId)` (for UUID PKs)
|
|
6
|
+
*/
|
|
7
|
+
export type CursorStrategyType = 'integer' | 'uuid';
|
|
8
|
+
export interface CursorStrategy {
|
|
9
|
+
type: CursorStrategyType;
|
|
10
|
+
/**
|
|
11
|
+
* The name of the timestamp column used in composite cursors.
|
|
12
|
+
* Only required when type === 'uuid'.
|
|
13
|
+
* Defaults to 'createdAt'.
|
|
14
|
+
*/
|
|
15
|
+
timestampColumn?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolved cursor values after decoding.
|
|
19
|
+
*/
|
|
20
|
+
export interface DecodedIntegerCursor {
|
|
21
|
+
type: 'integer';
|
|
22
|
+
id: number;
|
|
23
|
+
}
|
|
24
|
+
export interface DecodedUuidCursor {
|
|
25
|
+
type: 'uuid';
|
|
26
|
+
createdAt: string;
|
|
27
|
+
id: string;
|
|
28
|
+
}
|
|
29
|
+
export type DecodedCursor = DecodedIntegerCursor | DecodedUuidCursor;
|
|
30
|
+
//# sourceMappingURL=cursor-strategy.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-strategy.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/cursor-strategy.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,kBAAkB,CAAC;IAEzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ObjectLiteral, SelectQueryBuilder } from 'typeorm';
|
|
2
|
+
export interface FindMineConfig<TEntity extends ObjectLiteral> {
|
|
3
|
+
userOwnershipField?: keyof TEntity;
|
|
4
|
+
findMineQuery?: (qb: SelectQueryBuilder<TEntity>, userId: string | number) => void;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=find-mine.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-mine.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/find-mine.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,aAAa;IAC3D,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC;IACnC,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACpF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type CrudHook<TContext = any> = (context: TContext) => Promise<any> | any;
|
|
2
|
+
export interface CrudHookConfig<TContext = any> {
|
|
3
|
+
handler: CrudHook<TContext>;
|
|
4
|
+
transaction?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface BeforeCreateContext<TEntity, TCreateDto> {
|
|
7
|
+
payload: TCreateDto;
|
|
8
|
+
}
|
|
9
|
+
export interface AfterCreateContext<TEntity, TCreateDto> {
|
|
10
|
+
entity: TEntity;
|
|
11
|
+
payload: TCreateDto;
|
|
12
|
+
}
|
|
13
|
+
export interface BeforeUpdateContext<TEntity, TUpdateDto> {
|
|
14
|
+
payload: TUpdateDto;
|
|
15
|
+
entity: TEntity;
|
|
16
|
+
id: number;
|
|
17
|
+
}
|
|
18
|
+
export interface AfterUpdateContext<TEntity, TUpdateDto> {
|
|
19
|
+
entity: TEntity;
|
|
20
|
+
payload: TUpdateDto;
|
|
21
|
+
id: number;
|
|
22
|
+
}
|
|
23
|
+
export interface BeforeRemoveContext<TEntity> {
|
|
24
|
+
entity: TEntity;
|
|
25
|
+
id: number;
|
|
26
|
+
}
|
|
27
|
+
export interface AfterRemoveContext {
|
|
28
|
+
id: number;
|
|
29
|
+
deleted: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface BeforeFindOneContext {
|
|
32
|
+
id: number;
|
|
33
|
+
}
|
|
34
|
+
export interface AfterFindOneContext<TEntity> {
|
|
35
|
+
entity: TEntity;
|
|
36
|
+
id: number;
|
|
37
|
+
}
|
|
38
|
+
export interface CrudHooks<TEntity, TCreateDto, TUpdateDto> {
|
|
39
|
+
beforeCreate?: CrudHookConfig<BeforeCreateContext<TEntity, TCreateDto>>;
|
|
40
|
+
afterCreate?: CrudHookConfig<AfterCreateContext<TEntity, TCreateDto>>;
|
|
41
|
+
beforeUpdate?: CrudHookConfig<BeforeUpdateContext<TEntity, TUpdateDto>>;
|
|
42
|
+
afterUpdate?: CrudHookConfig<AfterUpdateContext<TEntity, TUpdateDto>>;
|
|
43
|
+
beforeRemove?: CrudHookConfig<BeforeRemoveContext<TEntity>>;
|
|
44
|
+
afterRemove?: CrudHookConfig<AfterRemoveContext>;
|
|
45
|
+
beforeFindOne?: CrudHookConfig<BeforeFindOneContext>;
|
|
46
|
+
afterFindOne?: CrudHookConfig<AfterFindOneContext<TEntity>>;
|
|
47
|
+
}
|
|
48
|
+
export interface TransactionConfig {
|
|
49
|
+
isolationLevel?: 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SERIALIZABLE';
|
|
50
|
+
timeout?: number;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=hooks.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/hooks.interface.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,QAAQ,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAEjF,MAAM,WAAW,cAAc,CAAC,QAAQ,GAAG,GAAG;IAC5C,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB,CAAC,OAAO,EAAE,UAAU;IACtD,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB,CAAC,OAAO,EAAE,UAAU;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB,CAAC,OAAO,EAAE,UAAU;IACtD,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,kBAAkB,CAAC,OAAO,EAAE,UAAU;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ;A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-crud.module.d.ts","sourceRoot":"","sources":["../../src/lib/nest-crud.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nest-crud.module.d.ts","sourceRoot":"","sources":["../../src/lib/nest-crud.module.ts"],"names":[],"mappings":"AAKA,qBAKa,cAAc;CAAG"}
|
|
@@ -3,13 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NestCrudModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
|
-
const
|
|
6
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
7
|
+
const audit_log_entity_1 = require("./entities/audit-log.entity");
|
|
8
|
+
const audit_log_service_1 = require("./services/audit-log.service");
|
|
7
9
|
let NestCrudModule = class NestCrudModule {
|
|
8
10
|
};
|
|
9
11
|
exports.NestCrudModule = NestCrudModule;
|
|
10
12
|
exports.NestCrudModule = NestCrudModule = tslib_1.__decorate([
|
|
11
13
|
(0, common_1.Module)({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([audit_log_entity_1.AuditLogEntity])],
|
|
15
|
+
providers: [audit_log_service_1.AuditService],
|
|
16
|
+
exports: [audit_log_service_1.AuditService],
|
|
14
17
|
})
|
|
15
18
|
], NestCrudModule);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { AuditLogEntity } from '../entities/audit-log.entity';
|
|
3
|
+
import { CreateAuditLogInput } from '../interfaces/audit-log.interface';
|
|
4
|
+
interface CursorPaginationQuery {
|
|
5
|
+
cursor?: string;
|
|
6
|
+
limit?: number;
|
|
7
|
+
includeTotal?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface FindAuditLogsOptions {
|
|
10
|
+
entity?: string;
|
|
11
|
+
userId?: string;
|
|
12
|
+
startDate?: Date;
|
|
13
|
+
endDate?: Date;
|
|
14
|
+
page?: number;
|
|
15
|
+
limit?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class AuditService {
|
|
18
|
+
private readonly repo;
|
|
19
|
+
private readonly cursorStrategy;
|
|
20
|
+
constructor(repo: Repository<AuditLogEntity>);
|
|
21
|
+
log(input: CreateAuditLogInput): Promise<AuditLogEntity>;
|
|
22
|
+
logEntityAction(action: string, entity: string, entityId?: string, options?: Omit<CreateAuditLogInput, 'action' | 'entity' | 'entityId'>): Promise<AuditLogEntity>;
|
|
23
|
+
findAll(options?: FindAuditLogsOptions): Promise<{
|
|
24
|
+
data: AuditLogEntity[];
|
|
25
|
+
meta: {
|
|
26
|
+
total: number;
|
|
27
|
+
page: number;
|
|
28
|
+
limit: number;
|
|
29
|
+
totalPages: number;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
findAllWithCursor(query: CursorPaginationQuery & {
|
|
33
|
+
entity?: string;
|
|
34
|
+
userId?: string;
|
|
35
|
+
startDate?: string;
|
|
36
|
+
endDate?: string;
|
|
37
|
+
}): Promise<{
|
|
38
|
+
data: AuditLogEntity[];
|
|
39
|
+
meta: Record<string, unknown>;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=audit-log.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-log.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/audit-log.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAQxE,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBACa,YAAY;IAQrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPvB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG7B;gBAIiB,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC;IAG7C,GAAG,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;IAexD,eAAe,CACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IAUjE,OAAO,CAAC,OAAO,GAAE,oBAAyB;;;;;;;;;IA+C1C,iBAAiB,CACrB,KAAK,EAAE,qBAAqB,GAAG;QAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;;;;CA2FJ"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
7
|
+
const typeorm_2 = require("typeorm");
|
|
8
|
+
const audit_log_entity_1 = require("../entities/audit-log.entity");
|
|
9
|
+
const cursor_pagination_helper_1 = require("../helpers/cursor-pagination.helper");
|
|
10
|
+
let AuditService = class AuditService {
|
|
11
|
+
constructor(repo) {
|
|
12
|
+
this.repo = repo;
|
|
13
|
+
this.cursorStrategy = {
|
|
14
|
+
type: 'uuid',
|
|
15
|
+
timestampColumn: 'createdAt',
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
async log(input) {
|
|
19
|
+
const entry = this.repo.create({
|
|
20
|
+
action: input.action,
|
|
21
|
+
tenantId: input.tenantId,
|
|
22
|
+
entity: input.entity,
|
|
23
|
+
entityId: input.entityId,
|
|
24
|
+
userId: input.userId,
|
|
25
|
+
metadata: input.metadata,
|
|
26
|
+
ip: input.ip,
|
|
27
|
+
userAgent: input.userAgent,
|
|
28
|
+
});
|
|
29
|
+
return this.repo.save(entry);
|
|
30
|
+
}
|
|
31
|
+
async logEntityAction(action, entity, entityId, options) {
|
|
32
|
+
return this.log({
|
|
33
|
+
action,
|
|
34
|
+
entity,
|
|
35
|
+
entityId,
|
|
36
|
+
...options,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async findAll(options = {}) {
|
|
40
|
+
const page = options.page ?? 1;
|
|
41
|
+
const limit = options.limit ?? 10;
|
|
42
|
+
const queryBuilder = this.repo
|
|
43
|
+
.createQueryBuilder('auditLog')
|
|
44
|
+
.orderBy('auditLog.createdAt', 'DESC');
|
|
45
|
+
if (options.entity) {
|
|
46
|
+
queryBuilder.andWhere('auditLog.entity = :entity', {
|
|
47
|
+
entity: options.entity,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (options.userId) {
|
|
51
|
+
queryBuilder.andWhere('auditLog.userId = :userId', {
|
|
52
|
+
userId: options.userId,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (options.startDate) {
|
|
56
|
+
queryBuilder.andWhere('auditLog.createdAt >= :startDate', {
|
|
57
|
+
startDate: options.startDate,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (options.endDate) {
|
|
61
|
+
queryBuilder.andWhere('auditLog.createdAt <= :endDate', {
|
|
62
|
+
endDate: options.endDate,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
queryBuilder.skip((page - 1) * limit).take(limit);
|
|
66
|
+
const [data, total] = await queryBuilder.getManyAndCount();
|
|
67
|
+
return {
|
|
68
|
+
data,
|
|
69
|
+
meta: {
|
|
70
|
+
total,
|
|
71
|
+
page,
|
|
72
|
+
limit,
|
|
73
|
+
totalPages: Math.ceil(total / limit) || 1,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async findAllWithCursor(query) {
|
|
78
|
+
const limit = query.limit ?? 10;
|
|
79
|
+
const strategy = this.cursorStrategy;
|
|
80
|
+
const orderDirection = 'DESC';
|
|
81
|
+
const qb = this.repo.createQueryBuilder('auditLog');
|
|
82
|
+
if (query.entity) {
|
|
83
|
+
qb.andWhere('auditLog.entity = :entity', {
|
|
84
|
+
entity: query.entity,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (query.userId) {
|
|
88
|
+
qb.andWhere('auditLog.userId = :userId', {
|
|
89
|
+
userId: query.userId,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (query.startDate) {
|
|
93
|
+
qb.andWhere('auditLog.createdAt >= :startDate', {
|
|
94
|
+
startDate: new Date(query.startDate),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (query.endDate) {
|
|
98
|
+
qb.andWhere('auditLog.createdAt <= :endDate', {
|
|
99
|
+
endDate: new Date(query.endDate),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (query.cursor) {
|
|
103
|
+
const decoded = (0, cursor_pagination_helper_1.decodeCursor)(query.cursor, strategy);
|
|
104
|
+
(0, cursor_pagination_helper_1.applyCursorFilter)(qb, decoded, strategy, orderDirection);
|
|
105
|
+
}
|
|
106
|
+
qb.orderBy('auditLog.createdAt', orderDirection);
|
|
107
|
+
qb.addOrderBy('auditLog.id', orderDirection);
|
|
108
|
+
const take = limit + 1;
|
|
109
|
+
const entities = await qb.take(take).getMany();
|
|
110
|
+
const hasMore = entities.length > limit;
|
|
111
|
+
const data = hasMore ? entities.slice(0, limit) : entities;
|
|
112
|
+
const nextCursor = hasMore ? (0, cursor_pagination_helper_1.buildNextCursor)(data, strategy) : null;
|
|
113
|
+
let total;
|
|
114
|
+
if (query.includeTotal) {
|
|
115
|
+
const countQb = this.repo.createQueryBuilder('auditLog');
|
|
116
|
+
if (query.entity) {
|
|
117
|
+
countQb.andWhere('auditLog.entity = :entity', {
|
|
118
|
+
entity: query.entity,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (query.userId) {
|
|
122
|
+
countQb.andWhere('auditLog.userId = :userId', {
|
|
123
|
+
userId: query.userId,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (query.startDate) {
|
|
127
|
+
countQb.andWhere('auditLog.createdAt >= :startDate', {
|
|
128
|
+
startDate: new Date(query.startDate),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (query.endDate) {
|
|
132
|
+
countQb.andWhere('auditLog.createdAt <= :endDate', {
|
|
133
|
+
endDate: new Date(query.endDate),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
total = await countQb.getCount();
|
|
137
|
+
}
|
|
138
|
+
const meta = {
|
|
139
|
+
limit,
|
|
140
|
+
hasMore,
|
|
141
|
+
nextCursor,
|
|
142
|
+
};
|
|
143
|
+
if (total !== undefined) {
|
|
144
|
+
meta.total = total;
|
|
145
|
+
}
|
|
146
|
+
return { data, meta };
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
exports.AuditService = AuditService;
|
|
150
|
+
exports.AuditService = AuditService = tslib_1.__decorate([
|
|
151
|
+
(0, common_1.Injectable)(),
|
|
152
|
+
tslib_1.__param(0, (0, typeorm_1.InjectRepository)(audit_log_entity_1.AuditLogEntity)),
|
|
153
|
+
tslib_1.__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
154
|
+
], AuditService);
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Type } from '@nestjs/common';
|
|
2
|
-
import { ObjectLiteral, Repository } from 'typeorm';
|
|
3
|
-
import { AuditLogEntity } from '
|
|
2
|
+
import { ObjectLiteral, Repository, SelectQueryBuilder } from 'typeorm';
|
|
3
|
+
import { AuditLogEntity } from '../entities/audit-log.entity';
|
|
4
4
|
import { PaginationDto } from '../dtos/pagination.dto';
|
|
5
|
+
import { CursorPaginationDto } from '../dtos/cursor-pagination.dto';
|
|
5
6
|
import { FilterDto } from '../dtos/filter.dto';
|
|
6
|
-
import { CrudEndpoint, CrudInterface } from '../interfaces/crud.interface';
|
|
7
|
-
|
|
7
|
+
import { CrudEndpoint, CrudInterface, CursorPaginationResult } from '../interfaces/crud.interface';
|
|
8
|
+
import { CursorStrategy } from '../interfaces/cursor-strategy.interface';
|
|
9
|
+
import { CrudHooks, TransactionConfig } from '../interfaces/hooks.interface';
|
|
10
|
+
import { FindMineConfig } from '../interfaces/find-mine.interface';
|
|
11
|
+
export interface CrudServiceOptions<Entity extends ObjectLiteral, ResponseDto> extends FindMineConfig<Entity> {
|
|
8
12
|
repository: Repository<Entity>;
|
|
9
13
|
allowedFilters?: readonly (keyof Entity)[];
|
|
10
14
|
allowedSortFields?: readonly (keyof Entity)[];
|
|
@@ -18,6 +22,9 @@ export interface CrudServiceOptions<Entity extends ObjectLiteral, ResponseDto> {
|
|
|
18
22
|
createDtoClass?: Type<unknown>;
|
|
19
23
|
updateDtoClass?: Type<unknown>;
|
|
20
24
|
disabledEndpoints?: readonly CrudEndpoint[];
|
|
25
|
+
cursorStrategy?: CursorStrategy;
|
|
26
|
+
hooks?: CrudHooks<Entity, any, any>;
|
|
27
|
+
transactionConfig?: TransactionConfig;
|
|
21
28
|
}
|
|
22
29
|
export declare class NestCrudService<Entity extends ObjectLiteral, CreateDto = Partial<Entity>, UpdateDto = Partial<Entity>, ResponseDto = Entity> implements CrudInterface<CreateDto, UpdateDto, ResponseDto> {
|
|
23
30
|
protected readonly repo: Repository<Entity>;
|
|
@@ -33,8 +40,15 @@ export declare class NestCrudService<Entity extends ObjectLiteral, CreateDto = P
|
|
|
33
40
|
protected readonly createDtoClass?: Type<unknown>;
|
|
34
41
|
protected readonly updateDtoClass?: Type<unknown>;
|
|
35
42
|
readonly disabledEndpoints: readonly CrudEndpoint[];
|
|
43
|
+
protected readonly cursorStrategy: CursorStrategy;
|
|
44
|
+
protected readonly hooks: CrudHooks<Entity, any, any>;
|
|
45
|
+
protected readonly transactionConfig: TransactionConfig;
|
|
46
|
+
protected readonly userOwnershipField?: keyof Entity;
|
|
47
|
+
protected readonly findMineQuery?: (qb: SelectQueryBuilder<Entity>, userId: string | number) => void;
|
|
36
48
|
constructor(options: CrudServiceOptions<Entity, ResponseDto>);
|
|
37
49
|
private resolveRelations;
|
|
50
|
+
private executeInTransaction;
|
|
51
|
+
private executeHook;
|
|
38
52
|
findAll(query: PaginationDto & FilterDto): Promise<{
|
|
39
53
|
data: ResponseDto[];
|
|
40
54
|
meta: {
|
|
@@ -46,6 +60,11 @@ export declare class NestCrudService<Entity extends ObjectLiteral, CreateDto = P
|
|
|
46
60
|
data: ResponseDto[];
|
|
47
61
|
meta?: undefined;
|
|
48
62
|
}>;
|
|
63
|
+
findMine(userId: string | number, query: PaginationDto & FilterDto): Promise<{
|
|
64
|
+
data: ResponseDto[];
|
|
65
|
+
meta?: unknown;
|
|
66
|
+
}>;
|
|
67
|
+
findAllWithCursor(query: CursorPaginationDto & FilterDto): Promise<CursorPaginationResult<ResponseDto>>;
|
|
49
68
|
findOne(id: number): Promise<ResponseDto>;
|
|
50
69
|
create(payload: CreateDto): Promise<ResponseDto>;
|
|
51
70
|
update(id: number, payload: UpdateDto): Promise<ResponseDto>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nest-crud.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/nest-crud.service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"nest-crud.service.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