-
Notifications
You must be signed in to change notification settings - Fork 28
New Gem Architecture, rewrite #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This commit ports essential functionality from the main branch that was missing in the rewrite-part-1 branch, maintaining the new ActiveModel-style architecture: Upload API Implementation: - Add upload_client.rb base class for Upload API operations - Implement uploader_client.rb for file uploads, URL uploads, and file info - Add multipart_upload_client.rb for large file uploads with chunking - Create Uploader resource class with ActiveModel-style interface CDN & Security Features: - Add CnameGenerator for subdomain-based CDN optimization - Implement cdn_url methods in File and Group resources - Add signed URL generators (base class and Akamai implementation) - Update Configuration with CDN settings (cdn_base, use_subdomains, cdn_base_postfix) API Enhancements: - Add unified Api entry point class for backwards compatibility - Ensure batch operations (batch_store, batch_delete) are available - Verify copy operations (local_copy, remote_copy) are implemented All implementations follow the modernized pattern established in PR #177, providing a clean resource-based API while maintaining feature parity. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Description
This PR is a rewrite of the entire gem for version 5. We removed the dependencies with api_struct and rewrote all the API from scratch.
Here are the few additions made:
Uploadcare::File,Uploadcare::Groupetc) that contain all attributes and methods related to the resource (entity)Architecture
The gem follows a very standard structure of Clients for each API and Resources for each structure.
For example:
Uploadcare::File.listis going to trigger thelistmethod fromUploadcare::FileClientand stores the attributes in aPaginatedCollectioninsideUploadcare::FileMethod.Here's how it looks
For each endpoint, we have a
Clientclass with the method for the endpoint and aResourceclass with a method that uses the endpoint.TODOs