diff --git a/README.md b/README.md index a9ee5ed374..8b1b3c8a95 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,13 @@ The JavaScript SDK lets you track customer event data from your website and send - [**Usage in Chrome Extensions**](#usage-in-chrome-extensions) - [**Usage in Serverless Runtimes**](#usage-in-serverless-runtimes) -| **IMPORTANT**: We have deprecated the service worker export from RudderStack JavaScript SDK npm package and decoupled it to a new package.
If you still wish to use it for your project, see [**@rudderstack/analytics-js-service-worker package**](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker). | -| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **IMPORTANT**: The service worker export has been deprecated from the RudderStack JavaScript SDK npm package and moved to a new package.
If you still wish to use it for your project, see [**@rudderstack/analytics-js-service-worker package**](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker). | +| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ## Installing the JavaScript SDK | For detailed installation steps, see the [JavaScript SDK documentation](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/installation/). | -| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | To integrate the JavaScript SDK with your website, place the following code snippet in the `` section of your website. @@ -104,14 +104,14 @@ import { RudderAnalytics } from '@rudderstack/analytics-js'; const rudderAnalytics = new RudderAnalytics(); rudderAnalytics.load(WRITE_KEY, DATA_PLANE_URL, {}); - -export { rudderAnalytics }; + +export { rudderAnalytics }; ``` - **For CJS using the `require` method**: ```javascript -var RudderAnalytics = require("@rudderstack/analytics-js"); +var RudderAnalytics = require('@rudderstack/analytics-js'); const rudderAnalytics = new RudderAnalytics(); rudderAnalytics.load(WRITE_KEY, DATA_PLANE_URL, {}); @@ -148,12 +148,14 @@ See [JavaScript SDK installation workflow](https://www.rudderstack.com/docs/sour | **Browser** | **Supported Versions** | | :-------------- | :--------------------- | -| Safari | v7 and above | -| IE | v11 and above | -| Edge | v80 and above | -| Mozilla Firefox | v47 and above | -| Chrome | v54 and above | -| Opera | v43 and above | +| **Browser** | **Supported Versions** | +| :-------------- | :--------------------- | +| Safari | v7 and above | +| IE | v11 and above | +| Edge | v80 and above | +| Mozilla Firefox | v47 and above | +| Chrome | v54 and above | +| Opera | v43 and above | > You can try adding the browser [polyfills](https://developer.mozilla.org/en-US/docs/Glossary/Polyfill) to your application if the SDK does not work on your browser. @@ -164,9 +166,9 @@ If you are migrating the JavaScript SDK from an older version (<=v1.1), see the ## Loading the SDK | For detailed information on the `load()` method, see the [**JavaScript SDK documentation**](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk/). | -| :----| +| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -You can load the JavaScript SDK using the `load` API method to track and send events from your website to RudderStack. Make sure to replace the write key and data plane URL with their actual values. +You can load the JavaScript SDK using the `load` API method to track and send events from your website to RudderStack. Make sure to replace the "write key" and data plane URL with their actual values. ```javascript rudderanalytics.load(, , [loadOptions]); @@ -195,25 +197,27 @@ The [`identify`](https://www.rudderstack.com/docs/sources/event-streams/sdks/rud A sample `identify` call is shown below: ```javascript -rudderanalytics.identify( - "1hKOmRA4el9Zt1WSfVJIVo4GRlm", { - firstName: "Alex", - lastName: "Keener", - email: "alex@example.com", - phone: "+1-202-555-0146" - }, { - page: { - path: "/best-seller/1", - referrer: "https://www.google.com/search?q=estore+bestseller", - search: "estore bestseller", - title: "The best sellers offered by EStore", - url: "https://www.estore.com/best-seller/1" - } - }, - () => { - console.log("identify call"); - } -); + rudderanalytics.identify( + '1hKOmRA4el9Zt1WSfVJIVo4GRlm', + { + firstName: 'Alex', + lastName: 'Keener', + email: 'alex@example.com', + phone: '+1-202-555-0146', + }, + { + page: { + path: '/best-seller/1', + referrer: 'https://www.google.com/search?q=estore+bestseller', + search: 'estore bestseller', + title: 'The best sellers offered by EStore', + url: 'https://www.estore.com/best-seller/1', + }, + }, + () => { + console.log('identify call'); + }, + ); ``` In the above example, the JavaScript SDK captures the user information like `userId`, `firstName`, `lastName`, `email`, and `phone`, along with the [**contextual information**](https://www.rudderstack.com/docs/event-spec/standard-events/common-fields/#contextual-fields). @@ -230,14 +234,15 @@ A sample `track` call is shown below: ```javascript rudderanalytics.track( - "Order Completed", { + 'Order Completed', + { revenue: 30, - currency: "USD", - user_actual_id: 12345 + currency: 'USD', + user_actual_id: 12345, }, () => { - console.log("track call"); - } + console.log('track call'); + }, ); ``` @@ -262,7 +267,7 @@ rudderanalytics.ready(() => { ## [](https://github.com/rudderlabs/rudder-sdk-js/blob/main/README.md#self-hosted-control-plane)Self-hosted control plane | **[Control Plane Lite](https://www.rudderstack.com/docs/get-started/rudderstack-open-source/control-plane-lite/) is now deprecated. It will not work with the latest rudder-server versions (after v1.2). Using [RudderStack Open Source](https://www.rudderstack.com/docs/get-started/rudderstack-open-source/control-plane-setup/#rudderstack-open-source) to set up your control plane is strongly recommended.** | -| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | If you are self-hosting the control plane using the [**Control Plane Lite**](https://www.rudderstack.com/docs/get-started/rudderstack-open-source/control-plane-lite/) utility, your `load` call will look like the following: diff --git a/packages/sanity-suite/__fixtures__/sourceConfig1.json b/packages/sanity-suite/__fixtures__/sourceConfig1.json index 8c169162e0..10e48e9634 100644 --- a/packages/sanity-suite/__fixtures__/sourceConfig1.json +++ b/packages/sanity-suite/__fixtures__/sourceConfig1.json @@ -15,7 +15,6 @@ }, "enabled": true, "workspaceId": "2L8FgwnU8Q4I4nQbdqmin8uP5n8", - "sourceDefinitionId": "1TW48i2bIzEl1HPf825cEznfIM8", "destinations": [ { "id": "2M2I7gZ9L474wHE0mzMdIo84gIK", @@ -32,51 +31,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1X6kXapk8Sf8yZTJn1dYZO3OXFt", "destinationDefinition": { - "id": "1X6kXapk8Sf8yZTJn1dYZO3OXFt", "name": "GTM", - "displayName": "Google Tag Manager", - "createdAt": "2020-01-30T08:46:11.787Z", - "updatedAt": "2024-02-22T03:31:39.813Z", - "config": { - "destConfig": { - "web": ["useNativeSDK", "consentManagement"], - "defaultConfig": [ - "containerID", - "serverUrl", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "oneTrustCookieCategories", - "ketchConsentPurposes" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "containerID", - "serverUrl", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "ketchConsentPurposes", - "consentManagement", - "eventFilteringOption" - ], - "transformAtV1": "processor", - "supportedSourceTypes": ["web"], - "supportedMessageTypes": { - "device": { - "web": ["identify", "track", "page"] - } - }, - "saveDestinationResponse": false, - "supportedConnectionModes": { - "web": ["device"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Google Tag Manager" }, "deleted": false, "createdAt": "2023-02-21T05:58:04.724Z", @@ -118,78 +74,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1X6kXNpFwP2NmnjWGuVWb8qoJ8L", "destinationDefinition": { - "id": "1X6kXNpFwP2NmnjWGuVWb8qoJ8L", "name": "GOOGLEADS", - "displayName": "Google Ads", - "createdAt": "2020-01-30T08:46:10.259Z", - "updatedAt": "2024-01-10T11:15:46.846Z", - "config": { - "destConfig": { - "web": ["useNativeSDK", "dynamicRemarketing"], - "defaultConfig": [ - "conversionID", - "eventMappingFromConfig", - "pageLoadConversions", - "clickEventConversions", - "defaultPageConversion", - "sendPageView", - "conversionLinker", - "dynamicRemarketing", - "trackConversions", - "enableConversionEventsFiltering", - "eventsToTrackConversions", - "trackDynamicRemarketing", - "enableDynamicRemarketingEventsFiltering", - "eventsToTrackDynamicRemarketing", - "disableAdPersonalization", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "allowEnhancedConversions", - "oneTrustCookieCategories", - "enableConversionLabel" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "conversionID", - "eventMappingFromConfig", - "pageLoadConversions", - "clickEventConversions", - "defaultPageConversion", - "sendPageView", - "conversionLinker", - "disableAdPersonalization", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "dynamicRemarketing", - "trackConversions", - "enableConversionEventsFiltering", - "eventsToTrackConversions", - "trackDynamicRemarketing", - "enableDynamicRemarketingEventsFiltering", - "eventsToTrackDynamicRemarketing", - "allowEnhancedConversions", - "enableConversionLabel" - ], - "transformAtV1": "processor", - "supportedSourceTypes": ["web"], - "supportedMessageTypes": { - "device": { - "web": ["identify", "track", "page"] - } - }, - "saveDestinationResponse": false, - "supportedConnectionModes": { - "web": ["device"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Google Ads" }, "deleted": false, "createdAt": "2023-02-22T10:00:54.605Z", @@ -215,46 +101,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1SxbQXdfQ2NzIdqNO3GceshF4V0", "destinationDefinition": { - "id": "1SxbQXdfQ2NzIdqNO3GceshF4V0", "name": "HOTJAR", - "displayName": "Hotjar", - "createdAt": "2019-10-31T07:49:37.450Z", - "updatedAt": "2024-02-22T03:31:36.973Z", - "config": { - "destConfig": { - "web": ["useNativeSDK", "connectionMode"], - "defaultConfig": [ - "siteID", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "oneTrustCookieCategories" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "siteID", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption" - ], - "transformAtV1": "processor", - "supportedSourceTypes": ["web"], - "supportedMessageTypes": { - "device": { - "web": ["identify", "track", "page"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "web": ["device"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Hotjar" }, "deleted": false, "createdAt": "2023-02-24T10:45:06.202Z", @@ -337,166 +185,8 @@ }, "destinationDefinitionId": "1QGzO4fWSyq3lsyFHf4eQAMDSr9", "destinationDefinition": { - "id": "1QGzO4fWSyq3lsyFHf4eQAMDSr9", "name": "AM", - "displayName": "Amplitude", - "createdAt": "2019-09-02T08:08:05.613Z", - "updatedAt": "2024-02-07T10:11:05.489Z", - "config": { - "destConfig": { - "ios": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "trackSessionEvents", - "useIdfaAsDeviceId" - ], - "web": [ - "useNativeSDK", - "connectionMode", - "preferAnonymousIdForDeviceId", - "attribution", - "eventUploadThreshold", - "eventUploadPeriodMillis", - "trackNewCampaigns", - "proxyServerUrl" - ], - "android": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId" - ], - "flutter": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId", - "useIdfaAsDeviceId" - ], - "reactnative": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId", - "useIdfaAsDeviceId" - ], - "defaultConfig": [ - "apiKey", - "groupTypeTrait", - "groupValueTrait", - "trackAllPages", - "trackCategorizedPages", - "trackNamedPages", - "traitsToIncrement", - "traitsToSetOnce", - "traitsToAppend", - "traitsToPrepend", - "trackProductsOnce", - "trackRevenuePerProduct", - "versionName", - "apiSecret", - "residencyServer", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "mapDeviceBrand", - "oneTrustCookieCategories", - "userProvidedPageEventString", - "useUserDefinedPageEventName", - "userProvidedScreenEventString", - "useUserDefinedScreenEventName" - ] - }, - "secretKeys": ["apiKey", "apiSecret"], - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "groupTypeTrait", - "groupValueTrait", - "trackAllPages", - "trackCategorizedPages", - "trackNamedPages", - "traitsToIncrement", - "traitsToSetOnce", - "traitsToAppend", - "traitsToPrepend", - "trackProductsOnce", - "trackRevenuePerProduct", - "preferAnonymousIdForDeviceId", - "versionName", - "enableLocationListening", - "useAdvertisingIdForDeviceId", - "trackSessionEvents", - "useIdfaAsDeviceId", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "mapDeviceBrand", - "residencyServer", - "userProvidedPageEventString", - "useUserDefinedPageEventName", - "attribution", - "eventUploadThreshold", - "eventUploadPeriodMillis", - "trackNewCampaigns", - "userProvidedScreenEventString", - "useUserDefinedScreenEventName", - "proxyServerUrl" - ], - "transformAtV1": "processor", - "isAudienceSupported": false, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportsVisualMapper": true, - "supportedMessageTypes": { - "cloud": ["alias", "group", "identify", "page", "screen", "track"], - "device": { - "ios": ["identify", "track", "screen"], - "web": ["identify", "track", "page", "group"], - "android": ["identify", "track", "screen"], - "flutter": ["identify", "track", "screen"], - "reactnative": ["identify", "track", "screen"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud", "device"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud", "device"], - "cordova": ["cloud"], - "flutter": ["cloud", "device"], - "shopify": ["cloud"], - "reactnative": ["cloud", "device"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Amplitude" }, "deleted": false, "createdAt": "2023-02-01T10:32:02.827Z", @@ -541,104 +231,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1XQoHKJnI6Uf67wN20RlvAQSUB9", "destinationDefinition": { - "id": "1XQoHKJnI6Uf67wN20RlvAQSUB9", "name": "BRAZE", - "displayName": "Braze", - "createdAt": "2020-02-06T11:13:09.246Z", - "updatedAt": "2024-02-07T10:11:17.187Z", - "config": { - "destConfig": { - "ios": ["useNativeSDK", "connectionMode"], - "web": [ - "useNativeSDK", - "enableBrazeLogging", - "connectionMode", - "enablePushNotification", - "allowUserSuppliedJavascript" - ], - "android": ["useNativeSDK", "connectionMode"], - "flutter": ["useNativeSDK", "connectionMode"], - "reactnative": ["useNativeSDK", "connectionMode"], - "defaultConfig": [ - "appKey", - "dataCenter", - "restApiKey", - "trackAnonymousUser", - "enableSubscriptionGroupInGroupCall", - "enableNestedArrayOperations", - "supportDedup", - "sendPurchaseEventWithExtraProperties", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "oneTrustCookieCategories" - ] - }, - "secretKeys": ["restApiKey"], - "excludeKeys": [], - "includeKeys": [ - "appKey", - "dataCenter", - "trackAnonymousUser", - "enableSubscriptionGroupInGroupCall", - "enableBrazeLogging", - "enableNestedArrayOperations", - "supportDedup", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "connectionMode", - "enablePushNotification", - "allowUserSuppliedJavascript" - ], - "transformAtV1": "router", - "isAudienceSupported": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportsVisualMapper": true, - "supportedMessageTypes": { - "cloud": ["group", "identify", "page", "screen", "track", "alias"], - "device": { - "ios": ["identify", "track"], - "web": ["identify", "track", "page"], - "android": ["identify", "track"], - "flutter": ["identify", "track"], - "reactnative": ["identify", "track"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud", "device", "hybrid"], - "web": ["cloud", "device", "hybrid"], - "unity": ["cloud"], - "android": ["cloud", "device", "hybrid"], - "cordova": ["cloud"], - "flutter": ["cloud", "device"], - "shopify": ["cloud"], - "reactnative": ["cloud", "device"] - }, - "hybridModeCloudEventsFilter": { - "web": { - "messageType": ["identify", "track", "page"] - } - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Braze" }, "deleted": false, "createdAt": "2023-02-16T09:11:05.665Z", @@ -689,10 +283,10 @@ ], "oneTrustCookieCategories": [ { - "oneTrustCookieCategory": "Analytical Cookies" + "oneTrustCookieCategory": "C0001" }, { - "oneTrustCookieCategory": "Functional Cookies" + "oneTrustCookieCategory": "C0003" } ], "eventFilteringOption": "blacklistedEvents", @@ -711,130 +305,8 @@ }, "destinationDefinitionId": "1QGzNyNSA4alXixnhDcq4C10ac2", "destinationDefinition": { - "id": "1QGzNyNSA4alXixnhDcq4C10ac2", "name": "GA", - "displayName": "Google Analytics", - "createdAt": "2019-09-02T08:08:04.178Z", - "updatedAt": "2024-01-10T11:15:27.521Z", - "config": { - "auth": { - "role": "google_analytics", - "type": "OAuth", - "provider": "Google", - "rudderScopes": ["delete"] - }, - "destConfig": { - "web": [ - "useNativeSDK", - "trackCategorizedPages", - "trackNamedPages", - "useRichEventNames", - "sampleRate", - "siteSpeedSampleRate", - "resetCustomDimensionsOnPage", - "setAllMappedProps", - "domain", - "optimize", - "useGoogleAmpClientId", - "namedTracker" - ], - "defaultConfig": [ - "trackingID", - "rudderDeleteAccountId", - "customMappings", - "doubleClick", - "enhancedLinkAttribution", - "includeSearch", - "dimensions", - "metrics", - "contentGroupings", - "enableServerSideIdentify", - "serverSideIdentifyEventCategory", - "serverSideIdentifyEventAction", - "anonymizeIp", - "enhancedEcommerce", - "nonInteraction", - "sendUserId", - "disableMd5", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "oneTrustCookieCategories", - "ketchConsentPurposes" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "trackingID", - "doubleClick", - "enhancedLinkAttribution", - "includeSearch", - "trackCategorizedPages", - "trackNamedPages", - "useRichEventNames", - "sampleRate", - "siteSpeedSampleRate", - "dimensions", - "metrics", - "resetCustomDimensionsOnPage", - "setAllMappedProps", - "contentGroupings", - "anonymizeIp", - "domain", - "enhancedEcommerce", - "nonInteraction", - "optimize", - "sendUserId", - "useGoogleAmpClientId", - "namedTracker", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "ketchConsentPurposes" - ], - "transformAtV1": "processor", - "isAudienceSupported": false, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportsVisualMapper": true, - "supportedMessageTypes": { - "cloud": ["identify", "page", "screen", "track"], - "device": { - "web": ["track", "page"] - } - }, - "saveDestinationResponse": false, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - } - }, - "responseRules": null, - "category": null, - "options": { - "deprecated": true, - "deprecationLabel": "Google sunsetted Google Analytics (UA). Please set up Google Analytics 4 instead" - } + "displayName": "Google Analytics" }, "deleted": false, "createdAt": "2023-02-16T08:46:10.062Z", @@ -842,7 +314,7 @@ "workspaceId": "2L8FgwnU8Q4I4nQbdqmin8uP5n8", "revisionId": "2YIk3OEzS8vCi5UWuy4P3HCmsWt", "secretConfig": {}, - "secretVersion": 24, + "secretVersion": 26, "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -887,108 +359,8 @@ }, "destinationDefinitionId": "1mQ0yXGAQM08MTdVxws7ENIPjYS", "destinationDefinition": { - "id": "1mQ0yXGAQM08MTdVxws7ENIPjYS", "name": "GA4", - "displayName": "Google Analytics 4 (GA4)", - "createdAt": "2020-12-31T10:32:41.062Z", - "updatedAt": "2024-02-07T10:11:06.608Z", - "config": { - "destConfig": { - "amp": ["consentManagement"], - "ios": ["useNativeSDK", "connectionMode", "consentManagement"], - "web": [ - "debugView", - "useNativeSDK", - "connectionMode", - "capturePageView", - "useNativeSDKToSend", - "extendPageViewParams", - "overrideClientAndSessionId", - "consentManagement" - ], - "unity": ["consentManagement"], - "android": ["useNativeSDK", "connectionMode", "consentManagement"], - "cordova": ["consentManagement"], - "flutter": ["consentManagement"], - "shopify": ["consentManagement"], - "reactnative": ["consentManagement"], - "defaultConfig": [ - "apiSecret", - "debugMode", - "typesOfClient", - "measurementId", - "firebaseAppId", - "whitelistedEvents", - "blacklistedEvents", - "eventFilteringOption", - "piiPropertiesToIgnore", - "oneTrustCookieCategories", - "ketchConsentPurposes" - ] - }, - "secretKeys": ["apiSecret"], - "excludeKeys": [], - "includeKeys": [ - "debugView", - "measurementId", - "connectionMode", - "capturePageView", - "whitelistedEvents", - "blacklistedEvents", - "useNativeSDKToSend", - "eventFilteringOption", - "extendPageViewParams", - "piiPropertiesToIgnore", - "overrideClientAndSessionId", - "oneTrustCookieCategories", - "ketchConsentPurposes", - "consentManagement" - ], - "transformAtV1": "processor", - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter", - "cordova", - "warehouse", - "shopify" - ], - "supportedMessageTypes": { - "cloud": ["track", "group", "page"], - "device": { - "ios": ["identify", "track", "screen"], - "web": ["identify", "track", "page", "group"], - "android": ["identify", "track", "screen"] - } - }, - "saveDestinationResponse": false, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud", "device"], - "web": ["cloud", "device", "hybrid"], - "unity": ["cloud"], - "android": ["cloud", "device"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - }, - "hybridModeCloudEventsFilter": { - "web": { - "messageType": ["track", "group"] - } - } - }, - "responseRules": null, - "category": null, - "options": { - "isBeta": true - } + "displayName": "Google Analytics 4 (GA4)" }, "deleted": false, "createdAt": "2023-02-16T08:13:54.021Z", @@ -996,7 +368,7 @@ "workspaceId": "2L8FgwnU8Q4I4nQbdqmin8uP5n8", "revisionId": "2XnaWugKhdZhMaaq5ZQwCSB0B18", "secretConfig": {}, - "secretVersion": 12, + "secretVersion": 14, "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -1016,77 +388,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1aIY8UDEW1vZJ6n21ZO9BmRHgAp", "destinationDefinition": { - "id": "1aIY8UDEW1vZJ6n21ZO9BmRHgAp", "name": "FULLSTORY", - "displayName": "Fullstory", - "createdAt": "2020-04-09T09:26:55.187Z", - "updatedAt": "2024-02-07T10:11:21.816Z", - "config": { - "destConfig": { - "ios": ["useNativeSDK", "connectionMode"], - "web": ["useNativeSDK", "connectionMode", "fs_debug_mode", "fs_host"], - "android": ["useNativeSDK", "connectionMode"], - "defaultConfig": [ - "apiKey", - "fs_org", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption" - ] - }, - "secretKeys": ["apiKey"], - "excludeKeys": [], - "includeKeys": [ - "fs_debug_mode", - "fs_org", - "fs_host", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption" - ], - "cdkV2Enabled": true, - "transformAtV1": "processor", - "supportedSourceTypes": [ - "web", - "android", - "ios", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportedMessageTypes": { - "cloud": ["track", "identify"], - "device": { - "ios": ["identify", "track", "screen"], - "web": ["identify", "track", "page"], - "android": ["identify", "track", "screen"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud", "device"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud", "device"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - } - }, - "responseRules": null, - "category": null, - "options": { - "isBeta": true - } + "displayName": "Fullstory" }, "deleted": false, "createdAt": "2023-02-22T10:22:26.012Z", @@ -1119,85 +422,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1kFwq1W6mIA0COSvz7Zmqsn1DFB", "destinationDefinition": { - "id": "1kFwq1W6mIA0COSvz7Zmqsn1DFB", "name": "POSTHOG", - "displayName": "PostHog", - "createdAt": "2020-11-13T23:23:54.789Z", - "updatedAt": "2024-01-10T11:15:40.522Z", - "config": { - "destConfig": { - "web": [ - "useNativeSDK", - "autocapture", - "capturePageView", - "disableSessionRecording", - "propertyBlackList", - "xhrHeaders", - "enableLocalStoragePersistence" - ], - "defaultConfig": [ - "teamApiKey", - "yourInstance", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "useV2Group", - "oneTrustCookieCategories" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "teamApiKey", - "yourInstance", - "autocapture", - "capturePageView", - "disableSessionRecording", - "propertyBlackList", - "xhrHeaders", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "enableLocalStoragePersistence", - "eventFilteringOption", - "useV2Group" - ], - "transformAtV1": "processor", - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportedMessageTypes": { - "cloud": ["alias", "group", "identify", "page", "screen", "track"], - "device": { - "web": ["identify", "track", "page", "group"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "PostHog" }, "deleted": false, "createdAt": "2023-02-22T10:08:03.129Z", @@ -1244,90 +470,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1aIXpsUVMU38nBFIE4QTiZu9Vxo", "destinationDefinition": { - "id": "1aIXpsUVMU38nBFIE4QTiZu9Vxo", "name": "FACEBOOK_PIXEL", - "displayName": "Facebook Pixel", - "createdAt": "2020-04-09T09:24:27.173Z", - "updatedAt": "2024-01-10T11:15:33.215Z", - "config": { - "destConfig": { - "web": ["useNativeSDK", "legacyConversionPixelId", "connectionMode"], - "defaultConfig": [ - "blacklistPiiProperties", - "categoryToContent", - "pixelId", - "eventsToEvents", - "valueFieldIdentifier", - "advancedMapping", - "whitelistPiiProperties", - "limitedDataUSage", - "accessToken", - "testDestination", - "testEventCode", - "standardPageCall", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "removeExternalId", - "useUpdatedMapping", - "oneTrustCookieCategories", - "ketchConsentPurposes" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "blacklistPiiProperties", - "categoryToContent", - "pixelId", - "eventsToEvents", - "valueFieldIdentifier", - "advancedMapping", - "legacyConversionPixelId", - "whitelistPiiProperties", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "useUpdatedMapping", - "ketchConsentPurposes" - ], - "transformAtV1": "processor", - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportedMessageTypes": { - "cloud": ["identify", "page", "screen", "track"], - "device": { - "web": ["track", "page"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Facebook Pixel" }, "deleted": false, "createdAt": "2023-02-24T08:10:30.371Z", @@ -1346,19 +490,6 @@ "eventUpload": false, "eventUploadTS": 1701447148443 }, - "sourceDefinition": { - "options": null, - "config": null, - "configSchema": null, - "uiConfig": null, - "id": "1TW48i2bIzEl1HPf825cEznfIM8", - "name": "Javascript", - "displayName": "Javascript", - "category": null, - "type": "web", - "createdAt": "2019-11-12T12:39:19.885Z", - "updatedAt": "2023-05-16T11:52:25.474Z" - }, "createdBy": "2L8FbTcYcIvlgFogsQmGiX4gxX8", "secretVersion": null, "connections": [ diff --git a/packages/sanity-suite/__fixtures__/sourceConfigDMT1.json b/packages/sanity-suite/__fixtures__/sourceConfigDMT1.json index 45bfb9601d..62e0eb3665 100644 --- a/packages/sanity-suite/__fixtures__/sourceConfigDMT1.json +++ b/packages/sanity-suite/__fixtures__/sourceConfigDMT1.json @@ -15,7 +15,6 @@ }, "enabled": true, "workspaceId": "1xXCSVsmPjqFKhRlpajnDXkGwYX", - "sourceDefinitionId": "1TW48i2bIzEl1HPf825cEznfIM8", "destinations": [ { "id": "20Pa0T3VoQZZYPgh5LQS2vuwg3N", @@ -84,164 +83,8 @@ }, "destinationDefinitionId": "1QGzO4fWSyq3lsyFHf4eQAMDSr9", "destinationDefinition": { - "id": "1QGzO4fWSyq3lsyFHf4eQAMDSr9", "name": "AM", - "displayName": "Amplitude", - "createdAt": "2019-09-02T08:08:05.613Z", - "updatedAt": "2023-12-14T08:23:40.261Z", - "config": { - "destConfig": { - "ios": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "trackSessionEvents", - "useIdfaAsDeviceId" - ], - "web": [ - "useNativeSDK", - "connectionMode", - "preferAnonymousIdForDeviceId", - "attribution", - "eventUploadThreshold", - "eventUploadPeriodMillis", - "trackNewCampaigns" - ], - "android": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId" - ], - "flutter": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId", - "useIdfaAsDeviceId" - ], - "reactnative": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId", - "useIdfaAsDeviceId" - ], - "defaultConfig": [ - "apiKey", - "groupTypeTrait", - "groupValueTrait", - "trackAllPages", - "trackCategorizedPages", - "trackNamedPages", - "traitsToIncrement", - "traitsToSetOnce", - "traitsToAppend", - "traitsToPrepend", - "trackProductsOnce", - "trackRevenuePerProduct", - "versionName", - "apiSecret", - "residencyServer", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "mapDeviceBrand", - "oneTrustCookieCategories", - "userProvidedPageEventString", - "useUserDefinedPageEventName", - "userProvidedScreenEventString", - "useUserDefinedScreenEventName" - ] - }, - "secretKeys": ["apiKey", "apiSecret"], - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "groupTypeTrait", - "groupValueTrait", - "trackAllPages", - "trackCategorizedPages", - "trackNamedPages", - "traitsToIncrement", - "traitsToSetOnce", - "traitsToAppend", - "traitsToPrepend", - "trackProductsOnce", - "trackRevenuePerProduct", - "preferAnonymousIdForDeviceId", - "versionName", - "enableLocationListening", - "useAdvertisingIdForDeviceId", - "trackSessionEvents", - "useIdfaAsDeviceId", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "mapDeviceBrand", - "residencyServer", - "userProvidedPageEventString", - "useUserDefinedPageEventName", - "attribution", - "eventUploadThreshold", - "eventUploadPeriodMillis", - "trackNewCampaigns", - "userProvidedScreenEventString", - "useUserDefinedScreenEventName" - ], - "transformAtV1": "processor", - "isAudienceSupported": false, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportsVisualMapper": true, - "supportedMessageTypes": { - "cloud": ["alias", "group", "identify", "page", "screen", "track"], - "device": { - "ios": ["identify", "track", "page", "group"], - "web": ["identify", "track", "page", "group"], - "android": ["identify", "track", "page", "group"], - "flutter": ["identify", "track", "page", "group"], - "reactnative": ["identify", "track", "page", "group"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud", "device"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud", "device"], - "cordova": ["cloud"], - "flutter": ["cloud", "device"], - "shopify": ["cloud"], - "reactnative": ["cloud", "device"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Amplitude" }, "deleted": false, "createdAt": "2021-11-03T14:07:33.995Z", @@ -301,130 +144,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1QGzNyNSA4alXixnhDcq4C10ac2", "destinationDefinition": { - "id": "1QGzNyNSA4alXixnhDcq4C10ac2", "name": "GA", - "displayName": "Google Analytics", - "createdAt": "2019-09-02T08:08:04.178Z", - "updatedAt": "2023-12-14T08:23:41.909Z", - "config": { - "auth": { - "role": "google_analytics", - "type": "OAuth", - "provider": "Google", - "rudderScopes": ["delete"] - }, - "destConfig": { - "web": [ - "useNativeSDK", - "trackCategorizedPages", - "trackNamedPages", - "useRichEventNames", - "sampleRate", - "siteSpeedSampleRate", - "resetCustomDimensionsOnPage", - "setAllMappedProps", - "domain", - "optimize", - "useGoogleAmpClientId", - "namedTracker" - ], - "defaultConfig": [ - "trackingID", - "rudderDeleteAccountId", - "customMappings", - "doubleClick", - "enhancedLinkAttribution", - "includeSearch", - "dimensions", - "metrics", - "contentGroupings", - "enableServerSideIdentify", - "serverSideIdentifyEventCategory", - "serverSideIdentifyEventAction", - "anonymizeIp", - "enhancedEcommerce", - "nonInteraction", - "sendUserId", - "disableMd5", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "oneTrustCookieCategories", - "ketchConsentPurposes" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "trackingID", - "doubleClick", - "enhancedLinkAttribution", - "includeSearch", - "trackCategorizedPages", - "trackNamedPages", - "useRichEventNames", - "sampleRate", - "siteSpeedSampleRate", - "dimensions", - "metrics", - "resetCustomDimensionsOnPage", - "setAllMappedProps", - "contentGroupings", - "anonymizeIp", - "domain", - "enhancedEcommerce", - "nonInteraction", - "optimize", - "sendUserId", - "useGoogleAmpClientId", - "namedTracker", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "ketchConsentPurposes" - ], - "transformAtV1": "processor", - "isAudienceSupported": false, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportsVisualMapper": true, - "supportedMessageTypes": { - "cloud": ["identify", "page", "screen", "track"], - "device": { - "web": ["track", "page"] - } - }, - "saveDestinationResponse": false, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - } - }, - "responseRules": null, - "category": null, - "options": { - "deprecated": true, - "deprecationLabel": "Google sunsetted Google Analytics (UA). Please set up Google Analytics 4 instead" - } + "displayName": "Google Analytics" }, "deleted": false, "createdAt": "2022-09-29T12:38:32.756Z", @@ -469,118 +190,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1QmWaiefYgYqxl9JGUe5PQio6bx", "destinationDefinition": { - "id": "1QmWaiefYgYqxl9JGUe5PQio6bx", "name": "MP", - "displayName": "Mixpanel", - "createdAt": "2019-09-13T12:05:16.230Z", - "updatedAt": "2023-12-14T08:23:24.633Z", - "config": { - "destConfig": { - "web": ["useNativeSDK"], - "defaultConfig": [ - "token", - "groupKeySettings", - "apiSecret", - "dataResidency", - "people", - "setAllTraitsByDefault", - "superProperties", - "setOnceProperties", - "peopleProperties", - "eventIncrements", - "propIncrements", - "consolidatedPageCalls", - "trackCategorizedPages", - "trackNamedPages", - "sourceName", - "crossSubdomainCookie", - "persistence", - "persistenceType", - "persistenceName", - "secureCookie", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "useNewMapping", - "serviceAccountUserName", - "serviceAccountSecret", - "projectId", - "oneTrustCookieCategories", - "ketchConsentPurposes", - "identityMergeApi", - "userDeletionApi", - "gdprApiToken", - "strictMode", - "ignoreDnt" - ] - }, - "secretKeys": ["token", "gdprApiToken"], - "excludeKeys": [], - "includeKeys": [ - "token", - "groupKeySettings", - "apiSecret", - "dataResidency", - "people", - "setAllTraitsByDefault", - "superProperties", - "setOnceProperties", - "peopleProperties", - "eventIncrements", - "propIncrements", - "consolidatedPageCalls", - "trackCategorizedPages", - "trackNamedPages", - "sourceName", - "crossSubdomainCookie", - "persistence", - "persistenceType", - "persistenceName", - "secureCookie", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "ketchConsentPurposes", - "eventFilteringOption", - "identityMergeApi", - "ignoreDnt" - ], - "transformAtV1": "router", - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportedMessageTypes": { - "cloud": ["alias", "group", "identify", "page", "screen", "track"], - "device": { - "web": ["identify", "track", "page", "group", "alias"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Mixpanel" }, "deleted": false, "createdAt": "2023-04-19T11:48:36.192Z", @@ -599,19 +210,6 @@ "eventUpload": false, "eventUploadTS": 1690980174175 }, - "sourceDefinition": { - "options": null, - "config": null, - "configSchema": null, - "uiConfig": null, - "id": "1TW48i2bIzEl1HPf825cEznfIM8", - "name": "Javascript", - "displayName": "Javascript", - "category": null, - "type": "web", - "createdAt": "2019-11-12T12:39:19.885Z", - "updatedAt": "2023-05-16T11:52:25.474Z" - }, "createdBy": "1xXC9Q9pYMrw0OON9Aw2AFeBsUp", "secretVersion": null, "connections": [ diff --git a/packages/sanity-suite/__fixtures__/sourceConfigDev1.json b/packages/sanity-suite/__fixtures__/sourceConfigDev1.json index 40105e9240..30b2af0250 100644 --- a/packages/sanity-suite/__fixtures__/sourceConfigDev1.json +++ b/packages/sanity-suite/__fixtures__/sourceConfigDev1.json @@ -15,7 +15,6 @@ }, "enabled": true, "workspaceId": "2L5wIAEaAi3Tbrqq5kG4C06U01X", - "sourceDefinitionId": "2CCxgViQJACgWABA6h83wlXnE1k", "destinations": [ { "id": "2L5yPlp2MHnx0DWaC2SafwM87dY", @@ -80,164 +79,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1Q8kZdhlglB9q8gsD4xryMyWg1i", "destinationDefinition": { - "id": "1Q8kZdhlglB9q8gsD4xryMyWg1i", "name": "AM", - "displayName": "Amplitude", - "createdAt": "2019-08-30T10:07:47.170Z", - "updatedAt": "2024-01-04T07:52:30.774Z", - "config": { - "destConfig": { - "ios": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "trackSessionEvents", - "useIdfaAsDeviceId" - ], - "web": [ - "useNativeSDK", - "connectionMode", - "preferAnonymousIdForDeviceId", - "attribution", - "eventUploadThreshold", - "eventUploadPeriodMillis", - "trackNewCampaigns" - ], - "android": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId" - ], - "flutter": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId", - "useIdfaAsDeviceId" - ], - "reactnative": [ - "eventUploadPeriodMillis", - "eventUploadThreshold", - "useNativeSDK", - "connectionMode", - "enableLocationListening", - "trackSessionEvents", - "useAdvertisingIdForDeviceId", - "useIdfaAsDeviceId" - ], - "defaultConfig": [ - "apiKey", - "groupTypeTrait", - "groupValueTrait", - "trackAllPages", - "trackCategorizedPages", - "trackNamedPages", - "traitsToIncrement", - "traitsToSetOnce", - "traitsToAppend", - "traitsToPrepend", - "trackProductsOnce", - "trackRevenuePerProduct", - "versionName", - "apiSecret", - "residencyServer", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "mapDeviceBrand", - "oneTrustCookieCategories", - "userProvidedPageEventString", - "useUserDefinedPageEventName", - "userProvidedScreenEventString", - "useUserDefinedScreenEventName" - ] - }, - "secretKeys": ["apiKey", "apiSecret"], - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "groupTypeTrait", - "groupValueTrait", - "trackAllPages", - "trackCategorizedPages", - "trackNamedPages", - "traitsToIncrement", - "traitsToSetOnce", - "traitsToAppend", - "traitsToPrepend", - "trackProductsOnce", - "trackRevenuePerProduct", - "preferAnonymousIdForDeviceId", - "versionName", - "enableLocationListening", - "useAdvertisingIdForDeviceId", - "trackSessionEvents", - "useIdfaAsDeviceId", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "mapDeviceBrand", - "residencyServer", - "userProvidedPageEventString", - "useUserDefinedPageEventName", - "attribution", - "eventUploadThreshold", - "eventUploadPeriodMillis", - "trackNewCampaigns", - "userProvidedScreenEventString", - "useUserDefinedScreenEventName" - ], - "transformAtV1": "processor", - "isAudienceSupported": false, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportsVisualMapper": true, - "supportedMessageTypes": { - "cloud": ["alias", "group", "identify", "page", "screen", "track"], - "device": { - "ios": ["identify", "track", "page", "group"], - "web": ["identify", "track", "page", "group"], - "android": ["identify", "track", "page", "group"], - "flutter": ["identify", "track", "page", "group"], - "reactnative": ["identify", "track", "page", "group"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud", "device"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud", "device"], - "cordova": ["cloud"], - "flutter": ["cloud", "device"], - "shopify": ["cloud"], - "reactnative": ["cloud", "device"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Amplitude" }, "deleted": false, "createdAt": "2023-01-31T14:26:56.685Z", @@ -282,130 +125,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1Q8kZOyJE87ECoQ8kc26TOpgpXl", "destinationDefinition": { - "id": "1Q8kZOyJE87ECoQ8kc26TOpgpXl", "name": "GA", - "displayName": "Google Analytics", - "createdAt": "2019-08-30T10:07:45.868Z", - "updatedAt": "2024-01-04T07:52:23.645Z", - "config": { - "auth": { - "role": "google_analytics", - "type": "OAuth", - "provider": "Google", - "rudderScopes": ["delete"] - }, - "destConfig": { - "web": [ - "useNativeSDK", - "trackCategorizedPages", - "trackNamedPages", - "useRichEventNames", - "sampleRate", - "siteSpeedSampleRate", - "resetCustomDimensionsOnPage", - "setAllMappedProps", - "domain", - "optimize", - "useGoogleAmpClientId", - "namedTracker" - ], - "defaultConfig": [ - "trackingID", - "rudderDeleteAccountId", - "customMappings", - "doubleClick", - "enhancedLinkAttribution", - "includeSearch", - "dimensions", - "metrics", - "contentGroupings", - "enableServerSideIdentify", - "serverSideIdentifyEventCategory", - "serverSideIdentifyEventAction", - "anonymizeIp", - "enhancedEcommerce", - "nonInteraction", - "sendUserId", - "disableMd5", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "oneTrustCookieCategories", - "ketchConsentPurposes" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "trackingID", - "doubleClick", - "enhancedLinkAttribution", - "includeSearch", - "trackCategorizedPages", - "trackNamedPages", - "useRichEventNames", - "sampleRate", - "siteSpeedSampleRate", - "dimensions", - "metrics", - "resetCustomDimensionsOnPage", - "setAllMappedProps", - "contentGroupings", - "anonymizeIp", - "domain", - "enhancedEcommerce", - "nonInteraction", - "optimize", - "sendUserId", - "useGoogleAmpClientId", - "namedTracker", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "ketchConsentPurposes" - ], - "transformAtV1": "processor", - "isAudienceSupported": false, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportsVisualMapper": true, - "supportedMessageTypes": { - "cloud": ["identify", "page", "screen", "track"], - "device": { - "web": ["track", "page"] - } - }, - "saveDestinationResponse": false, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - } - }, - "responseRules": null, - "category": null, - "options": { - "deprecated": true, - "deprecationLabel": "Google sunsetted Google Analytics (UA). Please set up Google Analytics 4 instead" - } + "displayName": "Google Analytics" }, "deleted": false, "createdAt": "2023-07-17T04:28:07.671Z", @@ -450,90 +171,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1aHtCsG9wxv4i3a6gtDdbSxYg8m", "destinationDefinition": { - "id": "1aHtCsG9wxv4i3a6gtDdbSxYg8m", "name": "FACEBOOK_PIXEL", - "displayName": "Facebook Pixel", - "createdAt": "2020-04-09T03:50:22.245Z", - "updatedAt": "2024-01-04T07:54:10.390Z", - "config": { - "destConfig": { - "web": ["useNativeSDK", "legacyConversionPixelId", "connectionMode"], - "defaultConfig": [ - "blacklistPiiProperties", - "categoryToContent", - "pixelId", - "eventsToEvents", - "valueFieldIdentifier", - "advancedMapping", - "whitelistPiiProperties", - "limitedDataUSage", - "accessToken", - "testDestination", - "testEventCode", - "standardPageCall", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "removeExternalId", - "useUpdatedMapping", - "oneTrustCookieCategories", - "ketchConsentPurposes" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "blacklistPiiProperties", - "categoryToContent", - "pixelId", - "eventsToEvents", - "valueFieldIdentifier", - "advancedMapping", - "legacyConversionPixelId", - "whitelistPiiProperties", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "useUpdatedMapping", - "ketchConsentPurposes" - ], - "transformAtV1": "processor", - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportedMessageTypes": { - "cloud": ["identify", "page", "screen", "track"], - "device": { - "web": ["track", "page"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud"], - "web": ["cloud", "device"], - "unity": ["cloud"], - "android": ["cloud"], - "cordova": ["cloud"], - "flutter": ["cloud"], - "shopify": ["cloud"], - "reactnative": ["cloud"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Facebook Pixel" }, "deleted": false, "createdAt": "2023-11-06T04:25:09.799Z", @@ -570,104 +209,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1eM0CHgYSVDHntxZDwNoDmzuUQi", "destinationDefinition": { - "id": "1eM0CHgYSVDHntxZDwNoDmzuUQi", "name": "BRAZE", - "displayName": "Braze", - "createdAt": "2020-07-07T10:00:24.586Z", - "updatedAt": "2024-01-05T14:31:18.621Z", - "config": { - "destConfig": { - "ios": ["useNativeSDK", "connectionMode"], - "web": [ - "useNativeSDK", - "enableBrazeLogging", - "connectionMode", - "enablePushNotification", - "allowUserSuppliedJavascript" - ], - "android": ["useNativeSDK", "connectionMode"], - "flutter": ["useNativeSDK", "connectionMode"], - "reactnative": ["useNativeSDK", "connectionMode"], - "defaultConfig": [ - "appKey", - "dataCenter", - "restApiKey", - "trackAnonymousUser", - "enableSubscriptionGroupInGroupCall", - "enableNestedArrayOperations", - "supportDedup", - "sendPurchaseEventWithExtraProperties", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "oneTrustCookieCategories" - ] - }, - "secretKeys": ["restApiKey"], - "excludeKeys": [], - "includeKeys": [ - "appKey", - "dataCenter", - "trackAnonymousUser", - "enableSubscriptionGroupInGroupCall", - "enableBrazeLogging", - "enableNestedArrayOperations", - "supportDedup", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "connectionMode", - "enablePushNotification", - "allowUserSuppliedJavascript" - ], - "transformAtV1": "router", - "isAudienceSupported": true, - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova", - "shopify" - ], - "supportsVisualMapper": true, - "supportedMessageTypes": { - "cloud": ["group", "identify", "page", "screen", "track", "alias"], - "device": { - "ios": ["identify", "track", "page"], - "web": ["identify", "track", "page"], - "android": ["identify", "track", "page"], - "flutter": ["identify", "track", "page"], - "reactnative": ["identify", "track", "page"] - } - }, - "saveDestinationResponse": true, - "supportedConnectionModes": { - "amp": ["cloud"], - "ios": ["cloud", "device", "hybrid"], - "web": ["cloud", "device", "hybrid"], - "unity": ["cloud"], - "android": ["cloud", "device", "hybrid"], - "cordova": ["cloud"], - "flutter": ["cloud", "device"], - "shopify": ["cloud"], - "reactnative": ["cloud", "device"] - }, - "hybridModeCloudEventsFilter": { - "web": { - "messageType": ["identify", "track", "page"] - } - } - }, - "responseRules": {}, - "category": null, - "options": {} + "displayName": "Braze" }, "deleted": false, "createdAt": "2023-11-06T04:28:57.375Z", @@ -709,78 +252,8 @@ "liveEventsConfig": {}, "destinationDefinitionId": "1WKMf5COr1KBI6PmVxuc9zaR7DV", "destinationDefinition": { - "id": "1WKMf5COr1KBI6PmVxuc9zaR7DV", "name": "GOOGLEADS", - "displayName": "Google Ads", - "createdAt": "2020-01-13T05:38:52.604Z", - "updatedAt": "2024-01-08T14:44:03.124Z", - "config": { - "destConfig": { - "web": ["useNativeSDK", "dynamicRemarketing"], - "defaultConfig": [ - "conversionID", - "eventMappingFromConfig", - "pageLoadConversions", - "clickEventConversions", - "defaultPageConversion", - "sendPageView", - "conversionLinker", - "dynamicRemarketing", - "trackConversions", - "enableConversionEventsFiltering", - "eventsToTrackConversions", - "trackDynamicRemarketing", - "enableDynamicRemarketingEventsFiltering", - "eventsToTrackDynamicRemarketing", - "disableAdPersonalization", - "blacklistedEvents", - "whitelistedEvents", - "eventFilteringOption", - "allowEnhancedConversions", - "oneTrustCookieCategories", - "enableConversionLabel" - ] - }, - "secretKeys": [], - "excludeKeys": [], - "includeKeys": [ - "conversionID", - "eventMappingFromConfig", - "pageLoadConversions", - "clickEventConversions", - "defaultPageConversion", - "sendPageView", - "conversionLinker", - "disableAdPersonalization", - "blacklistedEvents", - "whitelistedEvents", - "oneTrustCookieCategories", - "eventFilteringOption", - "dynamicRemarketing", - "trackConversions", - "enableConversionEventsFiltering", - "eventsToTrackConversions", - "trackDynamicRemarketing", - "enableDynamicRemarketingEventsFiltering", - "eventsToTrackDynamicRemarketing", - "allowEnhancedConversions", - "enableConversionLabel" - ], - "transformAtV1": "processor", - "supportedSourceTypes": ["web"], - "supportedMessageTypes": { - "device": { - "web": ["identify", "track", "page"] - } - }, - "saveDestinationResponse": false, - "supportedConnectionModes": { - "web": ["device"] - } - }, - "responseRules": null, - "category": null, - "options": null + "displayName": "Google Ads" }, "deleted": false, "createdAt": "2023-11-06T04:31:11.813Z", @@ -796,19 +269,6 @@ "updatedAt": "2023-01-31T14:18:06.412Z", "createdAt": "2023-01-31T14:18:06.412Z", "liveEventsConfig": {}, - "sourceDefinition": { - "options": {}, - "config": null, - "configSchema": null, - "uiConfig": null, - "id": "2CCxgViQJACgWABA6h83wlXnE1k", - "name": "Javascript", - "displayName": "Javascript", - "category": "", - "type": "web", - "createdAt": "2022-07-20T12:34:38.073Z", - "updatedAt": "2023-04-26T11:00:22.766Z" - }, "createdBy": "2L5tkiPslLEaplRRjzFuVHhHNPH", "secretVersion": null, "connections": [ diff --git a/packages/sanity-suite/src/ignoredProperties/sourceConfigIgnoredProperties.js b/packages/sanity-suite/src/ignoredProperties/sourceConfigIgnoredProperties.js index 80efe0b098..86170f2c62 100644 --- a/packages/sanity-suite/src/ignoredProperties/sourceConfigIgnoredProperties.js +++ b/packages/sanity-suite/src/ignoredProperties/sourceConfigIgnoredProperties.js @@ -15,6 +15,10 @@ const sourceConfigIgnoredProperties = [ key: `source.sourceDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.0.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.0.updatedAt`, type: 'string', @@ -27,6 +31,10 @@ const sourceConfigIgnoredProperties = [ key: `source.destinations.0.destinationDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.1.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.1.updatedAt`, type: 'string', @@ -39,6 +47,10 @@ const sourceConfigIgnoredProperties = [ key: `source.destinations.1.destinationDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.2.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.2.updatedAt`, type: 'string', @@ -51,6 +63,10 @@ const sourceConfigIgnoredProperties = [ key: `source.destinations.2.destinationDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.3.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.3.updatedAt`, type: 'string', @@ -64,7 +80,11 @@ const sourceConfigIgnoredProperties = [ type: 'string', }, { - key: `source.destinations.3.updatedAt`, + key: `source.destinations.4.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, + { + key: `source.destinations.4.updatedAt`, type: 'string', }, { @@ -75,6 +95,10 @@ const sourceConfigIgnoredProperties = [ key: `source.destinations.4.destinationDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.5.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.5.updatedAt`, type: 'string', @@ -87,6 +111,10 @@ const sourceConfigIgnoredProperties = [ key: `source.destinations.5.destinationDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.6.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.6.updatedAt`, type: 'string', @@ -99,6 +127,10 @@ const sourceConfigIgnoredProperties = [ key: `source.destinations.6.destinationDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.7.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.7.updatedAt`, type: 'string', @@ -111,6 +143,10 @@ const sourceConfigIgnoredProperties = [ key: `source.destinations.7.destinationDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.8.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.8.updatedAt`, type: 'string', @@ -123,6 +159,10 @@ const sourceConfigIgnoredProperties = [ key: `source.destinations.8.destinationDefinition.updatedAt`, type: 'string', }, + { + key: `source.destinations.9.liveEventsConfig.eventDeliveryTS`, + type: 'number', + }, { key: `source.destinations.9.updatedAt`, type: 'string', diff --git a/packages/sanity-suite/src/testBook/ResultAssertions.js b/packages/sanity-suite/src/testBook/ResultAssertions.js index daf2378bb1..c2f6daeaa3 100644 --- a/packages/sanity-suite/src/testBook/ResultAssertions.js +++ b/packages/sanity-suite/src/testBook/ResultAssertions.js @@ -46,10 +46,16 @@ const ResultsAssertions = { ); } - return JSON.stringify(resultData, undefined, 2); + return { + resultData: JSON.stringify(resultData, undefined, 2), + expectedResultData: JSON.stringify(expectedResultData, undefined, 2), + }; } catch (e) { console.error(e); - return JSON.stringify({}, undefined, 2); + return { + resultData: JSON.stringify({}, undefined, 2), + expectedResultData: JSON.stringify({}, undefined, 2), + }; } }, diff --git a/packages/sanity-suite/src/testBook/TestBook.js b/packages/sanity-suite/src/testBook/TestBook.js index a51b47c3fd..69f018b7a2 100644 --- a/packages/sanity-suite/src/testBook/TestBook.js +++ b/packages/sanity-suite/src/testBook/TestBook.js @@ -1,4 +1,5 @@ import { ResultsAssertions } from './ResultAssertions'; +import { toBase64 } from './string'; class TestBook { constructor(testBookData, executionDelay = 5000, containerId = 'testBook') { @@ -91,30 +92,32 @@ class TestBook { ) }

-
${JSON.stringify(testCase.inputData, undefined, 2)}
+
${JSON.stringify(testCase.inputData, undefined, 2)}
- pending + }">pending +
+ View result diff +
+ -

