@nestjs-dash/audit-log 0.1.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/dist/admin-activity.resource.d.ts +11 -0
- package/dist/admin-activity.resource.d.ts.map +1 -0
- package/dist/admin-activity.resource.js +25 -0
- package/dist/admin-activity.resource.js.map +1 -0
- package/dist/audit-log.entity.d.ts +12 -0
- package/dist/audit-log.entity.d.ts.map +1 -0
- package/dist/audit-log.entity.js +55 -0
- package/dist/audit-log.entity.js.map +1 -0
- package/dist/audit.service.d.ts +12 -0
- package/dist/audit.service.d.ts.map +1 -0
- package/dist/audit.service.js +61 -0
- package/dist/audit.service.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Resource, type Table } from '@nestjs-dash/core';
|
|
2
|
+
import { AuditLogEntity } from './audit-log.entity.js';
|
|
3
|
+
export declare class AdminActivityResource extends Resource {
|
|
4
|
+
static slug: string;
|
|
5
|
+
static label: string;
|
|
6
|
+
static model: typeof AuditLogEntity;
|
|
7
|
+
static navigationGroup: string;
|
|
8
|
+
static navigationIcon: string;
|
|
9
|
+
static table(table: Table): Table;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=admin-activity.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-activity.resource.d.ts","sourceRoot":"","sources":["../src/admin-activity.resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAA0B,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AASvD,qBAAa,qBAAsB,SAAQ,QAAQ;IACjD,OAAgB,IAAI,SAAoB;IACxC,OAAgB,KAAK,SAAc;IACnC,OAAgB,KAAK,wBAAkB;IACvC,OAAgB,eAAe,SAAY;IAC3C,OAAgB,cAAc,SAAa;WAE3B,KAAK,CAAC,KAAK,EAAE,KAAK;CAenC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DateColumn, Resource, TextColumn, ViewAction } from '@nestjs-dash/core';
|
|
2
|
+
import { AuditLogEntity } from './audit-log.entity.js';
|
|
3
|
+
export class AdminActivityResource extends Resource {
|
|
4
|
+
static { this.slug = 'admin-activity'; }
|
|
5
|
+
static { this.label = 'Activity'; }
|
|
6
|
+
static { this.model = AuditLogEntity; }
|
|
7
|
+
static { this.navigationGroup = 'System'; }
|
|
8
|
+
static { this.navigationIcon = 'history'; }
|
|
9
|
+
static table(table) {
|
|
10
|
+
return table
|
|
11
|
+
.columns([
|
|
12
|
+
DateColumn.make('createdAt').label('When').sortable(),
|
|
13
|
+
TextColumn.make('actorLabel').label('Actor').searchable(),
|
|
14
|
+
TextColumn.make('action').label('Action').sortable().searchable(),
|
|
15
|
+
TextColumn.make('resourceSlug').label('Resource').searchable().sortable(),
|
|
16
|
+
TextColumn.make('recordId').label('Record'),
|
|
17
|
+
TextColumn.make('before').label('Before'),
|
|
18
|
+
TextColumn.make('after').label('After'),
|
|
19
|
+
])
|
|
20
|
+
.actions([ViewAction.make()])
|
|
21
|
+
.defaultSortBy([['createdAt', 'DESC']])
|
|
22
|
+
.defaultLimit(25);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=admin-activity.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-activity.resource.js","sourceRoot":"","sources":["../src/admin-activity.resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAc,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,cAAc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|
|
5
|
+
action: string;
|
|
6
|
+
resourceSlug: string;
|
|
7
|
+
recordId: string | null;
|
|
8
|
+
before: string | null;
|
|
9
|
+
after: string | null;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=audit-log.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-log.entity.d.ts","sourceRoot":"","sources":["../src/audit-log.entity.ts"],"names":[],"mappings":"AAEA,qBAEa,cAAc;IAEzB,EAAE,EAAG,MAAM,CAAC;IAGZ,OAAO,EAAG,MAAM,GAAG,IAAI,CAAC;IAGxB,UAAU,EAAG,MAAM,GAAG,IAAI,CAAC;IAG3B,MAAM,EAAG,MAAM,CAAC;IAGhB,YAAY,EAAG,MAAM,CAAC;IAGtB,QAAQ,EAAG,MAAM,GAAG,IAAI,CAAC;IAIzB,MAAM,EAAG,MAAM,GAAG,IAAI,CAAC;IAIvB,KAAK,EAAG,MAAM,GAAG,IAAI,CAAC;IAItB,SAAS,EAAG,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
|
11
|
+
let AuditLogEntity = class AuditLogEntity {
|
|
12
|
+
};
|
|
13
|
+
__decorate([
|
|
14
|
+
PrimaryGeneratedColumn('uuid'),
|
|
15
|
+
__metadata("design:type", String)
|
|
16
|
+
], AuditLogEntity.prototype, "id", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
Column({ name: 'actor_id', type: 'varchar', length: 255, nullable: true }),
|
|
19
|
+
__metadata("design:type", Object)
|
|
20
|
+
], AuditLogEntity.prototype, "actorId", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
Column({ name: 'actor_label', type: 'varchar', length: 255, nullable: true }),
|
|
23
|
+
__metadata("design:type", Object)
|
|
24
|
+
], AuditLogEntity.prototype, "actorLabel", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
Column({ type: 'varchar', length: 64 }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AuditLogEntity.prototype, "action", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
Column({ name: 'resource_slug', type: 'varchar', length: 255 }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AuditLogEntity.prototype, "resourceSlug", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
Column({ name: 'record_id', type: 'varchar', length: 255, nullable: true }),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], AuditLogEntity.prototype, "recordId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
Column({ type: 'text', nullable: true }),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], AuditLogEntity.prototype, "before", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
Column({ type: 'text', nullable: true }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], AuditLogEntity.prototype, "after", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
CreateDateColumn({ name: 'created_at' }),
|
|
47
|
+
Index(),
|
|
48
|
+
__metadata("design:type", Date)
|
|
49
|
+
], AuditLogEntity.prototype, "createdAt", void 0);
|
|
50
|
+
AuditLogEntity = __decorate([
|
|
51
|
+
Entity('nestjs_dash_audit_log'),
|
|
52
|
+
Index(['resourceSlug', 'recordId'])
|
|
53
|
+
], AuditLogEntity);
|
|
54
|
+
export { AuditLogEntity };
|
|
55
|
+
//# sourceMappingURL=audit-log.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-log.entity.js","sourceRoot":"","sources":["../src/audit-log.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAInF,IAAM,cAAc,GAApB,MAAM,cAAc;CA8B1B,CAAA;AA5BC;IADC,sBAAsB,CAAC,MAAM,CAAC;;0CACnB;AAGZ;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACnD;AAGxB;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACnD;AAG3B;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;8CACxB;AAGhB;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;oDAC1C;AAGtB;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACnD;AAIzB;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAClB;AAIvB;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACnB;AAItB;IAFC,gBAAgB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACxC,KAAK,EAAE;8BACI,IAAI;iDAAC;AA7BN,cAAc;IAF1B,MAAM,CAAC,uBAAuB,CAAC;IAC/B,KAAK,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;GACvB,cAAc,CA8B1B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AdminModuleOptions } from '@nestjs-dash/nestjs';
|
|
2
|
+
import type { AuditEntry } from './types.js';
|
|
3
|
+
export declare class AuditService {
|
|
4
|
+
private readonly options;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
private readonly enabled;
|
|
7
|
+
constructor(options?: AdminModuleOptions | null);
|
|
8
|
+
isEnabled(): boolean;
|
|
9
|
+
private getRepository;
|
|
10
|
+
record(entry: AuditEntry): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=audit.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.service.d.ts","sourceRoot":"","sources":["../src/audit.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAInF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,qBACa,YAAY;IAUrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAT1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAQf,OAAO,GAAE,kBAAkB,GAAG,IAAW;IAK5D,SAAS,IAAI,OAAO;IAIpB,OAAO,CAAC,aAAa;IAWf,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAsB/C"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
var AuditService_1;
|
|
14
|
+
import { NESTJS_DASH_OPTIONS } from '@nestjs-dash/nestjs';
|
|
15
|
+
import { Inject, Injectable, Logger, Optional } from '@nestjs/common';
|
|
16
|
+
import { AuditLogEntity } from './audit-log.entity.js';
|
|
17
|
+
let AuditService = AuditService_1 = class AuditService {
|
|
18
|
+
constructor(options = null) {
|
|
19
|
+
this.options = options;
|
|
20
|
+
this.logger = new Logger(AuditService_1.name);
|
|
21
|
+
this.enabled = options?.audit?.enabled === true;
|
|
22
|
+
}
|
|
23
|
+
isEnabled() {
|
|
24
|
+
return this.enabled;
|
|
25
|
+
}
|
|
26
|
+
getRepository() {
|
|
27
|
+
const dataSource = this.options?.dataSource;
|
|
28
|
+
if (!dataSource || typeof dataSource.getRepository !== 'function') {
|
|
29
|
+
throw new Error('AuditService requires AdminModule.forRoot({ audit: { enabled: true }, dataSource })');
|
|
30
|
+
}
|
|
31
|
+
return dataSource.getRepository(AuditLogEntity);
|
|
32
|
+
}
|
|
33
|
+
async record(entry) {
|
|
34
|
+
if (!this.enabled)
|
|
35
|
+
return;
|
|
36
|
+
try {
|
|
37
|
+
const repo = this.getRepository();
|
|
38
|
+
await repo.save(repo.create({
|
|
39
|
+
actorId: entry.actorId ?? null,
|
|
40
|
+
actorLabel: entry.actorLabel ?? null,
|
|
41
|
+
action: entry.action,
|
|
42
|
+
resourceSlug: entry.resourceSlug,
|
|
43
|
+
recordId: entry.recordId ?? null,
|
|
44
|
+
before: entry.before ? JSON.stringify(entry.before) : null,
|
|
45
|
+
after: entry.after ? JSON.stringify(entry.after) : null,
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.logger.warn(`Failed to write audit log entry (${entry.action} on ${entry.resourceSlug}): ` +
|
|
50
|
+
`${error instanceof Error ? error.message : String(error)}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
AuditService = AuditService_1 = __decorate([
|
|
55
|
+
Injectable(),
|
|
56
|
+
__param(0, Optional()),
|
|
57
|
+
__param(0, Inject(NESTJS_DASH_OPTIONS)),
|
|
58
|
+
__metadata("design:paramtypes", [Object])
|
|
59
|
+
], AuditService);
|
|
60
|
+
export { AuditService };
|
|
61
|
+
//# sourceMappingURL=audit.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.service.js","sourceRoot":"","sources":["../src/audit.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAA2B,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIhD,IAAM,YAAY,oBAAlB,MAAM,YAAY;IAIvB,YAME,UAAsD,IAAI;QAAzC,YAAO,GAAP,OAAO,CAAkC;Q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,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,oCAAoC,KAAK,CAAC,MAAM,OAAO,KAAK,CAAC,YAAY,KAAK;gBAC5E,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC9D,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AApDY,YAAY;IADxB,UAAU,EAAE;IASR,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,MAAM,CAAC,mBAAmB,CAAC,CAAA;;GATnB,YAAY,CAoDxB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface AuditEntry {
|
|
2
|
+
actorId?: string | null;
|
|
3
|
+
actorLabel?: string | null;
|
|
4
|
+
action: string;
|
|
5
|
+
resourceSlug: string;
|
|
6
|
+
recordId?: string | null;
|
|
7
|
+
before?: Record<string, unknown> | null;
|
|
8
|
+
after?: Record<string, unknown> | null;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACxC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nestjs-dash/audit-log",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Audit log plugin for NestJS Dash (resource-mutation audit trail + built-in read-only Activity resource)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@nestjs-dash/core": "0.1.1",
|
|
21
|
+
"@nestjs-dash/nestjs": "0.1.1"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@nestjs-dash/typescript-config": "0.1.0",
|
|
25
|
+
"@nestjs/common": "^12.0.1",
|
|
26
|
+
"reflect-metadata": "^0.2.2",
|
|
27
|
+
"typeorm": "^1.1.1",
|
|
28
|
+
"typescript": "6.0.3",
|
|
29
|
+
"vitest": "^5.0.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@nestjs/common": "^12.0.0",
|
|
33
|
+
"reflect-metadata": "^0.2.2",
|
|
34
|
+
"typeorm": ">=0.2.41 <0.3.0-0 || ^0.3.20 || ^1.0.0",
|
|
35
|
+
"vitest": "^5.0.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependenciesMeta": {
|
|
38
|
+
"reflect-metadata": {
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
"vitest": {
|
|
42
|
+
"optional": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc -p tsconfig.json",
|
|
47
|
+
"check-types": "tsc -p tsconfig.json --noEmit",
|
|
48
|
+
"format": "oxfmt",
|
|
49
|
+
"lint": "oxlint src",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:coverage": "vitest run --coverage",
|
|
52
|
+
"dev": "tsc -p tsconfig.json --watch"
|
|
53
|
+
}
|
|
54
|
+
}
|