Merged
Conversation
|
There was a problem hiding this comment.
Pull request overview
Adds infrastructure-layer repository adapters for persisting and querying audit logs, including a MongoDB (Mongoose) implementation and an in-memory implementation, and exposes them through the package’s public exports.
Changes:
- Added MongoDB audit repository adapter + Mongoose schema with indexes/middleware.
- Added in-memory audit repository adapter supporting filtering/pagination/sorting.
- Expanded
AuditLogFilters(multi-action filter + request/session IDs) and re-exportedinfrafrom the root package.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/infra/repositories/mongodb/mongo-audit.repository.ts | Implements IAuditLogRepository using a Mongoose Model with filtering/pagination helpers. |
| src/infra/repositories/mongodb/audit-log.schema.ts | Defines AuditLogSchema, indexes, and immutability-focused middleware. |
| src/infra/repositories/mongodb/index.ts | Public exports for MongoDB repository/schema types. |
| src/infra/repositories/in-memory/in-memory-audit.repository.ts | Implements IAuditLogRepository in-memory with filtering/pagination/sorting utilities. |
| src/infra/repositories/in-memory/index.ts | Public export for the in-memory repository. |
| src/infra/repositories/index.ts | Aggregates repository implementations for infra layer. |
| src/infra/index.ts | Exposes infra-layer exports. |
| src/index.ts | Re-exports infra from the package root. |
| src/core/types.ts | Extends AuditLogFilters with actions, requestId, sessionId. |
| package.json | Adds mongoose as a peer dependency and dev dependency. |
| package-lock.json | Locks newly added mongoose dependency tree. |
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