diff --git a/packages/destination-actions/src/destinations/customerio/__tests__/index.test.ts b/packages/destination-actions/src/destinations/customerio/__tests__/index.test.ts new file mode 100644 index 00000000000..52f4b72e77f --- /dev/null +++ b/packages/destination-actions/src/destinations/customerio/__tests__/index.test.ts @@ -0,0 +1,39 @@ +import destination from '../index' + +describe('customerio presets', () => { + it('includes the generic automatic lifecycle presets', () => { + const automaticPresetNames = destination.presets + ?.filter((preset) => preset.type === 'automatic') + .map((preset) => preset.name) + + expect(automaticPresetNames).toEqual( + expect.arrayContaining([ + 'Delete Device', + 'Delete Relationship', + 'Delete Person', + 'Delete Object', + 'Merge People', + 'Suppress Person', + 'Unsuppress Person' + ]) + ) + }) + + it('includes Device Created or Updated in the create/update device subscriptions', () => { + const preset = destination.presets?.find((candidate) => candidate.name === 'Create or Update Device') + + expect(preset?.subscribe).toContain('Device Created or Updated') + expect(destination.actions.createUpdateDevice.defaultSubscription).toContain('Device Created or Updated') + }) + + it('excludes reserved device and object events from the generic track event surface', () => { + const preset = destination.presets?.find((candidate) => candidate.name === 'Track Event') + + expect(preset?.subscribe).toContain('event != "Device Created or Updated"') + expect(preset?.subscribe).toContain('event != "Device Deleted"') + expect(destination.actions.trackEvent.defaultSubscription).toContain('event != "Device Created or Updated"') + expect(destination.actions.trackEvent.defaultSubscription).toContain('event != "Device Deleted"') + expect(destination.actions.trackEvent.defaultSubscription).toContain('event != "Object Deleted"') + expect(destination.actions.trackEvent.defaultSubscription).toContain('event != "Report Content Event"') + }) +}) diff --git a/packages/destination-actions/src/destinations/customerio/createUpdateDevice/index.ts b/packages/destination-actions/src/destinations/customerio/createUpdateDevice/index.ts index 62874bbd440..10d008fa164 100644 --- a/packages/destination-actions/src/destinations/customerio/createUpdateDevice/index.ts +++ b/packages/destination-actions/src/destinations/customerio/createUpdateDevice/index.ts @@ -7,7 +7,8 @@ import { eventProperties } from '../customerio-properties' const action: ActionDefinition = { title: 'Create or Update Device', description: `Create or update a person's device.`, - defaultSubscription: 'type = "track" and event = "Application Installed"', + defaultSubscription: + 'event = "Application Installed" or event = "Application Opened" or event = "Device Created or Updated"', fields: { person_id: { label: 'Person ID', diff --git a/packages/destination-actions/src/destinations/customerio/index.ts b/packages/destination-actions/src/destinations/customerio/index.ts index 8e113b4ef96..a0d1457c22f 100644 --- a/packages/destination-actions/src/destinations/customerio/index.ts +++ b/packages/destination-actions/src/destinations/customerio/index.ts @@ -88,15 +88,52 @@ const destination: DestinationDefinition = { }, { name: 'Create or Update Device', - subscribe: 'event = "Application Installed" or event = "Application Opened"', + subscribe: ` + event = "Application Installed" + or event = "Application Opened" + or event = "Device Created or Updated" + `, partnerAction: 'createUpdateDevice', mapping: defaultValues(createUpdateDevice.fields), type: 'automatic' }, + { + name: 'Delete Device', + subscribe: 'event = "Application Uninstalled" or event = "Device Deleted"', + partnerAction: 'deleteDevice', + mapping: defaultValues(deleteDevice.fields), + type: 'automatic' + }, + { + name: 'Delete Relationship', + subscribe: 'event = "Relationship Deleted"', + partnerAction: 'deleteRelationship', + mapping: defaultValues(deleteRelationship.fields), + type: 'automatic' + }, + { + name: 'Delete Person', + subscribe: 'event = "User Deleted"', + partnerAction: 'deletePerson', + mapping: defaultValues(deletePerson.fields), + type: 'automatic' + }, + { + name: 'Delete Object', + subscribe: 'event = "Object Deleted"', + partnerAction: 'deleteObject', + mapping: defaultValues(deleteObject.fields), + type: 'automatic' + }, { name: 'Track Event', subscribe: ` type = "track" + and event != "Application Installed" + and event != "Application Opened" + and event != "Application Uninstalled" + and event != "Device Created or Updated" + and event != "Device Deleted" and event != "Relationship Deleted" and event != "User Deleted" and event != "User Suppressed" @@ -130,6 +167,27 @@ const destination: DestinationDefinition = { mapping: defaultValues(createUpdateObject.fields), type: 'automatic' }, + { + name: 'Merge People', + subscribe: 'type = "alias"', + partnerAction: 'mergePeople', + mapping: defaultValues(mergePeople.fields), + type: 'automatic' + }, + { + name: 'Suppress Person', + subscribe: 'event = "User Suppressed"', + partnerAction: 'suppressPerson', + mapping: defaultValues(suppressPerson.fields), + type: 'automatic' + }, + { + name: 'Unsuppress Person', + subscribe: 'event = "User Unsuppressed"', + partnerAction: 'unsuppressPerson', + mapping: defaultValues(unsuppressPerson.fields), + type: 'automatic' + }, { name: 'Report Delivery Event', subscribe: 'event = "Report Delivery Event"', diff --git a/packages/destination-actions/src/destinations/customerio/trackEvent/index.ts b/packages/destination-actions/src/destinations/customerio/trackEvent/index.ts index 2956a51a99b..9e2a8b6bcfa 100644 --- a/packages/destination-actions/src/destinations/customerio/trackEvent/index.ts +++ b/packages/destination-actions/src/destinations/customerio/trackEvent/index.ts @@ -9,12 +9,18 @@ const action: ActionDefinition = { description: 'Track an event for a known or anonymous person.', defaultSubscription: ` type = "track" + and event != "Application Installed" + and event != "Application Opened" + and event != "Application Uninstalled" + and event != "Device Created or Updated" + and event != "Device Deleted" and event != "Relationship Deleted" and event != "User Deleted" and event != "User Suppressed" and event != "User Unsuppressed" - and event != "Group Deleted" + and event != "Object Deleted" and event != "Report Delivery Event" + and event != "Report Content Event" `, fields: { id: {