Merged
Conversation
Remove standalone example implementation as the library now supports both Fastify and Express natively through the main package.
Add comprehensive support for File entities (http://schema.org/MediaObject) throughout the API infrastructure. Files entities can exist as children of Objects or Collections and are fully integrated into all existing routes. Changes: - Update seed script to import File entities from RO-Crate hasPart references - Add File test entities to integration test setup (5 entities total now) - Add integration tests for File filtering, retrieval, and search - Update test expectations to account for additional File entities - Document File entity type, hierarchy, and filtering in CLAUDE.md All existing functionality remains unchanged. Files use the same StandardEntity/AuthorisedEntity shapes as other entity types and work seamlessly with the transformer pipeline.
af01748 to
5fe64e8
Compare
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add comprehensive file handling system with separate File table, transformer pipeline, and pluggable storage backends. Includes RO-Crate metadata serving for all entity types. Features: - File table with migrations for dedicated file metadata storage - File transformers for access control and data enrichment - File handler system supporting streaming, redirects, and ranges - RO-Crate handler for serving entity metadata as JSON-LD - New endpoints: /files, /file/:id, /entity/:id/rocrate - AllPublicFileAccessTransformer for public datasets - Extensive documentation and test coverage Breaking changes: - Requires fileHandler and roCrateHandler in app configuration - Requires fileAccessTransformer for file access control
- Add src/index.dev.ts development server with local file streaming - Configure docker-compose for Oni UI on port 3000 - Update Oni UI config for PCDM entity types (Collection, Object, File) - Simplify dev npm script to use --env-file flag - Update knip ignore paths for new dev server - Exclude dev server from test coverage The development server provides a complete example of file handling with local filesystem storage, supporting both RO-Crate and file content streaming.
Add unit tests for baseEntityTransformer and AllPublicAccessTransformer covering entity transformation, field mapping, null handling, and access control.
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive file support to the AROCAPI system, implementing a complete file handling architecture with access control, transformers, and download endpoints.
Key Changes:
- Added File table and entity type support for MediaObject files
- Implemented file access transformers parallel to entity transformers
- Added file download endpoints with multiple serving strategies (stream, redirect, filesystem)
- Added RO-Crate metadata serving endpoints
Reviewed Changes
Copilot reviewed 57 out of 63 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| prisma/models/file.prisma | New File model with metadata fields (fileId, filename, mediaType, size, licenses) |
| prisma/models/entity.prisma | Added fileId and meta fields to Entity model |
| src/types/fileHandlers.ts | New type definitions for file and RO-Crate handlers |
| src/types/transformers.ts | Added FileAccessTransformer and FileTransformer types |
| src/transformers/default.ts | Implemented baseFileTransformer and AllPublicFileAccessTransformer |
| src/routes/files.ts | New /files endpoint for listing files with pagination |
| src/routes/file.ts | New /file/:id endpoint for downloading file content |
| src/routes/crate.ts | New /entity/:id/rocrate endpoint for serving RO-Crate metadata |
| src/app.ts | Integrated file handlers and transformers into main application |
| src/utils/errors.ts | Added INVALID_ENTITY_TYPE error code |
| vitest.config.ts | Updated coverage exclusions for dev files |
| package.json | Updated scripts to use pnpm and added seed script |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
example/data/collection-01-nyeleni/item-01-greeting/ro-crate-metadata.json
Outdated
Show resolved
Hide resolved
moisbo
reviewed
Oct 28, 2025
moisbo
reviewed
Oct 28, 2025
moisbo
reviewed
Oct 28, 2025
moisbo
reviewed
Oct 28, 2025
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
No description provided.