-
Notifications
You must be signed in to change notification settings - Fork 293
Refactor API versioning to use constants from versioning-info module #3470
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
There was a problem hiding this 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 pull request introduces centralized API version management across multiple destination integrations by extracting hardcoded API version strings into dedicated versioning-info.ts files. This refactoring improves maintainability by establishing a single source of truth for API versions, making future updates easier and reducing the risk of inconsistencies across endpoints.
Key Changes:
- Created
versioning-info.tsfiles for TikTok Conversions, Salesforce Marketing Cloud, Google Enhanced Conversions, Facebook Conversions API, and Amplitude destinations - Updated all endpoint URL constructions to reference version constants instead of hardcoded strings
- Included minor code formatting improvements in Google Enhanced Conversions
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
packages/destination-actions/src/destinations/tiktok-conversions/versioning-info.ts |
Introduces API version constant (v1.3) with documentation |
packages/destination-actions/src/destinations/tiktok-conversions/reportWebEvent/utils.ts |
Updates event tracking endpoint to use version constant |
packages/destination-actions/src/destinations/salesforce-marketing-cloud/versioning-info.ts |
Defines three API version constants for auth (v2), data (v1), and hub (v1) APIs |
packages/destination-actions/src/destinations/salesforce-marketing-cloud/sfmc-operations.ts |
Refactors all API endpoint URLs to use version constants; includes whitespace cleanup in comments |
packages/destination-actions/src/destinations/salesforce-marketing-cloud/contact/index.ts |
Updates contact creation endpoint to use DATA_API_VERSION constant |
packages/destination-actions/src/destinations/salesforce-marketing-cloud/apiEvent/index.ts |
Updates event endpoint to use DATA_API_VERSION constant |
packages/destination-actions/src/destinations/google-enhanced-conversions/versioning-info.ts |
Defines API version (v19) and events API version (v1) constants |
packages/destination-actions/src/destinations/google-enhanced-conversions/postConversion/index.ts |
Updates event API endpoint to use version constant; includes comment whitespace fix |
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts |
Imports and uses API version constant; includes code formatting improvements for readability |
packages/destination-actions/src/destinations/facebook-conversions-api/versioning-info.ts |
Defines API version (21.0) and canary version (24.0) constants |
packages/destination-actions/src/destinations/facebook-conversions-api/constants.ts |
Imports and uses version constants from versioning-info |
packages/destination-actions/src/destinations/amplitude/versioning-info.ts |
Defines API version constant (2) for multiple endpoints |
packages/destination-actions/src/destinations/amplitude/regional-endpoints.ts |
Updates deletions, httpapi, and usersearch endpoints to use version constant |
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts
Show resolved
Hide resolved
packages/destination-actions/src/destinations/google-enhanced-conversions/functions.ts
Outdated
Show resolved
Hide resolved
packages/destination-actions/src/destinations/google-enhanced-conversions/versioning-info.ts
Outdated
Show resolved
Hide resolved
packages/destination-actions/src/destinations/salesforce-marketing-cloud/versioning-info.ts
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3470 +/- ##
==========================================
+ Coverage 80.02% 80.04% +0.01%
==========================================
Files 1226 1231 +5
Lines 22769 22785 +16
Branches 4525 4520 -5
==========================================
+ Hits 18222 18238 +16
Misses 3711 3711
Partials 836 836 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
This pull request introduces centralized API version management for several destination integrations by extracting API version strings into dedicated
versioning-info.tsfiles. This change improves maintainability and makes it easier to update API versions in the future. The most significant updates are grouped below by destination.Salesforce Marketing Cloud
versioning-info.tsand updated all API endpoint URLs insfmc-operations.ts,apiEvent/index.ts, andcontact/index.tsto use these constants. This ensures all Salesforce Marketing Cloud endpoints consistently reference the correct version. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Google Enhanced Conversions
versioning-info.tsto hold the API and events API versions, and updated all relevant endpoints infunctions.tsandpostConversion/index.tsto use these constants. [1] [2] [3] [4]functions.tsfor improved readability. [1] [2]Facebook Conversions API
versioning-info.tsand updated the constants file to use these values instead of hardcoded strings. [1] [2]TikTok Conversions
versioning-info.tsfile for the API version and updated the event tracking endpoint to use the version constant. [1] [2] [3]Amplitude
versioning-info.tsand updated endpoint URLs inregional-endpoints.tsto use the version constant. [1] [2] [3]These changes collectively make it easier to update API versions across these integrations and reduce the risk of inconsistencies or errors when endpoints change.