Skip to content

Conversation

@abhandage
Copy link
Contributor

@abhandage abhandage commented Dec 15, 2025

This pull request introduces a standardized approach for managing and referencing API versions across multiple destination integrations. API version strings have been extracted into dedicated versioning-info.ts files for each destination, and all API requests now reference these constants. This improves maintainability and makes it easier to update API versions in the future. The changes affect Amazon Conversions API, Avo, Engage Messaging SendGrid, Facebook Custom Audiences, Google Sheets, Taboola Actions, and TikTok Offline Conversions destinations.

API Version Management Standardization

  • Extracted API version strings into new versioning-info.ts files for each destination and updated all API requests to use these constants instead of hardcoded values. This affects:
    • Amazon Conversions API (AMAZON_CONVERSIONS_API_PROFILES_VERSION, AMAZON_CONVERSIONS_API_EVENTS_VERSION) [1] [2] [3] [4] [5]
    • Avo (AVO_API_VERSION) [1] [2]
    • Engage Messaging SendGrid (ENGAGE_MESSAGING_SENDGRID_API_VERSION) [1] [2] [3] [4] [5]
    • Facebook Custom Audiences (FACEBOOK_CUSTOM_AUDIENCES_API_VERSION, FACEBOOK_CUSTOM_AUDIENCES_CANARY_API_VERSION) [1] [2]
    • Google Sheets (GOOGLE_SHEETS_API_VERSION) [1] [2] [3] [4] [5]
    • Taboola Actions (TABOOLA_API_VERSION) [1] [2] [3] [4] [5]
    • TikTok Offline Conversions (TIKTOK_OFFLINE_CONVERSIONS_API_VERSION) [1] [2]

Code Quality and Maintainability

  • Removed hardcoded API version strings from request URLs and replaced them with imported constants, making future updates easier and reducing the risk of inconsistencies. (All references above)

Minor Logic and Formatting Adjustments

  • Minor formatting improvements and logic clarifications in Amazon Conversions API event data preparation and request structure. [1] [2] [3] [4]

These changes collectively improve code maintainability, clarity, and consistency across the codebase.

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Security Review

Please ensure sensitive data is properly protected in your integration.

  • Reviewed all field definitions for sensitive data (API keys, tokens, passwords, client secrets) and confirmed they use type: 'password'

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors API version management across 7 destinations by extracting hardcoded version strings into centralized versioning-info.ts files. This improves maintainability and consistency by consolidating version declarations with API documentation references in a single location per destination.

Key Changes:

  • Created dedicated versioning-info.ts files for each destination containing version constants with JSDoc comments and API documentation links
  • Updated all hardcoded API version strings to use the centralized constants
  • Cleaned up outdated JSDoc comments and minor formatting issues

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/destination-actions/src/destinations/tiktok-offline-conversions/versioning-info.ts New file defining TIKTOK_OFFLINE_CONVERSIONS_API_VERSION ('v1.3') with API reference
packages/destination-actions/src/destinations/tiktok-offline-conversions/utils.ts Updated to use centralized version constant in API URL construction
packages/destination-actions/src/destinations/tiktok-offline-conversions/index.ts Imports and re-exports version constant, uses it in testAuthentication
packages/destination-actions/src/destinations/taboola-actions/versioning-info.ts New file defining TABOOLA_API_VERSION ('1.0') with API reference
packages/destination-actions/src/destinations/taboola-actions/syncAudience/client.ts Updated to use centralized version constant in API URL
packages/destination-actions/src/destinations/taboola-actions/index.ts Imports and uses version constant in createAudience endpoint
packages/destination-actions/src/destinations/google-sheets/versioning-info.ts New file defining GOOGLE_SHEETS_API_VERSION ('v4') with API reference
packages/destination-actions/src/destinations/google-sheets/googleapis/index.ts Replaced local API_VERSION constant with centralized version, updated all API URLs
packages/destination-actions/src/destinations/facebook-custom-audiences/versioning-info.ts New file defining API version ('v21.0') and canary version ('v21.0') with references
packages/destination-actions/src/destinations/facebook-custom-audiences/constants.ts Imports and assigns versioning constants from versioning-info.ts
packages/destination-actions/src/destinations/engage-messaging-sendgrid/versioning-info.ts New file defining ENGAGE_MESSAGING_SENDGRID_API_VERSION ('v3') with API reference
packages/destination-actions/src/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.ts Updated mail send endpoint to use centralized version constant
packages/destination-actions/src/destinations/engage-messaging-sendgrid/index.ts Updated testAuthentication endpoint to use centralized version constant
packages/destination-actions/src/destinations/avo/versioning-info.ts New file defining AVO_API_VERSION ('v1') with API reference
packages/destination-actions/src/destinations/avo/sendSchemaToInspector/index.ts Updated Inspector API endpoint to use centralized version constant
packages/destination-actions/src/destinations/amazon-conversions-api/versioning-info.ts New file defining separate versions for profiles ('v2') and events ('v1') endpoints
packages/destination-actions/src/destinations/amazon-conversions-api/trackConversion/utils.ts Updated events endpoint to use centralized version, removed outdated JSDoc param
packages/destination-actions/src/destinations/amazon-conversions-api/index.ts Updated profiles endpoint to use centralized version, removed trailing comma

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.04%. Comparing base (b362495) to head (23c1496).

Files with missing lines Patch % Lines
...s/src/destinations/amazon-conversions-api/index.ts 50.00% 1 Missing ⚠️
...rc/destinations/engage-messaging-sendgrid/index.ts 50.00% 1 Missing ⚠️
...c/destinations/tiktok-offline-conversions/index.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3477      +/-   ##
==========================================
+ Coverage   80.02%   80.04%   +0.01%     
==========================================
  Files        1226     1233       +7     
  Lines       22769    22789      +20     
  Branches     4525     4524       -1     
==========================================
+ Hits        18222    18242      +20     
  Misses       3711     3711              
  Partials      836      836              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants