diff --git a/src/v0/destinations/airship/transform.js b/src/v0/destinations/airship/transform.js index d60439f45e..dc8543fbc5 100644 --- a/src/v0/destinations/airship/transform.js +++ b/src/v0/destinations/airship/transform.js @@ -1,4 +1,3 @@ -const { v5 } = require('uuid'); const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); const { EventType } = require('../../../constants'); @@ -25,6 +24,7 @@ const { simpleProcessRouterDest, } = require('../../util'); const { JSON_MIME_TYPE } = require('../../util/constant'); +const { transformSessionId } = require('./utils'); const DEFAULT_ACCEPT_HEADER = 'application/vnd.urbanairship+json; version=3'; @@ -121,12 +121,6 @@ const identifyResponseBuilder = (message, { Config }) => { return arrayPayload; }; -const transformSessionId = (rawSessionId) => { - const NAMESPACE = v5.DNS; - const uuidV5 = v5(rawSessionId, NAMESPACE); - return uuidV5; -}; - const trackResponseBuilder = async (message, { Config }) => { let name = message.event; if (!name) { diff --git a/src/v0/destinations/airship/utils.js b/src/v0/destinations/airship/utils.js new file mode 100644 index 0000000000..0ef637245f --- /dev/null +++ b/src/v0/destinations/airship/utils.js @@ -0,0 +1,12 @@ +const { v5 } = require('uuid'); + +// ref : https://docs.airship.com/api/ua/#operation-api-custom-events-post +const transformSessionId = (rawSessionId) => { + const NAMESPACE = v5.DNS; + const uuidV5 = v5(rawSessionId, NAMESPACE); + return uuidV5; +}; + +module.exports = { + transformSessionId, +}; diff --git a/test/integrations/destinations/airship/processor/data.ts b/test/integrations/destinations/airship/processor/data.ts index 74b1c2a628..a72495d23d 100644 --- a/test/integrations/destinations/airship/processor/data.ts +++ b/test/integrations/destinations/airship/processor/data.ts @@ -2296,7 +2296,7 @@ export const data = [ }, { name: 'airship', - description: 'Test 22', + description: 'Test 22 : session id gets converted to v5 uuid format', feature: 'processor', module: 'destination', version: 'v0',