Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ortto Action Destination #2798

Open
wants to merge 108 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
80b8a1e
Initial update profile action
xitonix Jan 17, 2025
3e5b6c3
Generate types & build Ortto client
xitonix Jan 17, 2025
48829d5
Removed type property
xitonix Jan 23, 2025
7e59164
Track activity action
xitonix Jan 29, 2025
6b16408
Separate track/identify endpoints
xitonix Jan 29, 2025
7d6f57f
Basic unit tests
xitonix Jan 30, 2025
c695376
Add unit tests & snapshot tests
xitonix Jan 30, 2025
9e9b156
Ortto environment variables
xitonix Jan 31, 2025
ca85034
Update action contracts
xitonix Feb 10, 2025
d81d728
Normalize email addresses for Google Enhanced Conversions (#2668)
tcgilbert Jan 14, 2025
9cd4704
Updated all the data processing states of FCAPI (#2669)
AnkitSegment Jan 14, 2025
2f98293
allow custom global key (#2667)
mshwery Jan 14, 2025
993b99f
[MAIN] [STRATCONN] Intercom web custom inbox button selector (#2660)
AnkitSegment Jan 14, 2025
ceebd10
[MAIN] [STRATCONN] 4261 Mixpanel Multistatus support (#2536)
AnkitSegment Jan 14, 2025
494c0d2
Publish (#2677)
github-actions[bot] Jan 14, 2025
f6f48ad
Adding new AU url for Braze in cohorts config with formatting (#2680)
dcp-twilio Jan 15, 2025
4d2c089
change to cc and bcc fields (#2678)
joe-ayoub-segment Jan 16, 2025
ba3f3c7
[Optimizely Web] - major refactor and testing (#2679)
joe-ayoub-segment Jan 16, 2025
41e0dfb
[SFMC] Add Multistatus Support for SFMC (#2639)
harsh-joshi99 Jan 16, 2025
6ec4f75
[STRATCONN-5314] | Multistatus support on amazon-amc (#2663)
Innovative-GauravKochar Jan 16, 2025
d1a46b9
Publish (#2683)
github-actions[bot] Jan 16, 2025
8acbdb2
Revert "update: update VWO SmartCode to version 2.1 (#2654)" (#2685)
joe-ayoub-segment Jan 16, 2025
6a3f6b9
Bumps linkedin version to 202411 since 202401 has been deprecated (#2…
nick-Ag Jan 17, 2025
76412d4
Publish (#2694)
github-actions[bot] Jan 17, 2025
e94df40
updating smart code snippet to not cause opacity 0 in hide element st…
segment-anthony Jan 20, 2025
01e5249
[HEAP] update browser destination code to load heap js v5 script (#2665)
cpsoinos Jan 20, 2025
4757460
updating default mapping (#2690)
joe-ayoub-segment Jan 20, 2025
8daaaac
[Google Ads] Send non-American country codes correctly (#2688)
nick-Ag Jan 20, 2025
115592d
[12 Destinations] Audience Destination support for computation_class …
joe-ayoub-segment Jan 20, 2025
c08fc51
Allowing pre-hashed emails for Criteo Audiences. (#2681)
seg-leonelsanches Jan 20, 2025
bf867b0
[STRATCONN-5384] Update LiveRamp phone_number hashing algo (#2675)
rvadera12 Jan 20, 2025
c650c4d
[Antavo ] New Antavo Destination (#2619)
bbantavo Jan 20, 2025
a9d5edb
[STRATCONN-5399]-Handles refresh token retry for multistatus response…
varadarajan-tw Jan 21, 2025
941cd72
[Marketo] - Add MultiStatus Support (#2653)
sayan-das-in Jan 21, 2025
766d6ce
Registers antavo (#2698)
nick-Ag Jan 21, 2025
4541f0d
Publish (#2699)
github-actions[bot] Jan 21, 2025
8a28fca
Imports hashing functions with the same syntax as other imports from …
nick-Ag Jan 21, 2025
317a773
Publish (#2701)
github-actions[bot] Jan 21, 2025
e374628
[Multiple Destinations] - cleaning up some test noise (#2692)
joe-ayoub-segment Jan 28, 2025
028f683
[STRATCONN-5380] - Fix google enhanced conversion error parsing (#2705)
varadarajan-tw Jan 28, 2025
72e7685
[FUNK-1643] add bearer token to webhook extensible (#2696)
cyberlord29 Jan 28, 2025
9a949be
Publish (#2709)
github-actions[bot] Jan 28, 2025
de738d1
Required Fields V2 - Conditionally Required Fields (#2099)
nick-Ag Jan 29, 2025
38beee1
Publish (#2713)
github-actions[bot] Jan 29, 2025
60dccbe
STRAT-5398 | Klaviyo(Actions) |Allow user to configure event name and…
Innovative-GauravKochar Feb 4, 2025
ae5cc0b
update userList action to common hashed function (#2710)
rvadera12 Feb 4, 2025
2ea321f
[STRATCONN-5445] - Fixes process consent casing in DV360 Actions (#2712)
varadarajan-tw Feb 4, 2025
d522d9e
Remove `abort-controller package` in favor of built-in AbortControlle…
sayan-das-in Feb 4, 2025
1da1661
Upgrade facebook conversion API from v20 to v21 (#2720)
Innovative-GauravKochar Feb 4, 2025
6ea60a2
Publish (#2724)
github-actions[bot] Feb 4, 2025
080bdc8
Fix typescript issues in Destinations and CLI (#2725)
sayan-das-in Feb 5, 2025
6319f7c
[Salesforce] Adds logging for closing bulk jobs (#2719)
nick-Ag Feb 6, 2025
b502686
Publish (#2728)
github-actions[bot] Feb 6, 2025
eab03e8
Dynamic field queries (#2732)
nick-Ag Feb 10, 2025
8a81df5
Publish (#2734)
github-actions[bot] Feb 10, 2025
718ed0b
Update unit tests exposing URLSearchParams (#2735)
sayan-das-in Feb 11, 2025
897f8f0
[STRATCONN-5484] Add new field to send raw user_agent (#2727)
maryamsharif Feb 11, 2025
4012a36
Adding extra match fields according to https://learn.microsoft.com/en…
seg-leonelsanches Feb 11, 2025
dfcda6e
Publish (#2736)
github-actions[bot] Feb 11, 2025
df9445d
Upgrade GitHub runner and actions cache plugin (#2738)
sayan-das-in Feb 11, 2025
59d265f
Update Linter and fix linting issues (#2737)
sayan-das-in Feb 13, 2025
c7dd182
Set Default version to V21 in Facebook Conversion API (#2740)
Innovative-GauravKochar Feb 17, 2025
a71c189
CRIT logging for actions salesforce, should show in prod (#2743)
nick-Ag Feb 17, 2025
1cf984e
Publish (#2744)
github-actions[bot] Feb 17, 2025
c7c2d02
[LAB-1682] Create presets for each standard audience action destinati…
drew-thompson Feb 18, 2025
6627834
Fix type and linting issues (#2746)
sayan-das-in Feb 18, 2025
b6fb3ba
Publish (#2747)
github-actions[bot] Feb 18, 2025
f09ed36
Adding oauth2.0 to First Party DV360 (#2733)
rvadera12 Feb 19, 2025
d2cad8e
Publish (#2751)
github-actions[bot] Feb 19, 2025
2a85c4a
[STRATCONN-5516] | Revert "Worked on fixing braze_id default mappings…
Innovative-GauravKochar Feb 20, 2025
30e8f60
Advanced logging of payloads from Salesforce based on a feature flag …
nick-Ag Feb 20, 2025
fde1c79
Upgrade all actions to the revision 2025-01-15 (#2748)
maryamsharif Feb 20, 2025
a00eb92
Publish (#2753)
github-actions[bot] Feb 20, 2025
133348e
Fix size limit issue on Github Actions (#2757)
sayan-das-in Feb 21, 2025
5504786
Update Copyright to 2025 (#2754)
itsarijitray Feb 21, 2025
297ac0a
Simplifies type generation for hooks (#2723)
nick-Ag Feb 21, 2025
5e3371f
[Smart Hashing] Add New Smart Hashing Util (#2756)
harsh-joshi99 Feb 24, 2025
c81b58d
Fix inconsistencies between node v18 and v22 (#2741)
sayan-das-in Feb 24, 2025
5525923
Upgrade Facebook API in Facebook Custom Audience (Actions) (#2742)
Innovative-GauravKochar Feb 25, 2025
4aa8c5c
expose SyncModeDefinition in actions-core to make it compatible with …
itsarijitray Feb 25, 2025
e2cab20
[Smart Hashing] [LinkedIn Conversions] Use Smart Hashing Util for Has…
harsh-joshi99 Feb 25, 2025
423b876
New amazon-eventbridge destination (#2760)
mayur-pitale Feb 25, 2025
25d7b91
Enabled CI for both v18 and v22 (#2763)
sayan-das-in Feb 25, 2025
e5e7676
register amazon eventbridge (#2767)
rvadera12 Feb 25, 2025
336aafa
Publish (#2768)
github-actions[bot] Feb 26, 2025
09743d8
[MAIN] [STRATCONN-5376] Klaviyo action destination sync failed issue.…
AnkitSegment Feb 26, 2025
aad3577
Fixes an issue with schema validation when a field is not included in…
nick-Ag Feb 27, 2025
6067b65
Adds yarn clean-build command (#2774)
varadarajan-tw Feb 28, 2025
1838dcd
Upgraded base node version to 18.17 (#2776)
sayan-das-in Feb 28, 2025
dd71f12
Set Node 22 as default version (#2777)
sayan-das-in Mar 3, 2025
52c88ba
Implement Smart Hashing in Amazon AMC (#2780)
harsh-joshi99 Mar 4, 2025
c38a997
Update DV360 Protobuf Dependencies (#2778)
marinhero Mar 4, 2025
8b35f04
[FUNK-1648] Custom Params support for Extensible Webhook Destination …
vaibhav-nanda Mar 4, 2025
d3dd5be
Publish (#2782)
github-actions[bot] Mar 4, 2025
fd3e140
fix: sanitised vwo page-view event name (#2718)
zeeshan-vwo Mar 11, 2025
5d1e096
Implemented smart hashing utilities (#2765)
AnkitSegment Mar 11, 2025
8e64c30
Use new smart hashing util in linkedin audiences (#2769)
harsh-joshi99 Mar 11, 2025
179f567
[FUNK-1707] Make the token prefix dynamic (#2775)
vaibhav-nanda Mar 11, 2025
aaae031
[SMART-HASHING] [STRATCONN-5544] Smart hashing utils added in first-p…
AnkitSegment Mar 11, 2025
96d99dc
Implement Smart Hashing Util for Pinterest Conversions (#2781)
harsh-joshi99 Mar 11, 2025
d24a59b
[SMART-HASHING] [STRATCONN-5546] Implemented smart hashing utilities …
AnkitSegment Mar 11, 2025
4f2e53e
Set Default Version to V21 in Facebook Custom Audiences (Actions) (#2…
Innovative-GauravKochar Mar 11, 2025
bc3737a
update api url for dawnai (#2773)
KMKoushik Mar 11, 2025
5ff637f
Braze regions and v5.7 [STRATCONN-5592] (#2761)
davidbielik Mar 11, 2025
0b2275e
Publish (#2790)
github-actions[bot] Mar 11, 2025
4da58ac
[Salesforce Marketing Cloud] Data Extension mapping save hook (#2711)
nick-Ag Mar 14, 2025
50b4646
Publish (#2797)
github-actions[bot] Mar 14, 2025
7614132
Merge pull request #1 from autopilot3/init
xitonix Mar 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"eslint-plugin-lodash": "^7.3.0",
"express": "^4.18.2",
"husky": "^7.0.0",
"jest": "^27.3.1",
"jest-browser-globals": "^25.1.0-beta",
"jest-mock": "^29.3.1",
"karma": "^6.4.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing snapshot for actions-ortto destination: trackActivity action - all fields 1`] = `
Array [
Object {
"anonymous_id": "]25AcEh01MO",
"enable_batching": true,
"event": "]25AcEh01MO",
"ip": "107.255.187.198",
"location": Object {
"city": "]25AcEh01MO",
"country": "]25AcEh01MO",
"post_code": "]25AcEh01MO",
"state": "]25AcEh01MO",
},
"message_id": "]25AcEh01MO",
"namespace": "]25AcEh01MO",
"properties": Object {
"testType": "]25AcEh01MO",
},
"timestamp": "2125-06-22T08:21:01.417Z",
"traits": Object {
"email": "[email protected]",
"first_name": "]25AcEh01MO",
"last_name": "]25AcEh01MO",
"phone": "]25AcEh01MO",
},
"user_id": "]25AcEh01MO",
},
]
`;

exports[`Testing snapshot for actions-ortto destination: trackActivity action - required fields 1`] = `
Array [
Object {
"anonymous_id": "]25AcEh01MO",
"event": "]25AcEh01MO",
"message_id": "]25AcEh01MO",
"user_id": "]25AcEh01MO",
},
]
`;

exports[`Testing snapshot for actions-ortto destination: upsertContactProfile action - all fields 1`] = `
Array [
Object {
"anonymous_id": "TBOtXZm4yQy]54s",
"enable_batching": false,
"ip": "169.155.93.138",
"location": Object {
"city": "TBOtXZm4yQy]54s",
"country": "TBOtXZm4yQy]54s",
"post_code": "TBOtXZm4yQy]54s",
"state": "TBOtXZm4yQy]54s",
},
"message_id": "TBOtXZm4yQy]54s",
"timestamp": "2086-08-12T02:15:40.692Z",
"traits": Object {
"email": "[email protected]",
"first_name": "TBOtXZm4yQy]54s",
"last_name": "TBOtXZm4yQy]54s",
"phone": "TBOtXZm4yQy]54s",
},
"user_id": "TBOtXZm4yQy]54s",
},
]
`;

exports[`Testing snapshot for actions-ortto destination: upsertContactProfile action - required fields 1`] = `
Array [
Object {
"anonymous_id": "TBOtXZm4yQy]54s",
"message_id": "TBOtXZm4yQy]54s",
"user_id": "TBOtXZm4yQy]54s",
},
]
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import nock from 'nock'
import { createTestIntegration, InvalidAuthenticationError } from '@segment/actions-core'
import Definition from '../index'
import { API_VERSION } from '../ortto-client'
import { TEST_API_KEY } from '../utils'

const testDestination = createTestIntegration(Definition)
describe('Ortto', () => {
describe('authentication', () => {
it('should reject empty api keys', async () => {
try {
await testDestination.testAuthentication({ api_key: '' })
} catch (err) {
expect(err instanceof InvalidAuthenticationError)
}
})

it('should reject whitespace api keys', async () => {
try {
await testDestination.testAuthentication({ api_key: ' ' })
} catch (err) {
expect(err instanceof InvalidAuthenticationError)
}
})

it('should reject invalid api keys', async () => {
try {
await testDestination.testAuthentication({ api_key: 'invalid' })
} catch (err) {
expect(err instanceof InvalidAuthenticationError)
}
})

it('should accept valid api keys', async () => {
nock('https://segment-action-api-au.ortto.app')
.get(`/${API_VERSION}/me`)
.matchHeader('authorization', `Bearer ${TEST_API_KEY}`)
.reply(200, {})
await expect(testDestination.testAuthentication({ api_key: TEST_API_KEY })).resolves.not.toThrowError()
})
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { createTestEvent, createTestIntegration } from '@segment/actions-core'
import { generateTestData } from '../../../lib/test-data'
import destination from '../index'
import nock from 'nock'
import { TEST_API_KEY } from '../utils'

const testDestination = createTestIntegration(destination)
const destinationSlug = 'actions-ortto'

describe(`Testing snapshot for ${destinationSlug} destination:`, () => {
for (const actionSlug in destination.actions) {
it(`${actionSlug} action - required fields`, async () => {
const seedName = `${destinationSlug}#${actionSlug}`
const action = destination.actions[actionSlug]
const [eventData] = generateTestData(seedName, destination, action, true)

nock(/.*/).persist().get(/.*/).reply(200)
nock(/.*/).persist().post(/.*/).reply(200)
nock(/.*/).persist().put(/.*/).reply(200)

const event = createTestEvent({
properties: eventData
})

const responses = await testDestination.testAction(actionSlug, {
event: event,
mapping: event.properties,
settings: { api_key: TEST_API_KEY },
auth: undefined
})

const request = responses[0].request
const rawBody = await request.text()

try {
const json = JSON.parse(rawBody)
expect(json).toMatchSnapshot()
return
} catch (err) {
expect(rawBody).toMatchSnapshot()
}

expect(request.headers).toMatchSnapshot()
})

it(`${actionSlug} action - all fields`, async () => {
const seedName = `${destinationSlug}#${actionSlug}`
const action = destination.actions[actionSlug]
const [eventData] = generateTestData(seedName, destination, action, false)

nock(/.*/).persist().get(/.*/).reply(200)
nock(/.*/).persist().post(/.*/).reply(200)
nock(/.*/).persist().put(/.*/).reply(200)

const event = createTestEvent({
properties: eventData
})

const responses = await testDestination.testAction(actionSlug, {
event: event,
mapping: event.properties,
settings: { api_key: TEST_API_KEY },
auth: undefined
})

const request = responses[0].request
const rawBody = await request.text()

try {
const json = JSON.parse(rawBody)
expect(json).toMatchSnapshot()
return
} catch (err) {
expect(rawBody).toMatchSnapshot()
}
})
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { cleanObject } from '../utils'

describe('Ortto', () => {
describe('utils', () => {
it('cleanobject must remove empty keys with value', async () => {
expect(cleanObject({ '': 'v', k: 'v' })).toStrictEqual({ k: 'v' })
})
})

describe('utils', () => {
it('cleanobject must remove empty keys with empty value', async () => {
expect(cleanObject({ '': '', k: 'v' })).toStrictEqual({ k: 'v' })
})
})

describe('utils', () => {
it('cleanobject must remove multiple empty keys', async () => {
expect(cleanObject({ '': '', '': 'v', k: 'v' })).toStrictEqual({ k: 'v' })
})
})

describe('utils', () => {
it('cleanobject should not remove empty values', async () => {
expect(
cleanObject({
k1: '',
k2: 'v2',
k3: 0,
k4: false,
k5: [],
k6: {},
k7: null,
k8: undefined
})
).toStrictEqual({
k1: '',
k2: 'v2',
k3: 0,
k4: false,
k5: [],
k6: {},
k7: null,
k8: undefined
})
})
})

describe('utils', () => {
it('cleanobject should not process arrays', async () => {
expect(
cleanObject({
k1: ['', undefined, null, 'v', { x: 'y', '': '', k1: undefined, k2: null }],
'': '',
k2: {},
k3: ['', undefined, null, 'v', { x: 'y', '': '' }],
k4: {
'': '',
k: 100
}
})
).toStrictEqual({
k1: ['', undefined, null, 'v', { x: 'y', '': '', k1: undefined, k2: null }],
k2: {},
k3: ['', undefined, null, 'v', { x: 'y', '': '' }],
k4: {
k: 100
}
})
})
})

describe('utils', () => {
it('cleanobject must clean nested objects', async () => {
expect(
cleanObject({
'': 'v',
k: 'v',
l1: {
'': '',
k2: undefined,
k3: null,
k4: 'v4',
l2: {
'': '',
k2: undefined,
k5: 'v5',
k3: null
}
}
})
).toStrictEqual({
k: 'v',
l1: {
k2: undefined,
k3: null,
k4: 'v4',
l2: {
k2: undefined,
k5: 'v5',
k3: null
}
}
})
})
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { InputField } from '@segment/actions-core'

export const commonFields: Record<string, InputField> = {
timestamp: {
label: 'Timestamp',
description: 'Event timestamp',
type: 'string',
readOnly: true,
format: 'date-time',
default: {
'@path': '$.timestamp'
}
},
message_id: {
label: 'Message ID',
description: 'Message ID',
type: 'string',
readOnly: true,
default: {
'@path': '$.messageId'
}
},
enable_batching: {
type: 'boolean',
label: 'Batch data',
description: 'When enabled, events will be sent to Ortto in batches for improved efficiency.',
default: true
},
user_id: {
label: 'User ID',
description: 'The unique user identifier',
type: 'string',
default: {
'@path': '$.userId'
}
},
anonymous_id: {
label: 'Anonymous ID',
description: 'Anonymous user identifier',
type: 'string',
default: {
'@path': '$.anonymousId'
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading