Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Sep 15, 2025

Add public URL support and remove deprecated preview URL functionality

Summary

This PR implements public URL generation support for file uploads and retrieval in the VlmRun Node.js SDK, mirroring changes from backend PR #1017. It also removes deprecated preview URL functionality based on PR feedback.

New Features:

  • Added generatePublicUrl?: boolean parameter to file upload (defaults to true)
  • Added isPublic?: boolean parameter to file get method
  • Added public_url?: string field to FileResponse and PresignedUrlResponse types
  • Comprehensive unit and integration test coverage

Breaking Changes:

  • Removed generateFilePreviewUrl() method from Files class
  • Removed preview_url field from PresignedUrlResponse interface
  • Removed PreviewUrlResponse interface entirely

Additional fixes:

  • Updated axios to 1.12.2 (security vulnerability fix)
  • Fixed TypeScript compilation error with error.cause casting

Review & Testing Checklist for Human

  • Test public URL generation end-to-end - Upload a file with generatePublicUrl: true and verify the returned public_url is accessible and serves the file content
  • Verify breaking changes are acceptable - Confirm removal of generateFilePreviewUrl() and preview_url field won't impact existing users severely
  • Test default behavior - Ensure generatePublicUrl defaulting to true is the desired behavior (this changes existing upload behavior)
  • Integration test with real API - Run npm run test:integration to verify SDK correctly communicates with backend API using the new parameters

Notes

- Add generatePublicUrl parameter to FileUploadParams
- Add isPublic parameter to Files.get method
- Add public_url field to FileResponse and PresignedUrlResponse
- Add comprehensive tests for new functionality
- Matches backend API changes from vlm-lab PR #1017

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 2 commits September 15, 2025 15:49
- Fixes high severity DoS vulnerability (GHSA-4hjh-wcwx-xvwj)
- Updates axios from <1.12.0 to 1.12.2
- Resolves CI security audit failure

Co-Authored-By: [email protected] <[email protected]>
- Use type assertion to access name property on error.cause
- Fixes compilation error introduced by axios 1.12.2 update
- Maintains existing error handling logic

Co-Authored-By: [email protected] <[email protected]>
devin-ai-integration bot and others added 3 commits September 17, 2025 06:56
- Remove preview_url field from PresignedUrlResponse interface
- Remove generateFilePreviewUrl function and PreviewUrlResponse interface
- Remove all related imports and test code
- Update integration test describe block name

Addresses PR feedback from Mirajul-Mohin

Co-Authored-By: [email protected] <[email protected]>
- Update version from 0.5.4 to 1.0.0
- Refactor Files class methods to improve parameter handling and consistency
- Update integration tests to reflect changes in public_url handling
…iles.test.ts

- Changed single quotes to double quotes for consistency across the test file.
- Enhanced readability of test cases by aligning formatting and structure.
- No functional changes were made to the tests or the underlying logic.
@shahrear33 shahrear33 merged commit 2443cbc into main Sep 17, 2025
3 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.

3 participants