You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a getAllFiles endpoint to retrieve all files across every bucket for a given config ID. The implementation follows the existing credential-header pattern correctly, but uses Array<object> instead of the already-defined ModelFile type for both the internal API layer and the public SDK method, and the raw method omits the ModelFileFromJSON deserializer that all other array-returning methods in this file provide.
Checklist areas needing improvement:
Input is not validated for configId in getAllFiles (no validateString call, unlike deleteBucket / registerBucket)
Return types should use the ModelFile model instead of Array<object> for proper type safety
Confidence Score: 4/5
Not safe to merge as-is — response deserialization is broken and return types strip SDK type safety.
Two P1 findings in the internal API layer: ModelFileFromJSON is never called so the response items are not transformed, and the return type Array<object> discards all type information when a typed ModelFile model already exists. These should be fixed before merging.
src/internal/apis/FileBucketApi.ts needs the ModelFileFromJSON deserializer and correct return types; src/lib/file.ts needs to propagate the corrected ModelFile[] type.
Important Files Changed
Filename
Overview
src/internal/apis/FileBucketApi.ts
Adds fileBucketControllerGetAllFiles but uses Array<object> as the return type and omits the ModelFileFromJSON deserializer, breaking type safety and response transformation relative to existing methods.
src/lib/file.ts
Adds getAllFiles public SDK method following existing credential-header patterns, but propagates the untyped Array<object> return type from the internal API layer.
Sequence Diagram
sequenceDiagram
participant Caller
participant FileAPI as FileAPI
participant FileBucketApi as FileBucketApi
participant Server as Juno Server
Caller->>FileAPI: getAllFiles(configId, credentials?)
FileAPI->>FileAPI: "Build credential headers"
FileAPI->>FileBucketApi: fileBucketControllerGetAllFiles(configId, initOverrides)
FileBucketApi->>FileBucketApi: "Validate configId, set Authorization header"
FileBucketApi->>Server: "GET /file/all/{configId}"
Server-->>FileBucketApi: "JSON array response"
FileBucketApi-->>FileAPI: "Array of objects (untyped, missing ModelFileFromJSON)"
FileAPI-->>Caller: "Array of objects (should be ModelFile[])"
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
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.
Adds api functionality to view all the files in a bucket. Linked to GTBitsOfGood/juno#250