Dataprovider added in ms bing capi#3718
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for a dataProvider attribute in the Microsoft Bing CAPI destination action payload so events can declare the source of event data.
Changes:
- Adds
dataProviderto the action mapping schema and generated payload types. - Includes
dataProviderin the outbound Bing CAPI request item (defaulting toSEGMENT). - Updates request item typings to include
dataProvider.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/destination-actions/src/destinations/ms-bing-capi/sendEvent/types.ts | Adds dataProvider to the request item type (and touches nearby request field typings). |
| packages/destination-actions/src/destinations/ms-bing-capi/sendEvent/index.ts | Maps dataProvider into the request payload and sets a default. |
| packages/destination-actions/src/destinations/ms-bing-capi/sendEvent/generated-types.ts | Updates generated Payload typing/docs to include dataProvider. |
| packages/destination-actions/src/destinations/ms-bing-capi/sendEvent/fields.ts | Exposes dataProvider as an optional mapped field with default SEGMENT. |
Comments suppressed due to low confidence (1)
packages/destination-actions/src/destinations/ms-bing-capi/sendEvent/index.ts:44
...datais spreading the importeddataInputField definition (from./fields) into the outbound request item, not the payload'sdataobject. The destructuring at line 36 does not create adatavariable, so this will add keys likelabel,type,properties, etc. to the request body. Rename/alias the imported field (e.g.,import { data as dataField } ...and usefields: { data: dataField, ... }) and then bindconst { data = {} } = payloadso...datarefers to the payload data.
const {
data: { eventTime, eventType, adStorageConsent, eventSourceUrl, eventName, dataProvider } = {},
userData: { em, ph, ...restOfUserData } = {},
customData,
items,
hotelData
} = payload
const jsonItem: BingCAPIRequestItem = {
...data,
eventType: eventType as 'pageLoad' | 'custom',
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (53.84%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3718 +/- ##
==========================================
- Coverage 81.07% 80.88% -0.20%
==========================================
Files 1655 1347 -308
Lines 32078 25048 -7030
Branches 7096 5198 -1898
==========================================
- Hits 26008 20260 -5748
+ Misses 5097 3841 -1256
+ Partials 973 947 -26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… into STRATCONN-6726-capi-providername
| label: 'Cohort Owner Email', | ||
| description: 'The email of the user who will own the cohorts in Amplitude. This can be overriden per Audience, but if left blank, all cohorts will be owned by this user.', | ||
| description: | ||
| 'The email of the user who will own the cohorts in Amplitude. This can be overriden per Audience, but if left blank, all cohorts will be owned by this user.', |
There was a problem hiding this comment.
The setting description contains a misspelling: “overriden” should be “overridden”. Since this is user-facing copy, it’s worth correcting.
| 'The email of the user who will own the cohorts in Amplitude. This can be overriden per Audience, but if left blank, all cohorts will be owned by this user.', | |
| 'The email of the user who will own the cohorts in Amplitude. This can be overridden per Audience, but if left blank, all cohorts will be owned by this user.', |
| testAuthentication: (request, { settings }) => { | ||
| const { | ||
| endpoint, | ||
| default_owner_email | ||
| } = settings | ||
| const { endpoint, default_owner_email } = settings | ||
| const baseUrl = getEndpointByRegion('usersearch', endpoint) | ||
| return request(`${baseUrl}?user=${default_owner_email}`) | ||
| } |
There was a problem hiding this comment.
This PR’s stated purpose is adding dataProvider to Microsoft Bing CAPI, but it also includes formatting-only changes in the Amplitude Cohorts destination. To keep scope focused and reviews simpler, consider reverting these unrelated formatting changes (or moving them to a separate PR).
|
deployed |
In this PR, dataProvider key added in Microsoft BING CAPI.
JIRA ticket: https://twilio-engineering.atlassian.net/browse/STRATCONN-6726
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.
Security Review
Please ensure sensitive data is properly protected in your integration.
type: 'password'New Destination Checklist
verioning-info.tsfile. example