+                          }" style="white-space: pre-wrap;">${JSON.stringify(testCase.expectedResult, undefined, 2)}
                           
                         
                         
-                          
-                            ${JSON.stringify(testCase.expectedResult, undefined, 2)}
-                          
+ }" data-test-case-id="${testCase.id}" style="white-space: pre-wrap;"> @@ -294,14 +297,17 @@ class TestBook { const observer = new MutationObserver(mutationList => { const resultDataElement = mutationList[0].addedNodes[0].parentNode; const resultData = resultDataElement.textContent.trim(); - const expectedResult = resultRowElement.lastElementChild.childNodes[1].textContent.trim(); - const sanitizedResultData = ResultsAssertions.sanitizeResultData( - resultData, - expectedResult, - ); + // Get the last but one child from resultRowElement + const expectedResult = + resultRowElement.childNodes[ + resultRowElement.childNodes.length - 2 + ].childNodes[1].textContent.trim(); + + const { resultData: sanitizedResultData, expectedResultData: sanitizedExpectedResultData } = + ResultsAssertions.sanitizeResultData(resultData, expectedResult); const assertionResult = ResultsAssertions.assertDeepObjectDiffResult( sanitizedResultData, - expectedResult, + sanitizedExpectedResultData, ); const statusElement = document.getElementById(`test-case-status-${testCaseId}`); @@ -311,6 +317,17 @@ class TestBook { behavior: 'smooth', block: 'center', }); + + const viewDiffElement = document.getElementById(`view-diff-${testCaseId}`); + if (assertionResult === 'success') { + // hide the element + viewDiffElement.classList.add('d-none'); + } else { + // show the element + viewDiffElement.classList.remove('d-none'); + + viewDiffElement.href = `https://jsondiff.com/#left=data:base64,${toBase64(sanitizedExpectedResultData)}&right=data:base64,${toBase64(sanitizedResultData)}`; + } }); observer.observe(resultContainerElement, { diff --git a/packages/sanity-suite/src/testBook/string.js b/packages/sanity-suite/src/testBook/string.js new file mode 100644 index 0000000000..0c17beef11 --- /dev/null +++ b/packages/sanity-suite/src/testBook/string.js @@ -0,0 +1,27 @@ +// The following text encoding and decoding is done before base64 encoding to prevent +// https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem + +/** + * Converts a bytes array to base64 encoded string + * @param bytes bytes array to be converted to base64 + * @returns base64 encoded string + */ +const bytesToBase64 = bytes => { + const binString = Array.from(bytes, x => String.fromCodePoint(x)).join(''); + return globalThis.btoa(binString); +}; + +/** + * Encodes a string to base64 even with unicode characters + * @param value input string + * @returns base64 encoded string + */ +const toBase64 = value => { + try { + return bytesToBase64(new TextEncoder().encode(value)); + } catch (err) { + return ''; + } +}; + +export { toBase64 };