Skip to content

Implemented get all files sdk#77

Merged
llam36 merged 1 commit intomainfrom
akash/get-all-files
Apr 12, 2026
Merged

Implemented get all files sdk#77
llam36 merged 1 commit intomainfrom
akash/get-all-files

Conversation

@KashGiannis34
Copy link
Copy Markdown
Contributor

@KashGiannis34 KashGiannis34 commented Apr 12, 2026

Adds api functionality to view all the files in a bucket. Linked to GTBitsOfGood/juno#250

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 12, 2026

Greptile Summary

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[])"
Loading

Reviews (1): Last reviewed commit: "Implemented get all files sdk" | Re-trigger Greptile

Comment thread src/internal/apis/FileBucketApi.ts
Comment thread src/internal/apis/FileBucketApi.ts
Comment thread src/lib/file.ts
Copy link
Copy Markdown
Collaborator

@llam36 llam36 left a comment

Choose a reason for hiding this comment

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

lgtm

@llam36 llam36 merged commit 3db0573 into main Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants