Skip to content

Commit 4fe0224

Browse files
authored
added dynamic identifiers (#3704)
* added dynamic identifiers * check invalid identifiers * fix typescript issue * fix hyperengage test * deepreview fixes * added types
1 parent 9c02367 commit 4fe0224

6 files changed

Lines changed: 449 additions & 164 deletions

File tree

packages/destination-actions/src/destinations/hyperengage/__tests__/validateInput.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe('validateInput', () => {
8181
expect(payload.traits.industry).toEqual(fakeGroupData.industry)
8282
expect(payload.traits.website).toEqual(fakeGroupData.website)
8383
expect(payload.traits).toHaveProperty('required')
84-
expect(payload.local_tz_offset).toEqual(60)
84+
expect(payload.local_tz_offset).toEqual(120)
8585
})
8686
})
8787

packages/destination-actions/src/destinations/memora-internal/upsertProfile.types.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,15 @@ export interface Payload {
1414
*/
1515
memora_store: string
1616
/**
17-
* Profile identifiers (email and/or phone). At least one identifier is required. These identifiers are stored in the Contact trait group.
17+
* Profile identifiers from all trait groups. At runtime, each event must contain at least one identifier with a non-null value, and at least two total non-null fields across identifiers and traits combined. Events with sparse data (e.g., only one identifier present) will be rejected. These fields are dynamically loaded from the selected Memora Store. When manually entering keys, use the format "TraitGroupName.$.traitName" (e.g., "Contact.$.email", "Contact.$.phone").
1818
*/
1919
profile_identifiers: {
20-
/**
21-
* User email address
22-
*/
23-
email?: string
24-
/**
25-
* User phone number
26-
*/
27-
phone?: string
20+
[k: string]: unknown
2821
}
2922
/**
30-
* Traits for the profile from all trait groups. At least one trait is required. These fields are dynamically loaded from the selected Memora Store. When manually entering keys, use the format "TraitGroupName.$.traitName" (e.g., "Contact.$.firstName", "PurchaseHistory.$.lastPurchaseDate").
23+
* Traits for the profile from all trait groups. While this field is optional in the mapping configuration, at runtime each event must have at least two total non-null fields across identifiers and traits combined. If you map only one identifier, you must also map at least one trait that will have a value for your events. These fields are dynamically loaded from the selected Memora Store. When manually entering keys, use the format "TraitGroupName.$.traitName" (e.g., "Contact.$.firstName", "PurchaseHistory.$.lastPurchaseDate").
3124
*/
32-
profile_traits: {
25+
profile_traits?: {
3326
[k: string]: unknown
3427
}
3528
}

packages/destination-actions/src/destinations/memora/__tests__/snapshot.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe(`Testing snapshot for ${destinationSlug} destination:`, () => {
3636
...event.properties,
3737
memora_store: 'test-store-id',
3838
profile_identifiers: {
39-
39+
'Contact.$.email': '[email protected]'
4040
},
4141
profile_traits: {
4242
'Contact.$.firstName': 'Test'
@@ -81,7 +81,7 @@ describe(`Testing snapshot for ${destinationSlug} destination:`, () => {
8181
...event.properties,
8282
memora_store: 'test-store-id',
8383
profile_identifiers: {
84-
84+
'Contact.$.email': '[email protected]'
8585
},
8686
profile_traits: {
8787
'Contact.$.firstName': 'Test',

0 commit comments

Comments
 (0)