Add format as an optional param to submitGuestbook for download use cases#435
Add format as an optional param to submitGuestbook for download use cases#435ekraffmiller wants to merge 3 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional format parameter to the access “submit guestbook for download” flow so callers can request specific download formats (per #434), and verifies the signed URL retains the requested format.
Changes:
- Plumbs an optional
format?: stringargument through access download use cases, repository interface, and repository implementation. - Updates
AccessRepositoryPOST query params to includeformatwhen provided. - Expands unit and integration tests to cover format propagation/preservation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/access/SubmitGuestbookDownloads.test.ts | Adds unit tests asserting format is forwarded (and undefined when omitted). |
| test/integration/access/AccessRepository.test.ts | Adds integration coverage ensuring format is preserved in the signed URL. |
| src/access/infra/repositories/AccessRepository.ts | Adds format support to access download API calls via query params. |
| src/access/domain/useCases/SubmitGuestbookForDatasetVersionDownload.ts | Adds optional format to the use case execution path. |
| src/access/domain/useCases/SubmitGuestbookForDatasetDownload.ts | Adds optional format to the use case execution path. |
| src/access/domain/useCases/SubmitGuestbookForDatafilesDownload.ts | Adds optional format to the use case execution path. |
| src/access/domain/useCases/SubmitGuestbookForDatafileDownload.ts | Adds optional format to the use case execution path. |
| src/access/domain/repositories/IAccessRepository.ts | Extends repository contract with optional format across download methods. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -22,15 +25,18 @@ export class AccessRepository extends ApiRepository implements IAccessRepository | |||
|
|
|||
| public async submitGuestbookForDatafilesDownload( | |||
| fileIds: Array<number>, | |||
There was a problem hiding this comment.
The fileIds parameter type here is narrower than the interface (IAccessRepository allows string | Array<number | string>). This makes Array.isArray(fileIds) effectively dead-code from a typing perspective and prevents callers using AccessRepository directly from passing a comma-separated string. Update this method signature (and any related typing) to match IAccessRepository and keep the Array.isArray branch meaningful.
| fileIds: Array<number>, | |
| fileIds: string | Array<number | string>, |
ChengShi-1
left a comment
There was a problem hiding this comment.
Thank you for changes here. It looks good
What this PR does / why we need it:
Which issue(s) this PR closes:
Related Dataverse PRs:
Special notes for your reviewer:
Suggestions on how to test this:
Is there a release notes or changelog update needed for this change?:
Additional documentation: