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',
| console.log('Processing payload: ', jsonItem) | ||
|
|
There was a problem hiding this comment.
Remove console.log('Processing payload:', jsonItem). This logs full event payloads (including identifiers / user data) to stdout, which can leak customer data and generate excessive noise in production. If diagnostics are needed, use the action logger with redaction and only log minimal metadata (or remove entirely).
| console.log('Processing payload: ', jsonItem) |
| pageLoadId?: string | ||
| referrerUr?: string | ||
| pageTitle?: string | ||
| keywords?: string | ||
| adStorageConsent?: string | ||
| dataProvider?: string |
There was a problem hiding this comment.
The request item type defines referrerUr?: string (missing the trailing l), but the field/mapping uses referrerUrl. This mismatch makes the type inaccurate and can hide bugs when building the request payload. Rename the interface property to referrerUrl (and verify any other references) to align with the mapped field name.
| adStorageConsent: adStorageConsent ?? settings.adStorageConsent, | ||
| eventSourceUrl: eventSourceUrl, | ||
| eventName: eventName, | ||
| dataProvider: dataProvider ?? 'SEGMENT', | ||
| userData: { |
There was a problem hiding this comment.
dataProvider behavior is added (defaulting to 'SEGMENT' when not provided), but there are existing unit tests for this action and none assert that dataProvider is sent correctly. Add tests covering (1) default behavior when omitted and (2) override behavior when a custom dataProvider is mapped, so future refactors don't break this field silently.
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