@trailmix-cms/cms 0.0.4 → 0.1.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.
@@ -1,7 +1,10 @@
1
1
  import { DynamicModule } from '@nestjs/common';
2
2
  import * as models from '@trailmix-cms/models';
3
3
  import { createCmsProviders } from './cms.providers';
4
+ export type CmsModuleOptions = {
5
+ disableAuditController: boolean;
6
+ };
4
7
  export declare class CmsModule {
5
- static forRoot<AccountEntity extends models.Account.Entity = models.Account.Entity, AccountDtoEntity = AccountEntity, FileEntity extends models.File.Entity = models.File.Entity, TextEntity extends models.Text.Entity = models.Text.Entity>(options?: Parameters<typeof createCmsProviders<AccountEntity, AccountDtoEntity, FileEntity, TextEntity>>[0]): Promise<DynamicModule>;
8
+ static forRoot<AccountEntity extends models.Account.Entity = models.Account.Entity, AccountDtoEntity = AccountEntity, FileEntity extends models.File.Entity = models.File.Entity, TextEntity extends models.Text.Entity = models.Text.Entity>(options?: CmsModuleOptions & Parameters<typeof createCmsProviders<AccountEntity, AccountDtoEntity, FileEntity, TextEntity>>[0]): Promise<DynamicModule>;
6
9
  }
7
10
  //# sourceMappingURL=cms.module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cms.module.d.ts","sourceRoot":"","sources":["../src/cms.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAwB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG3E,qBASa,SAAS;WACL,OAAO,CAChB,aAAa,SAAS,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EACnE,gBAAgB,GAAG,aAAa,EAChC,UAAU,SAAS,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAC1D,UAAU,SAAS,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAC5D,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;CAgBzI"}
