Skip to content

Commit

Permalink
fix: adding doc refs
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Nov 18, 2024
1 parent 936ba46 commit d8f82a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/v0/destinations/airship/transform.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { v5 } = require('uuid');
const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib');
const { EventType } = require('../../../constants');

Expand All @@ -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';

Expand Down Expand Up @@ -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) {
Expand Down
12 changes: 12 additions & 0 deletions src/v0/destinations/airship/utils.js
Original file line number Diff line number Diff line change
@@ -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,
};
2 changes: 1 addition & 1 deletion test/integrations/destinations/airship/processor/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d8f82a2

Please sign in to comment.