Skip to content

Conversation

@Innei
Copy link
Member

@Innei Innei commented Jan 19, 2026

Summary

  • Migrated all DTOs from class-validator to Zod for type-safe schema validation
  • Added comprehensive Zod utilities (common/zod/) with primitives, custom validators, and validation pipe
  • Created DSL utilities for configs schema generation and Zod schema factory
  • Enhanced draft management with published version tracking
  • Added category filtering to post pagination

Changes

  • Replaced class-validator decorators with Zod schemas across all modules
  • Added new *.schema.ts files for Zod schemas (replacing *.dto.ts)
  • Created shared Zod schemas in shared/schema/
  • Simplified validation pipeline with ZodValidationPipe
  • Added migration documentation

178 files changed

  • Added Zod schemas for all modules
  • Removed deprecated class-validator DTOs
  • Updated controllers to use new schemas
  • Added validation utilities and helpers

Innei added 5 commits January 19, 2026 15:16
…p models

- Replaced class-validator DTOs with Zod schemas for CreateDraft, UpdateDraft, and related models in the Draft module.
- Removed unused draft.dto.ts and meta-preset.dto.ts files, consolidating validation logic into draft.schema.ts and meta-preset.schema.ts.
- Updated service and controller files to reference the new Zod-based DTOs.
- Cleaned up model definitions by removing unnecessary decorators and imports.

Signed-off-by: Innei <tukon479@gmail.com>
- Upgraded zod from version 3.25.76 to 4.3.5 across various modules and schemas.
- Removed deprecated class-validator dependencies and validation pipes, consolidating validation logic using Zod.
- Updated schemas to utilize z.enum for enum types instead of z.nativeEnum for better compatibility with Zod v4.
- Cleaned up imports and adjusted related service and controller files to align with the new validation approach.

Signed-off-by: Innei <tukon479@gmail.com>
…PagerDto

- Enhanced the PostController to support category-based filtering in post queries.
- Updated PostPagerDto to include categoryIds, allowing for flexible filtering of posts by categories.
- Refactored the selection logic in the aggregation pipeline for improved readability and performance.

Signed-off-by: Innei <tukon479@gmail.com>
- Added `publishedVersion` property to `DraftModel` to track the version of the draft when it was published.
- Updated `DraftService` to include `markAsPublished` method for marking drafts as published and synchronizing their version.
- Modified `NoteService`, `PageService`, and `PostService` to handle draft publication during note, page, and post creation and updates, respectively.
- Introduced `draftId` field in schemas for Note, Page, and Post to associate drafts with published content.

Signed-off-by: Innei <tukon479@gmail.com>
@safedep
Copy link

safedep bot commented Jan 19, 2026

SafeDep Report Summary

Green Malicious Packages Badge Red Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
icon better-auth @ 1.3.7
pnpm-lock.yaml
ok icon
red cross icon
ok icon
🔗
icon @ai-sdk/anthropic @ 3.0.15
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @ai-sdk/openai @ 3.0.12
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon ai @ 6.0.39
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon es-toolkit @ 1.44.0
pnpm-lock.yaml packages/api-client/package.json apps/core/package.json
ok icon
ok icon
ok icon
🔗
icon mongoose-paginate-v2 @ 1.9.1
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon nestjs-zod @ 5.1.1
pnpm-lock.yaml apps/core/package.json
ok icon
ok icon
ok icon
🔗
icon openai @ 5.23.2
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon tsdown @ 0.18.4
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon zod @ 4.3.5
pnpm-lock.yaml apps/core/package.json
ok icon
ok icon
ok icon
🔗

This report is generated by SafeDep Github App

Innei and others added 7 commits January 19, 2026 20:56
…ion logic

- Added missing imports in comment.schema.ts, configs.schema.ts, markdown.schema.ts, and webhook.schema.ts for consistency.
- Refactored BaseCrudFactory in crud-factor.transformer.ts to simplify DTO class definitions, removing PartialType and clarifying validation handling.
- Updated test files to replace ExtendedValidationPipe with extendedZodValidationPipeInstance for improved validation consistency.
- Adjusted e2e tests for OptionController to reflect changes in the API endpoint and response structure.

Signed-off-by: Innei <tukon479@gmail.com>
…or request context management

- Removed cls-hooked from package.json and pnpm-lock.yaml to simplify dependency management.
- Refactored RequestContext to utilize AsyncLocalStorage for storing request context, enhancing performance and reducing complexity.
- Updated RequestContextMiddleware to use the new AsyncLocalStorage implementation.
- Added Redis server installation step in CI workflow and improved Redis mock setup to locate the system binary.

Signed-off-by: Innei <tukon479@gmail.com>
- Introduced e2e tests in request.context.e2e-spec.ts to verify that the RequestContext maintains consistency throughout a request lifecycle and does not leak context across concurrent requests.
- Added unit tests in request.context.spec.ts to ensure proper context management during asynchronous operations and isolation of concurrent request contexts.

Signed-off-by: Innei <tukon479@gmail.com>
…hod call

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Innei <tukon479@gmail.com>
- Removed lodash imports across various modules and replaced them with equivalent functions from es-toolkit/compat.
- Added es-toolkit as a dependency in package.json and pnpm-lock.yaml.
- Updated related configuration files to reflect the removal of lodash.

Signed-off-by: Innei <tukon479@gmail.com>
…ation

- Modified the `type` property in SnippetModel to include an enum validation for SnippetType, ensuring that only valid types can be assigned.
- Removed outdated snapshot tests for NoteController to streamline test suite and reduce clutter.

Signed-off-by: Innei <tukon479@gmail.com>
…Model type validation

- Refactored various controller tests to utilize a dynamic API route prefix for improved maintainability.
- Updated the `type` property in SnippetModel to ensure enum validation is based on `Object.values(SnippetType)` for better type safety.

Signed-off-by: Innei <tukon479@gmail.com>
@Innei Innei merged commit 8d87b53 into master Jan 20, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants