Merged
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
There was a problem hiding this comment.
Pull request overview
Introduces a first pass of “core domain” building blocks for AuditKit (framework-free types, ports, DTO schemas, and domain errors) and exposes them via src/core/index.ts to form a public core API.
Changes:
- Added core domain model types (audit log, actors/resources, filters/pagination) plus runtime type guards.
- Added hexagonal “ports” interfaces (repository, change detector, ID generator, timestamp provider) and barrel exports.
- Added Zod-based DTO schemas for create/query/response payloads and added domain-specific error classes; updated core exports accordingly.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/types.ts | Defines core domain types/enums and type guards for audit logging. |
| src/core/ports/audit-repository.port.ts | Adds repository port contract for persistence/query operations. |
| src/core/ports/change-detector.port.ts | Adds port contract for diffing/masking/formatting changesets. |
| src/core/ports/id-generator.port.ts | Adds port contract for ID generation/validation/metadata. |
| src/core/ports/timestamp-provider.port.ts | Adds port contract for timestamp generation/format/parse/validation utilities. |
| src/core/ports/index.ts | Barrel export for ports. |
| src/core/dtos/create-audit-log.dto.ts | Adds Zod schema/types for creating audit logs (+ before/after variant). |
| src/core/dtos/query-audit-logs.dto.ts | Adds Zod schema/types for querying audit logs with pagination and date validation. |
| src/core/dtos/audit-log-response.dto.ts | Adds Zod schema/types for standardized response payloads. |
| src/core/dtos/index.ts | Barrel export for DTOs. |
| src/core/errors/audit-not-found.error.ts | Adds a typed “not found” domain error with context/toJSON. |
| src/core/errors/invalid-actor.error.ts | Adds a typed actor validation error with details/toJSON. |
| src/core/errors/invalid-changeset.error.ts | Adds a typed changeset validation error with helpers/toJSON. |
| src/core/errors/index.ts | Barrel export for domain errors. |
| src/core/index.ts | Replaces placeholder core entrypoint with re-exports for types/DTOs/ports/errors. |
| eslint.config.mjs | Adds/adjusts unused-vars lint configuration (note: repo also has eslint.config.js). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Why
Checklist
npm run lintpassesnpm run typecheckpassesnpm testpassesnpm run buildpassesnpx changeset) if this affects consumersNotes