Skip to content

File + SDK Route Update - #55

Merged
UZ9 merged 1 commit into
mainfrom
ryder/file-and-analytics-sdk-update
Oct 20, 2025
Merged

UZ9 merged 1 commit into
mainfrom
ryder/file-and-analytics-sdk-update

Conversation

@UZ9

@UZ9 UZ9 commented Oct 20, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@UZ9
UZ9 merged commit b392c59 into main Oct 20, 2025
2 checks passed

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Disclaimer: This comment was AI-generated and is not necessarily completely accurate. Please take code comments with a grain of salt.

Greptile Overview

Summary

This PR updates the SDK with new API routes for email analytics and file service configuration, along with their corresponding TypeScript models.

Key Changes

  • Email Analytics API: Added emailControllerGetStatistics method to retrieve email statistics with filtering by date range, pagination, and aggregation interval
  • File Service Setup: Added fileConfigControllerSetup method to initialize file services for projects/environments
  • Authentication Fix: Fixed missing API_Key authentication check in fileConfigControllerGetFileConfigByProjectId method
  • New Models: Added support models for email statistics (SendEmailStatisticsResponse, SendEmailStatisticsResponses), file setup (SetupFileServiceResponse), and aggregation intervals (AggregateInterval enum)
  • Code Cleanup: Removed unused FileBucketResponse model and refactored ProjectResponses to use type declarations
  • Import Updates: Fixed import ordering in project.ts to accommodate model structure changes

Technical Details

The email statistics endpoint follows proper REST conventions with query parameters for filtering and pagination. Both new API methods implement consistent authentication patterns using the API_Key bearer token authentication. All models are auto-generated by OpenAPI Generator with proper serialization/deserialization mappings.

Confidence Score: 5/5

  • This PR is safe to merge with no blocking issues
  • All changes are auto-generated from OpenAPI specs with consistent patterns. The authentication fix improves security. No breaking changes to existing functionality. Models properly define types and serialization mappings.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/internal/api/emailApi.ts 5/5 Added new emailControllerGetStatistics method for retrieving email analytics with proper parameter validation and authentication
src/internal/api/fileConfigApi.ts 5/5 Added fileConfigControllerSetup method and fixed missing API_Key authentication in existing method
src/internal/model/sendEmailStatisticsResponse.ts 5/5 New model for individual email statistics with comprehensive metrics (clicks, opens, bounces, etc.)
src/internal/model/setupFileServiceResponse.ts 5/5 New model for file service setup response with success boolean

Sequence Diagram

sequenceDiagram
    participant Client
    participant EmailApi
    participant FileConfigApi
    participant Backend
    participant EmailService
    participant FileService

    Note over Client,FileService: Email Analytics Feature
    Client->>EmailApi: emailControllerGetStatistics(startDate, limit, offset, aggregatedBy, endDate)
    EmailApi->>EmailApi: Validate startDate parameter
    EmailApi->>EmailApi: Serialize query parameters
    EmailApi->>EmailApi: Apply API_Key authentication
    EmailApi->>Backend: GET /email/analytics
    Backend->>EmailService: Retrieve statistics
    EmailService-->>Backend: Email metrics data
    Backend-->>EmailApi: SendEmailStatisticsResponses
    EmailApi->>EmailApi: Deserialize response
    EmailApi-->>Client: Email statistics

    Note over Client,FileService: File Service Setup Feature
    Client->>FileConfigApi: fileConfigControllerSetup()
    FileConfigApi->>FileConfigApi: Apply API_Key authentication
    FileConfigApi->>Backend: POST /file/config/setup
    Backend->>FileService: Initialize file services
    FileService-->>Backend: Setup result
    Backend-->>FileConfigApi: SetupFileServiceResponse
    FileConfigApi->>FileConfigApi: Deserialize response
    FileConfigApi-->>Client: Setup success status

    Note over Client,FileService: Authentication Fix
    Client->>FileConfigApi: fileConfigControllerGetFileConfigByProjectId(projectId)
    FileConfigApi->>FileConfigApi: Check API_Key authentication (FIXED)
    FileConfigApi->>FileConfigApi: Apply authentication to request
    FileConfigApi->>Backend: GET /file/config/{projectId}
    Backend-->>FileConfigApi: FileConfigResponse
    FileConfigApi-->>Client: File configuration
Loading

10 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

1 participant