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

Adding Group support for customerio -Rename identifier field names #973

Merged
merged 9 commits into from
Jan 24, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ describe('CustomerIO', () => {
type: 'object',
action: 'identify',
identifiers: {
type_id: traits.object_type_id,
id: groupId
object_type_id: traits.object_type_id,
object_id: groupId
},
cio_relationships: [{ identifiers: { id: userId } }]
})
Expand Down Expand Up @@ -117,8 +117,8 @@ describe('CustomerIO', () => {
type: 'object',
action: 'identify',
identifiers: {
type_id: traits.object_type_id,
id: groupId
object_type_id: traits.object_type_id,
object_id: groupId
},
cio_relationships: [{ identifiers: { id: userId } }]
})
Expand Down Expand Up @@ -172,8 +172,8 @@ describe('CustomerIO', () => {
type: 'object',
action: 'identify',
identifiers: {
type_id: traits.object_type_id,
id: groupId
object_type_id: traits.object_type_id,
object_id: groupId
},
cio_relationships: [{ identifiers: { id: userId } }]
})
Expand Down Expand Up @@ -226,8 +226,8 @@ describe('CustomerIO', () => {
type: 'object',
action: 'identify_anonymous',
identifiers: {
type_id: traits.object_type_id,
id: groupId
object_type_id: traits.object_type_id,
object_id: groupId
},
cio_relationships: [{ identifiers: { anonymous_id: anonymousId } }]
})
Expand Down Expand Up @@ -279,8 +279,8 @@ describe('CustomerIO', () => {
type: 'object',
action: 'identify',
identifiers: {
type_id: '1',
id: groupId
object_type_id: '1',
object_id: groupId
},
cio_relationships: [{ identifiers: { id: userId } }]
})
Expand Down Expand Up @@ -327,8 +327,8 @@ describe('CustomerIO', () => {
type: 'object',
action: 'identify',
identifiers: {
type_id: typeId,
id: groupId
object_type_id: typeId,
object_id: groupId
},
cio_relationships: [{ identifiers: { id: userId } }]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ describe('CustomerIO', () => {
},
cio_relationships: {
action: 'add_relationships',
relationships: [{ identifiers: { type_id: '1', id: groupId } }]
relationships: [{ identifiers: { object_type_id: '1', object_id: groupId } }]
}
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const action: ActionDefinition<Settings, Payload> = {
body.created_at = createdAt
}
body.type = 'object'
body.identifiers = { type_id: typeID ?? '1', id: objectID }
body.identifiers = { object_type_id: typeID ?? '1', object_id: objectID }

if (userID) {
body.action = 'identify'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const action: ActionDefinition<Settings, Payload> = {
if (objectId) {
body.cio_relationships = {
action: 'add_relationships',
relationships: [{ identifiers: { type_id: objectTypeId ?? '1', id: objectId } }]
relationships: [{ identifiers: { object_type_id: objectTypeId ?? '1', object_id: objectId } }]
}
}

Expand Down