Skip to content

Conversation

@johnf
Copy link
Collaborator

@johnf johnf commented Oct 21, 2025

No description provided.

johnf added 3 commits October 21, 2025 15:18
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.
@johnf johnf force-pushed the add-filesystem branch 3 times, most recently from af01748 to 5fe64e8 Compare October 27, 2025 01:47
@github-actions
Copy link

github-actions bot commented Oct 27, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 100%) 824 / 824
🟢 Statements 100% (🎯 100%) 824 / 824
🟢 Functions 100% (🎯 100%) 23 / 23
🟢 Branches 100% (🎯 100%) 163 / 163
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/app.ts 100% 100% 100% 100%
src/routes/crate.ts 100% 100% 100% 100%
src/routes/entities.ts 100% 100% 100% 100%
src/routes/file.ts 100% 100% 100% 100%
src/routes/files.ts 100% 100% 100% 100%
src/routes/search.ts 100% 100% 100% 100%
src/transformers/default.ts 100% 100% 100% 100%
src/utils/errors.ts 100% 100% 100% 100%
Generated in workflow #20 for commit f0587b1 by the Vitest Coverage Report Action

johnf added 4 commits October 27, 2025 14:17
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.
@johnf johnf requested review from alvinsw, brideylea, Copilot, moisbo and r-tae and removed request for brideylea October 28, 2025 00:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@johnf johnf merged commit b61f44e into main Oct 30, 2025
1 check passed
@github-actions
Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants