Refactor Firebase Functions into logical modules#18
Conversation
- Extracted data access layer to models.js - Extracted Smart Home intent handlers to intents.js - Extracted utility functions to utils.js - Separated Express app configuration to server.js - Modernized code using async/await - Updated to use firebase-functions/v1 for compatibility with v7+ - Added ESLint configuration and fixed warnings Co-authored-by: yasu-hide <5038337+yasu-hide@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Added express-rate-limit dependency - Applied rate limiting middleware to authentication and Smart Home endpoints - Fixed CodeQL high severity vulnerabilities related to missing rate limiting on auth routes Co-authored-by: yasu-hide <5038337+yasu-hide@users.noreply.github.com>
The monolithic structure of the Firebase Functions has been refactored into several logical modules:
models.js: Handles all Firestore and Realtime Database interactions.intents.js: Contains the logic for Google Smart Home intents (SYNC,QUERY,EXECUTE).utils.js: Common utility functions likevaluniq,flatten, andshowError.server.js: Configures the Express application and routes.oauth2.js&oauth2_store.js: Refactored to useasync/await.The code has been modernized to use
async/awaitsyntax, improving readability and error handling. Compatibility issues withfirebase-functionsv7+ were addressed by explicitly using thev1API where necessary. An ESLint configuration was added to maintain code quality.PR created automatically by Jules for task 4422354086956148172 started by @yasu-hide