1
+ {"version":3,"file":"cms.module.d.ts","sourceRoot":"","sources":["../src/cms.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAwB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI3E,MAAM,MAAM,gBAAgB,GAAG;IAC3B,sBAAsB,EAAE,OAAO,CAAC;CACnC,CAAA;AAED,qBASa,SAAS;WACL,OAAO,CAChB,aAAa,SAAS,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EACnE,gBAAgB,GAAG,aAAa,EAChC,UAAU,SAAS,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAC1D,UAAU,SAAS,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAC5D,OAAO,CAAC,EAAE,gBAAgB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;CAiB5J"}
@@ -14,6 +14,7 @@ const db_1 = require("@trailmix-cms/db");
14
14
  const config_2 = require("./config");
15
15
  const cms_providers_1 = require("./cms.providers");
16
16
  const account_controller_1 = require("./controllers/account.controller");
17
+ const audit_controller_1 = require("./controllers/audit.controller");
17
18
  let CmsModule = CmsModule_1 = class CmsModule {
18
19
  static async forRoot(options) {
19
20
  const providers = (0, cms_providers_1.createCmsProviders)(options);
@@ -22,6 +23,7 @@ let CmsModule = CmsModule_1 = class CmsModule {
22
23
  module: CmsModule_1,
23
24
  providers,
24
25
  controllers: [
26
+ ...(!options?.disableAuditController ? [audit_controller_1.AuditController] : []),
25
27
  (0, account_controller_1.buildAccountController)(options?.entities?.accountDto),
26
28
  ],
27
29
  exports: [
@@ -1 +1 @@
1
- {"version":3,"file":"cms.module.js","sourceRoot":"","sources":["../src/cms.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,2CAA8C;AAG9C,yCAAyD;AAEzD,qCAAyC;AACzC,mDAA2E;AAC3E,yEAA0E;AAWnE,IAAM,SAAS,iBAAf,MAAM,SAAS;IAClB,MAAM,CAAC,KAAK,CAAC,OAAO,CAKlB,OAA2G;QACzG,MAAM,SAAS,GAAG,IAAA,kCAAkB,EAA0D,OAAO,CAAC,CAAC;QACvG,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,GAAG,IAAA,oCAAoB,EAAC,OAAO,CAAC,CAAC;QACvE,OAAO;YACH,MAAM,EAAE,WAAS;YACjB,SAAS;YACT,WAAW,EAAE;gBACT,IAAA,2CAAsB,EAAkC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC;aACzF;YACD,OAAO,EAAE;gBACL,GAAG,SAAS;gBACZ,GAAG,UAAK,CAAC,qBAAqB,CAAC,eAAe,CAAC;gBAC/C,GAAG,WAAW;aACjB;SACJ,CAAC;IACN,CAAC;CACJ,CAAA;AAtBY,8BAAS;oBAAT,SAAS;IATrB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,OAAO,CAAC;gBACjB,IAAI,EAAE,CAAC,sBAAa,CAAC;aACxB,CAAC;YACF,mBAAc;SACjB;QACD,OAAO,EAAE,EAAE;KACd,CAAC;GACW,SAAS,CAsBrB"}
1
+ {"version":3,"file":"cms.module.js","sourceRoot":"","sources":["../src/cms.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,2CAA8C;AAG9C,yCAAyD;AAEzD,qCAAyC;AACzC,mDAA2E;AAC3E,yEAA0E;AAC1E,qEAAiE;AAe1D,IAAM,SAAS,iBAAf,MAAM,SAAS;IAClB,MAAM,CAAC,KAAK,CAAC,OAAO,CAKlB,OAA8H;QAC5H,MAAM,SAAS,GAAG,IAAA,kCAAkB,EAA0D,OAAO,CAAC,CAAC;QACvG,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,GAAG,IAAA,oCAAoB,EAAC,OAAO,CAAC,CAAC;QACvE,OAAO;YACH,MAAM,EAAE,WAAS;YACjB,SAAS;YACT,WAAW,EAAE;gBACT,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC9D,IAAA,2CAAsB,EAAkC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC;aACzF;YACD,OAAO,EAAE;gBACL,GAAG,SAAS;gBACZ,GAAG,UAAK,CAAC,qBAAqB,CAAC,eAAe,CAAC;gBAC/C,GAAG,WAAW;aACjB;SACJ,CAAC;IACN,CAAC;CACJ,CAAA;AAvBY,8BAAS;oBAAT,SAAS;IATrB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,OAAO,CAAC;gBACjB,IAAI,EAAE,CAAC,sBAAa,CAAC;aACxB,CAAC;YACF,mBAAc;SACjB;QACD,OAAO,EAAE,EAAE;KACd,CAAC;GACW,SAAS,CAuBrB"}
@@ -0,0 +1,10 @@
1
+ import { DatabaseService, Collections } from '@trailmix-cms/db';
2
+ import * as dto from '../dto/audit.dto';
3
+ export declare class AuditController {
4
+ private readonly auditCollection;
5
+ private readonly databaseService;
6
+ private readonly logger;
7
+ constructor(auditCollection: Collections.AuditCollection, databaseService: DatabaseService);
8
+ getAuditRecord(type: string, id: string): Promise<dto.AuditListResponseDto>;
9
+ }
10
+ //# sourceMappingURL=audit.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/audit.controller.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAGxC,qBAGa,eAAe;IAIpB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAJpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;gBAGtC,eAAe,EAAE,WAAW,CAAC,eAAe,EAC5C,eAAe,EAAE,eAAe;IAY/C,cAAc,CACD,IAAI,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,GACxB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;CAoBvC"}
@@ -0,0 +1,107 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ 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;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __metadata = (this && this.__metadata) || function (k, v) {
42
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
43
+ };
44
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
45
+ return function (target, key) { decorator(target, key, paramIndex); }
46
+ };
47
+ var AuditController_1;
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.AuditController = void 0;
50
+ const common_1 = require("@nestjs/common");
51
+ const swagger_1 = require("@nestjs/swagger");
52
+ const auth_decorator_1 = require("../decorators/auth.decorator");
53
+ const models_1 = require("@trailmix-cms/models");
54
+ const db_1 = require("@trailmix-cms/db");
55
+ const dto = __importStar(require("../dto/audit.dto"));
56
+ const utils_1 = require("@trailmix-cms/utils");
57
+ let AuditController = AuditController_1 = class AuditController {
58
+ auditCollection;
59
+ databaseService;
60
+ logger = new common_1.Logger(AuditController_1.name);
61
+ constructor(auditCollection, databaseService) {
62
+ this.auditCollection = auditCollection;
63
+ this.databaseService = databaseService;
64
+ }
65
+ async getAuditRecord(type, id) {
66
+ this.logger.log(`Getting audit history for entity type: ${type} and entity ID: ${id}`);
67
+ // Check if the collection type exists in MongoDB
68
+ const collections = await this.databaseService.db.listCollections().toArray();
69
+ const collectionNames = collections.map(c => c.name);
70
+ if (!collectionNames.includes(type)) {
71
+ this.logger.warn(`Collection type '${type}' does not exist.`);
72
+ }
73
+ const entityId = (0, utils_1.validateObjectId)(id, { type: 'param', data: 'id' });
74
+ const result = await this.auditCollection.find({
75
+ entity_type: type,
76
+ entity_id: entityId
77
+ });
78
+ return {
79
+ items: result,
80
+ count: result.length,
81
+ };
82
+ }
83
+ };
84
+ exports.AuditController = AuditController;
85
+ __decorate([
86
+ (0, common_1.Get)(':type/:id'),
87
+ (0, swagger_1.ApiParam)({ name: 'type', description: 'Entity type' }),
88
+ (0, swagger_1.ApiParam)({ name: 'id', description: 'Entity ID' }),
89
+ (0, swagger_1.ApiOperation)({ summary: 'Get audit history for a record' }),
90
+ (0, swagger_1.ApiOkResponse)({
91
+ description: 'Audit record found.',
92
+ type: dto.AuditListResponseDto,
93
+ }),
94
+ (0, swagger_1.ApiNotFoundResponse)({ description: 'Audit record not found.' }),
95
+ __param(0, (0, common_1.Param)('type')),
96
+ __param(1, (0, common_1.Param)('id')),
97
+ __metadata("design:type", Function),
98
+ __metadata("design:paramtypes", [String, String]),
99
+ __metadata("design:returntype", Promise)
100
+ ], AuditController.prototype, "getAuditRecord", null);
101
+ exports.AuditController = AuditController = AuditController_1 = __decorate([
102
+ (0, auth_decorator_1.Auth)({ roles: [models_1.Role.Admin] }),
103
+ (0, swagger_1.ApiTags)('audit'),
104
+ (0, common_1.Controller)('audit'),
105
+ __metadata("design:paramtypes", [db_1.Collections.AuditCollection, db_1.DatabaseService])
106
+ ], AuditController);
107
+ //# sourceMappingURL=audit.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.controller.js","sourceRoot":"","sources":["../../src/controllers/audit.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAqF;AACrF,6CAAsG;AAGtG,iEAAoD;AACpD,iDAA4C;AAC5C,yCAAgE;AAEhE,sDAAwC;AACxC,+CAAuD;AAKhD,IAAM,eAAe,uBAArB,MAAM,eAAe;IAIH;IACA;IAJJ,MAAM,GAAG,IAAI,eAAM,CAAC,iBAAe,CAAC,IAAI,CAAC,CAAC;IAE3D,YACqB,eAA4C,EAC5C,eAAgC;QADhC,oBAAe,GAAf,eAAe,CAA6B;QAC5C,oBAAe,GAAf,eAAe,CAAiB;IACjD,CAAC;IAWC,AAAN,KAAK,CAAC,cAAc,CACD,IAAY,EACd,EAAU;QAEvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,0CAA0C,IAAI,mBAAmB,EAAE,EAAE,CAAC,CAAC;QAEvF,iDAAiD;QACjD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC;QAC9E,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,IAAI,mBAAmB,CAAC,CAAC;QAClE,CAAC;QAED,MAAM,QAAQ,GAAG,IAAA,wBAAgB,EAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAC3C,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,QAAQ;SACtB,CAAC,CAAC;QACH,OAAO;YACH,KAAK,EAAE,MAAM;YACb,KAAK,EAAE,MAAM,CAAC,MAAM;SACvB,CAAC;IACN,CAAC;CACJ,CAAA;AAxCY,0CAAe;AAiBlB;IATL,IAAA,YAAG,EAAC,WAAW,CAAC;IAChB,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IACtD,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;IAClD,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC;IAC3D,IAAA,uBAAa,EAAC;QACX,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,GAAG,CAAC,oBAAoB;KACjC,CAAC;IACD,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IAE3D,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;qDAoBf;0BAvCQ,eAAe;IAH3B,IAAA,qBAAI,EAAC,EAAE,KAAK,EAAE,CAAC,aAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IAC7B,IAAA,iBAAO,EAAC,OAAO,CAAC;IAChB,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAKsB,gBAAW,CAAC,eAAe,EAC3B,oBAAe;GAL5C,eAAe,CAwC3B"}
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ export declare const AuditListResponseSchema: z.ZodObject<{
3
+ items: z.ZodArray<z.ZodObject<{
4
+ _id: z.ZodCodec<z.ZodString, z.ZodCustom<import("bson").ObjectId, import("bson").ObjectId>>;
5
+ created_at: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
6
+ updated_at: z.ZodOptional<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
7
+ entity_id: z.ZodCodec<z.ZodString, z.ZodCustom<import("bson").ObjectId, import("bson").ObjectId>>;
8
+ entity_type: z.ZodString;
9
+ action: z.ZodEnum<{
10
+ create: "create";
11
+ update: "update";
12
+ delete: "delete";
13
+ }>;
14
+ context: z.ZodObject<{
15
+ account_id: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodCustom<import("bson").ObjectId, import("bson").ObjectId>>>;
16
+ anonymous: z.ZodOptional<z.ZodBoolean>;
17
+ system: z.ZodBoolean;
18
+ source: z.ZodOptional<z.ZodString>;
19
+ message: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ }, z.core.$strip>>;
22
+ count: z.ZodNumber;
23
+ }, z.core.$strip>;
24
+ declare const AuditListResponseDto_base: import("nestjs-zod").ZodDto<z.ZodObject<{
25
+ items: z.ZodArray<z.ZodObject<{
26
+ _id: z.ZodCodec<z.ZodString, z.ZodCustom<import("bson").ObjectId, import("bson").ObjectId>>;
27
+ created_at: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
28
+ updated_at: z.ZodOptional<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
29
+ entity_id: z.ZodCodec<z.ZodString, z.ZodCustom<import("bson").ObjectId, import("bson").ObjectId>>;
30
+ entity_type: z.ZodString;
31
+ action: z.ZodEnum<{
32
+ create: "create";
33
+ update: "update";
34
+ delete: "delete";
35
+ }>;
36
+ context: z.ZodObject<{
37
+ account_id: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodCustom<import("bson").ObjectId, import("bson").ObjectId>>>;
38
+ anonymous: z.ZodOptional<z.ZodBoolean>;
39
+ system: z.ZodBoolean;
40
+ source: z.ZodOptional<z.ZodString>;
41
+ message: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ }, z.core.$strip>>;
44
+ count: z.ZodNumber;
45
+ }, z.core.$strip>> & {
46
+ io: "input";
47
+ };
48
+ export declare class AuditListResponseDto extends AuditListResponseDto_base {
49
+ }
50
+ export {};
51
+ //# sourceMappingURL=audit.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.dto.d.ts","sourceRoot":"","sources":["../../src/dto/audit.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;iBAGlC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AACH,qBAAa,oBAAqB,SAAQ,yBAAqC;CAAI"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuditListResponseDto = exports.AuditListResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const nestjs_zod_1 = require("nestjs-zod");
6
+ const models_1 = require("@trailmix-cms/models");
7
+ exports.AuditListResponseSchema = zod_1.z.object({
8
+ items: zod_1.z.array(models_1.Audit.entitySchema),
9
+ count: zod_1.z.number(),
10
+ });
11
+ class AuditListResponseDto extends (0, nestjs_zod_1.createZodDto)(exports.AuditListResponseSchema) {
12
+ }
13
+ exports.AuditListResponseDto = AuditListResponseDto;
14
+ //# sourceMappingURL=audit.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.dto.js","sourceRoot":"","sources":["../../src/dto/audit.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAA0C;AAC1C,iDAA6C;AAEhC,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,cAAK,CAAC,YAAY,CAAC;IAClC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AACH,MAAa,oBAAqB,SAAQ,IAAA,yBAAY,EAAC,+BAAuB,CAAC;CAAI;AAAnF,oDAAmF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trailmix-cms/cms",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
@@ -15,12 +15,13 @@
15
15
  "@nestjs/config": "^4.0.2",
16
16
  "@nestjs/core": "^11.1.9",
17
17
  "@nestjs/swagger": "^11.2.3",
18
- "@trailmix-cms/db": "0.0.4",
19
- "@trailmix-cms/models": "0.0.4",
20
- "@trailmix-cms/utils": "0.0.4",
18
+ "@trailmix-cms/db": "0.1.0",
19
+ "@trailmix-cms/models": "0.1.0",
20
+ "@trailmix-cms/utils": "0.1.0",
21
21
  "cache-manager": "^7.2.5",
22
22
  "envalid": "^8.1.1",
23
23
  "mongodb": "^7.0.0",
24
+ "nestjs-zod": "^5.0.1",
24
25
  "reflect-metadata": "^0.2.2",
25
26
  "rxjs": "^7.8.2",
26
27
  "zod": "^4.1.12"
@@ -34,10 +35,11 @@
34
35
  "@clerk/fastify": "^2.6.8",
35
36
  "@nestjs/common": "^11.1.9",
36
37
  "@nestjs/config": "^4.0.2",
37
- "@trailmix-cms/db": "0.0.4",
38
- "@trailmix-cms/models": "0.0.4",
39
- "@trailmix-cms/utils": "0.0.4",
38
+ "@trailmix-cms/db": "0.1.0",
39
+ "@trailmix-cms/models": "0.1.0",
40
+ "@trailmix-cms/utils": "0.1.0",
40
41
  "mongodb": "^7.0.0",
42
+ "nestjs-zod": "^5.0.1",
41
43
  "reflect-metadata": "^0.2.2",
42
44
  "rxjs": "^7.8.2",
43
45
  "zod": "^4.1.12"