diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b01182c276..2223b8aa2d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,46 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.72.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.72.2...v1.72.3) (2024-07-24) + + +### Bug Fixes + +* add validation for cordial destination ([#3599](https://github.com/rudderlabs/rudder-transformer/issues/3599)) ([b7860a5](https://github.com/rudderlabs/rudder-transformer/commit/b7860a5b2b87fb61aaff8c68a904ac996d63efd3)) +* update getConversionActionId function for gaoc ([#3594](https://github.com/rudderlabs/rudder-transformer/issues/3594)) ([68367f5](https://github.com/rudderlabs/rudder-transformer/commit/68367f5227c96f2700a773018b991b1e87a0774d)) + +### [1.72.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.72.1...v1.72.2) (2024-07-23) + +### [1.72.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.72.0...v1.72.1) (2024-07-23) + + +### Bug Fixes + +* garl get auth err category ([#3590](https://github.com/rudderlabs/rudder-transformer/issues/3590)) ([475ebc1](https://github.com/rudderlabs/rudder-transformer/commit/475ebc104c69a52eaa425a9ed564ea9aca1ecd9c)) + +## [1.72.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.71.3...v1.72.0) (2024-07-22) + + +### Features + +* add support for subscribing for RETL flow ([#3195](https://github.com/rudderlabs/rudder-transformer/issues/3195)) ([cc56004](https://github.com/rudderlabs/rudder-transformer/commit/cc560044ceb769da1f0090da4f690933552b6347)) +* braze source event mapping ([#3527](https://github.com/rudderlabs/rudder-transformer/issues/3527)) ([e357141](https://github.com/rudderlabs/rudder-transformer/commit/e357141d22e5296b6d1cda2e763ac24abfcb66e6)) +* introduces new user fields in titkok ads ([#3575](https://github.com/rudderlabs/rudder-transformer/issues/3575)) ([6304abb](https://github.com/rudderlabs/rudder-transformer/commit/6304abb2346f331b78e927b73e7c2ca17e94f4cf)) +* onboard cordial destination ([#3581](https://github.com/rudderlabs/rudder-transformer/issues/3581)) ([fbcdcd6](https://github.com/rudderlabs/rudder-transformer/commit/fbcdcd609888150efa0da33eec60a4cc7b436d06)) +* onboarding new destination zoho ([#3555](https://github.com/rudderlabs/rudder-transformer/issues/3555)) ([20aa7f3](https://github.com/rudderlabs/rudder-transformer/commit/20aa7f35e13ad89e8a43fbbb743df73b0c103975)), closes [#3566](https://github.com/rudderlabs/rudder-transformer/issues/3566) +* update webhook destination to support all datatypes ([#3541](https://github.com/rudderlabs/rudder-transformer/issues/3541)) ([448f574](https://github.com/rudderlabs/rudder-transformer/commit/448f57484c57d4a55147e9566149c8b714a191c9)) + + +### Bug Fixes + +* add optional chaining to webengage page event ([#3570](https://github.com/rudderlabs/rudder-transformer/issues/3570)) ([20205d6](https://github.com/rudderlabs/rudder-transformer/commit/20205d66298f5633d3971888f0866db2c38a50e2)) +* add validation for type in google pubsub ([#3578](https://github.com/rudderlabs/rudder-transformer/issues/3578)) ([1bef212](https://github.com/rudderlabs/rudder-transformer/commit/1bef2126a75324598c2af0ecaffcf582f038af11)) +* adding readiness probe annotations for openfaas ([#3529](https://github.com/rudderlabs/rudder-transformer/issues/3529)) ([2eb92e3](https://github.com/rudderlabs/rudder-transformer/commit/2eb92e3332ef0e8b2f83621fe0130fbc1356fa91)) +* **gainsight:** replace myAxios utility with handleHttpRequest utility ([#3241](https://github.com/rudderlabs/rudder-transformer/issues/3241)) ([04be1aa](https://github.com/rudderlabs/rudder-transformer/commit/04be1aaf438f824ddf61fc2f4d13eb7d8a223a9d)) +* job ordering for hs ([#3319](https://github.com/rudderlabs/rudder-transformer/issues/3319)) ([f840d54](https://github.com/rudderlabs/rudder-transformer/commit/f840d54dcbdc011eeb716dce74f2ecb36e99d0e9)) +* update authErrorCategory for 2 step verification issue for google ads destinations ([#3552](https://github.com/rudderlabs/rudder-transformer/issues/3552)) ([5a0392e](https://github.com/rudderlabs/rudder-transformer/commit/5a0392ee24301486b7973531be28f8178ef03eab)) +* update python transformation fn ([#3491](https://github.com/rudderlabs/rudder-transformer/issues/3491)) ([f363f35](https://github.com/rudderlabs/rudder-transformer/commit/f363f3512f690e0745165f46587efdbe88f48683)) + ### [1.71.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.71.2...v1.71.3) (2024-07-15) diff --git a/package-lock.json b/package-lock.json index 12b2155bea7..7987a1a1ad5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.71.3", + "version": "1.72.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.71.3", + "version": "1.72.3", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 78936769373..f47b1eb1249 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.71.3", + "version": "1.72.3", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { diff --git a/src/cdk/v2/destinations/cordial/procWorkflow.yaml b/src/cdk/v2/destinations/cordial/procWorkflow.yaml index 2c765afeb50..641cf28b065 100644 --- a/src/cdk/v2/destinations/cordial/procWorkflow.yaml +++ b/src/cdk/v2/destinations/cordial/procWorkflow.yaml @@ -35,13 +35,16 @@ steps: template: | $.context.messageType = .message.type.toLowerCase(); - - name: validateInput + - name: validateConfig + template: | + $.assertConfig(.destination.Config.apiKey, "API Key is not present. Aborting"); + $.assertConfig(.destination.Config.apiBaseUrl, "API Base URl is not present. Aborting"); + + - name: validateMessageType template: | let messageType = $.context.messageType; $.assert(messageType, "message Type is not present. Aborting"); $.assert(messageType in {{$.EventType.([.TRACK, .IDENTIFY])}}, "message type " + messageType + " is not supported"); - $.assertConfig(.destination.Config.apiKey, "API Key is not present. Aborting"); - $.assertConfig(.destination.Config.apiBaseUrl, "API Base URl is not present. Aborting"); - name: getContactId template: | @@ -49,7 +52,11 @@ steps: - name: getContactEmail template: | - .message.().({{{{$.getGenericPaths("email")}}}};); + .message.().({{{{$.getGenericPaths("emailOnly")}}}}); + + - name: validateEventPayload + template: | + $.assert($.outputs.getContactId || $.outputs.getContactEmail, "Either one of cordial contact id or email is required. Aborting"); - name: buildIdentifyPayload condition: $.context.messageType in [{{$.EventType.IDENTIFY}}] diff --git a/src/v0/destinations/google_adwords_offline_conversions/networkHandler.js b/src/v0/destinations/google_adwords_offline_conversions/networkHandler.js index f260abeca5e..df69a95299b 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/networkHandler.js +++ b/src/v0/destinations/google_adwords_offline_conversions/networkHandler.js @@ -43,7 +43,7 @@ const createJob = async ({ endpoint, headers, payload, metadata }) => { const { response, status } = createJobResponse; if (!isHttpStatusSuccess(status)) { throw new AbortedError( - `[Google Ads Offline Conversions]:: ${response?.error?.message} during google_ads_offline_store_conversions Job Creation`, + `[Google Ads Offline Conversions]:: ${response?.error?.message || response?.[0]?.error?.message} during google_ads_offline_store_conversions Job Creation`, status, response, getAuthErrCategory(createJobResponse), diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.js b/src/v0/destinations/google_adwords_offline_conversions/utils.js index 7c21371ccf5..7228bb8da41 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js @@ -16,7 +16,6 @@ const { getFieldValueFromMessage, isDefinedAndNotNullAndNotEmpty, isDefinedAndNotNull, - getAuthErrCategoryFromStCode, getAccessToken, getIntegrationsObj, } = require('../../util'); @@ -34,7 +33,7 @@ const { const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); const Cache = require('../../util/cache'); const helper = require('./helper'); -const { finaliseConsent } = require('../../util/googleUtils'); +const { finaliseConsent, getAuthErrCategory } = require('../../util/googleUtils'); const conversionActionIdCache = new Cache(CONVERSION_ACTION_ID_CACHE_TTL); @@ -86,7 +85,7 @@ const getConversionActionId = async ({ headers, params, metadata }) => { )} during google_ads_offline_conversions response transformation`, status, response, - getAuthErrCategoryFromStCode(get(searchStreamResponse, 'status')), + getAuthErrCategory(searchStreamResponse), ); } const conversionAction = get( diff --git a/src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js b/src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js index 1247eae0b14..98659fdf880 100644 --- a/src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js +++ b/src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js @@ -159,7 +159,7 @@ const gaAudienceRespHandler = (destResponse, stageMsg) => { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status), }, response, - getAuthErrCategory(status), + getAuthErrCategory(destResponse), ); }; diff --git a/src/v0/destinations/klaviyo/transform.js b/src/v0/destinations/klaviyo/transform.js index 4d3d0a8438c..eac9dda8a0d 100644 --- a/src/v0/destinations/klaviyo/transform.js +++ b/src/v0/destinations/klaviyo/transform.js @@ -20,7 +20,7 @@ const { batchSubscribeEvents, getIdFromNewOrExistingProfile, profileUpdateResponseBuilder, - addSubcribeFlagToTraits, + addSubscribeFlagToTraits, } = require('./util'); const { defaultRequestConfig, @@ -63,7 +63,7 @@ const identifyRequestHandler = async ( if (mappedToDestination) { addExternalIdToTraits(message); adduserIdFromExternalId(message); - traitsInfo = addSubcribeFlagToTraits(traitsInfo); + traitsInfo = addSubscribeFlagToTraits(traitsInfo); } let propertyPayload = constructPayload(message, MAPPING_CONFIG[category.name]); diff --git a/src/v0/util/googleUtils/index.js b/src/v0/util/googleUtils/index.js index 183f327fa4d..406afa1a492 100644 --- a/src/v0/util/googleUtils/index.js +++ b/src/v0/util/googleUtils/index.js @@ -114,11 +114,14 @@ const finaliseAnalyticsConsents = (consentConfigMap, eventLevelConsent = {}) => const getAuthErrCategory = ({ response, status }) => { if (status === 401) { - const authenticationError = get( - response, - 'error.details.0.errors.0.errorCode.authenticationError', + let respArr = response; + if (!Array.isArray(response)) { + respArr = [response]; + } + const authenticationError = respArr.map((resp) => + get(resp, 'error.details.0.errors.0.errorCode.authenticationError'), ); - if (authenticationError === 'TWO_STEP_VERIFICATION_NOT_ENROLLED') { + if (authenticationError.includes('TWO_STEP_VERIFICATION_NOT_ENROLLED')) { // https://developers.google.com/google-ads/api/docs/oauth/2sv return AUTH_STATUS_INACTIVE; } diff --git a/test/integrations/destinations/cordial/processor/validation.ts b/test/integrations/destinations/cordial/processor/validation.ts index a764b79443d..61f2e1cbed9 100644 --- a/test/integrations/destinations/cordial/processor/validation.ts +++ b/test/integrations/destinations/cordial/processor/validation.ts @@ -3,6 +3,47 @@ import { generateMetadata } from '../../../testUtils'; import { destType, destination, processorInstrumentationErrorStatTags } from '../common'; export const validation: ProcessorTestData[] = [ + { + id: 'cordial-validation-test-1', + name: destType, + description: 'All of the required fields — cordial contact id, email — are missing.', + scenario: 'Framework', + successCriteria: 'Instrumentation Error', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination, + message: { + type: 'identify', + integrations: { + All: true, + }, + originalTimestamp: '2024-03-04T15:32:56.409Z', + }, + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Either one of cordial contact id or email is required. Aborting: Workflow: procWorkflow, Step: validateEventPayload, ChildStep: undefined, OriginalError: Either one of cordial contact id or email is required. Aborting', + metadata: generateMetadata(1), + statTags: processorInstrumentationErrorStatTags, + statusCode: 400, + }, + ], + }, + }, + }, { id: 'cordial-validation-test-2', name: destType, @@ -38,7 +79,7 @@ export const validation: ProcessorTestData[] = [ body: [ { error: - 'message type group is not supported: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message type group is not supported', + 'message type group is not supported: Workflow: procWorkflow, Step: validateMessageType, ChildStep: undefined, OriginalError: message type group is not supported', metadata: generateMetadata(1), statTags: processorInstrumentationErrorStatTags, statusCode: 400, diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts index 73fd7c961d2..4437ebb912c 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts @@ -332,4 +332,76 @@ export const v1oauthScenarios = [ }, }, }, + { + id: 'gaoc_v1_oauth_scenario_4', + name: 'google_adwords_offline_conversions', + description: + "[Proxy v1 API] :: Oauth when the user doesn't enabled 2 factor authentication but the google ads account has it enabled for not store sales conversion", + successCriteria: 'The proxy should return 401 with authErrorCategory as AUTH_STATUS_INACTIVE', + scenario: 'Oauth', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + ...{ ...commonRequestParameters, JSON: { isStoreConversion: false } }, + headers: { + Authorization: 'Bearer invalidabcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': 'logincustomerid', + }, + endpoint: + 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + }, + metadataArray, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 401, + body: { + output: { + authErrorCategory: 'AUTH_STATUS_INACTIVE', + message: + '[Google Ads Offline Conversions]:: [{"error":{"code":401,"details":[{"@type":"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure","errors":[{"errorCode":{"authenticationError":"TWO_STEP_VERIFICATION_NOT_ENROLLED"},"message":"An account administrator changed this account\'s authentication settings. To access this Google Ads account, enable 2-Step Verification in your Google account at https://www.google.com/landing/2step."}],"requestId":"wy4ZYbsjWcgh6uC2Ruc_Zg"}],"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}] during google_ads_offline_conversions response transformation', + response: [ + { + error: + '[Google Ads Offline Conversions]:: [{"error":{"code":401,"details":[{"@type":"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure","errors":[{"errorCode":{"authenticationError":"TWO_STEP_VERIFICATION_NOT_ENROLLED"},"message":"An account administrator changed this account\'s authentication settings. To access this Google Ads account, enable 2-Step Verification in your Google account at https://www.google.com/landing/2step."}],"requestId":"wy4ZYbsjWcgh6uC2Ruc_Zg"}],"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}] during google_ads_offline_conversions response transformation', + metadata: { + attemptNum: 1, + destinationId: 'default-destinationId', + dontBatch: false, + jobId: 1, + secret: { + accessToken: 'default-accessToken', + }, + sourceId: 'default-sourceId', + userId: 'default-userId', + workspaceId: 'default-workspaceId', + }, + statusCode: 401, + }, + ], + statTags: { + destType: 'GOOGLE_ADWORDS_OFFLINE_CONVERSIONS', + destinationId: 'default-destinationId', + errorCategory: 'network', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', + }, + status: 401, + }, + }, + }, + }, + }, ]; diff --git a/test/integrations/destinations/google_adwords_offline_conversions/network.ts b/test/integrations/destinations/google_adwords_offline_conversions/network.ts index 49f89cec28a..0ab6bef1db7 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/network.ts @@ -1,3 +1,32 @@ +const commonResponse = { + status: 401, + data: [ + { + error: { + code: 401, + details: [ + { + '@type': 'type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure', + errors: [ + { + errorCode: { + authenticationError: 'TWO_STEP_VERIFICATION_NOT_ENROLLED', + }, + message: + "An account administrator changed this account's authentication settings. To access this Google Ads account, enable 2-Step Verification in your Google account at https://www.google.com/landing/2step.", + }, + ], + requestId: 'wy4ZYbsjWcgh6uC2Ruc_Zg', + }, + ], + message: + 'Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', + status: 'UNAUTHENTICATED', + }, + }, + ], +}; + export const networkCallsData = [ { httpReq: { @@ -647,7 +676,7 @@ export const networkCallsData = [ }, { description: - 'Mock response from destination depicting a request with invalid authentication credentials', + 'Mock response from destination depicting a request from user who has not enabled 2 factor authentication', httpReq: { url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create', data: { @@ -669,31 +698,25 @@ export const networkCallsData = [ }, method: 'POST', }, - httpRes: { - status: 401, + httpRes: commonResponse, + }, + { + description: + 'Mock response from destination depicting a request from user who has not enabled 2 factor authentication', + httpReq: { + url: 'https://googleads.googleapis.com/v16/customers/1112223333/googleAds:searchStream', data: { - error: { - code: 401, - details: [ - { - '@type': 'type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure', - errors: [ - { - errorCode: { - authenticationError: 'TWO_STEP_VERIFICATION_NOT_ENROLLED', - }, - message: - "An account administrator changed this account's authentication settings. To access this Google Ads account, enable 2-Step Verification in your Google account at https://www.google.com/landing/2step.", - }, - ], - requestId: 'wy4ZYbsjWcgh6uC2Ruc_Zg', - }, - ], - message: - 'Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', - status: 'UNAUTHENTICATED', - }, + query: + "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", + }, + headers: { + Authorization: 'Bearer invalidabcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': 'logincustomerid', }, + method: 'POST', }, + httpRes: commonResponse, }, ]; diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts index a036da149d8..ed1741e939e 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts @@ -4,20 +4,20 @@ import { generateProxyV1Payload, } from '../../../testUtils'; -const commonHeaders = { +export const commonHeaders = { Authorization: 'Bearer dummy-access', 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }; -const commonParams = { +export const commonParams = { destination: 'google_adwords_remarketing_lists', listId: '709078448', customerId: '7693729833', consent: { adPersonalization: 'UNSPECIFIED', adUserData: 'UNSPECIFIED' }, }; -const validRequestPayload1 = { +export const validRequestPayload1 = { enablePartialFailure: true, operations: [ { @@ -92,7 +92,7 @@ const invalidArgumentRequestPayload = { const metadataArray = [generateGoogleOAuthMetadata(1)]; -const expectedStatTags = { +export const expectedStatTags = { destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS', destinationId: 'default-destinationId', errorCategory: 'network', diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/data.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/data.ts index 51827a38e27..8bde58c7807 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/data.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/data.ts @@ -1,3 +1,4 @@ import { testScenariosForV0API, testScenariosForV1API } from './business'; +import { oauthError } from './oauth'; -export const data = [...testScenariosForV0API, ...testScenariosForV1API]; +export const data = [...testScenariosForV0API, ...testScenariosForV1API, ...oauthError]; diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts new file mode 100644 index 00000000000..b7f93a69454 --- /dev/null +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts @@ -0,0 +1,70 @@ +import { generateProxyV1Payload } from '../../../testUtils'; +import { commonHeaders, commonParams, expectedStatTags, validRequestPayload1 } from './business'; + +export const oauthError = [ + { + id: 'garl_oauth_scenario', + name: 'google_adwords_remarketing_lists', + description: + '[Proxy v1 API] :: Oauth where valid credentials are missing as mock response from destination', + successCriteria: 'The proxy should return 401 with authErrorCategory as REFRESH_TOKEN', + scenario: 'Oauth', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload({ + headers: commonHeaders, + params: commonParams, + JSON: validRequestPayload1, + endpoint: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + accessToken: 'dummy-access', + }), + method: 'POST', + }, + }, + output: { + response: { + status: 401, + body: { + output: { + authErrorCategory: 'REFRESH_TOKEN', + message: + 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. during ga_audience response transformation', + response: [ + { + error: + 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. during ga_audience response transformation', + metadata: { + attemptNum: 1, + destinationId: 'default-destinationId', + dontBatch: false, + jobId: 1, + secret: { + accessToken: 'dummy-access', + }, + sourceId: 'default-sourceId', + userId: 'default-userId', + workspaceId: 'default-workspaceId', + }, + statusCode: 401, + }, + ], + statTags: { + destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS', + destinationId: 'default-destinationId', + errorCategory: 'network', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', + }, + status: 401, + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts index 8e7c0acbcf7..1fd95858a15 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts @@ -207,4 +207,38 @@ export const networkCallsData = [ data: {}, }, }, + { + httpReq: { + url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create', + data: { + job: { + type: 'CUSTOMER_MATCH_USER_LIST', + customerMatchUserListMetadata: { + userList: 'customers/7693729833/userLists/709078448', + consent: { + adPersonalization: 'UNSPECIFIED', + adUserData: 'UNSPECIFIED', + }, + }, + }, + }, + headers: { + Authorization: 'Bearer dummy-access', + 'Content-Type': 'application/json', + 'developer-token': 'dummy-dev-token', + }, + method: 'POST', + }, + httpRes: { + status: 401, + data: { + error: { + code: 401, + message: + 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', + status: 'UNAUTHENTICATED', + }, + }, + }, + }, ];