Skip to content

batch 7: refactor API versioning to use versioning-info module#3701

Open
abhandage wants to merge 2 commits intomainfrom
batch-7
Open

batch 7: refactor API versioning to use versioning-info module#3701
abhandage wants to merge 2 commits intomainfrom
batch-7

Conversation

@abhandage
Copy link
Copy Markdown
Contributor

This pull request introduces a standardized approach to managing API versioning across several destination integrations by extracting API version strings into dedicated constants and updating endpoint construction to use these constants. This improves maintainability and consistency when updating API versions in the future. Additionally, new versioning info files are added for each integration, and some minor formatting improvements are made.

The most important changes are:

API Versioning Standardization

  • Added new versioning info files (e.g., versioning-info.ts) for Amazon Conversions API, AVO Inspector, Engage Messaging SendGrid, Facebook Custom Audiences, Google Sheets, and Taboola integrations, each exporting a constant for the relevant API version. [1] [2] [3] [4] [5]
  • Updated all usages of hardcoded API version strings in endpoint URLs to reference the new constants, ensuring all requests use the centralized version value. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Amazon Conversions API Improvements

  • Added versioning-info.ts and updated the profiles and events endpoint URLs to use version constants, aligning with API documentation and simplifying future upgrades. [1] [2] [3]
  • Minor formatting changes for improved readability in validation and object property assignments. [1] [2]

Other Integrations

  • Applied the same versioning approach to AVO Inspector, Engage Messaging SendGrid, Google Sheets, and Taboola, updating endpoint construction and adding version constants. [1] [2] [3] [4] [5]

Documentation and Maintainability

  • Added JSDoc comments to each version constant, referencing the relevant API documentation for easier developer reference. [1] [2] [3] [4] [5]

Minor Cleanups

  • Improved code formatting and fixed some minor whitespace and line break issues for better readability. [1] [2] [3]

These changes collectively make the integrations more robust, easier to maintain, and ready for future API version upgrades.

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'

New Destination Checklist

  • Extracted all action API versions to verioning-info.ts file. example

Copy link
Copy Markdown
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

Refactors several destination integrations to standardize API version management by centralizing version strings into versioning-info.ts modules and updating request URL construction to reference those constants. This reduces scattered hardcoded versions and makes future version bumps more maintainable.

Changes:

  • Added versioning-info.ts modules exporting API version constants for multiple destinations.
  • Replaced hardcoded API version segments in endpoint URLs with imported constants.
  • Minor formatting/whitespace cleanup in a few touched files.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/destination-actions/src/destinations/tiktok-offline-conversions/versioning-info.ts Introduces centralized TikTok Offline Conversions API version constant.
packages/destination-actions/src/destinations/tiktok-offline-conversions/utils.ts Uses centralized API version when constructing track endpoint URL.
packages/destination-actions/src/destinations/tiktok-offline-conversions/index.ts Uses centralized API version for auth test endpoint URL; adds a named export.
packages/destination-actions/src/destinations/taboola-actions/versioning-info.ts Introduces centralized Taboola Backstage API version constant.
packages/destination-actions/src/destinations/taboola-actions/syncAudience/client.ts Uses centralized API version in audience onboarding URL.
packages/destination-actions/src/destinations/taboola-actions/index.ts Uses centralized API version in create audience onboarding URL.
packages/destination-actions/src/destinations/google-sheets/versioning-info.ts Introduces centralized Google Sheets API version constant.
packages/destination-actions/src/destinations/google-sheets/googleapis/index.ts Uses centralized API version for Sheets REST endpoints.
packages/destination-actions/src/destinations/facebook-custom-audiences/versioning-info.ts Adds version constants for Facebook Custom Audiences (currently not wired into the destination).
packages/destination-actions/src/destinations/engage-messaging-sendgrid/versioning-info.ts Introduces centralized SendGrid API version constant.
packages/destination-actions/src/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.ts Uses centralized API version in mail send endpoint URL.
packages/destination-actions/src/destinations/engage-messaging-sendgrid/index.ts Uses centralized API version in auth test endpoint URL.
packages/destination-actions/src/destinations/avo/versioning-info.ts Introduces centralized AVO Inspector endpoint version constant.
packages/destination-actions/src/destinations/avo/sendSchemaToInspector/index.ts Uses centralized API version in Inspector track endpoint URL.
packages/destination-actions/src/destinations/amazon-conversions-api/versioning-info.ts Introduces centralized versions for Amazon profiles/events endpoints.
packages/destination-actions/src/destinations/amazon-conversions-api/trackConversion/utils.ts Uses centralized events endpoint version in request URL; minor formatting cleanup.
packages/destination-actions/src/destinations/amazon-conversions-api/index.ts Uses centralized profiles endpoint version in auth test request URL; minor formatting cleanup.

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.

2 participants