@segment/action-destinations 3.248.1-staging-1 → 3.250.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/display-video-360/shared.js +1 -1
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js +19 -6
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +1 -1
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js +11 -0
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.d.ts +1 -0
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/kafka/generated-types.d.ts +2 -0
- package/dist/destinations/kafka/index.js +28 -9
- package/dist/destinations/kafka/index.js.map +1 -1
- package/dist/destinations/kafka/utils.d.ts +2 -1
- package/dist/destinations/kafka/utils.js +22 -8
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/kevel/index.js +2 -2
- package/dist/destinations/kevel/index.js.map +1 -1
- package/dist/destinations/kevel/syncAudience/index.js +1 -1
- package/dist/destinations/kevel/syncAudience/index.js.map +1 -1
- package/dist/destinations/kevel/syncTraits/index.js +1 -1
- package/dist/destinations/kevel/syncTraits/index.js.map +1 -1
- package/dist/destinations/kevel-audience/generated-types.d.ts +8 -0
- package/dist/destinations/kevel-audience/generated-types.js.map +1 -0
- package/dist/destinations/kevel-audience/index.d.ts +4 -0
- package/dist/destinations/kevel-audience/index.js +65 -0
- package/dist/destinations/kevel-audience/index.js.map +1 -0
- package/dist/destinations/kevel-audience/syncKevelAudience/generated-types.d.ts +6 -0
- package/dist/destinations/kevel-audience/syncKevelAudience/generated-types.js.map +1 -0
- package/dist/destinations/kevel-audience/syncKevelAudience/index.js +51 -0
- package/dist/destinations/kevel-audience/syncKevelAudience/index.js.map +1 -0
- package/dist/destinations/klaviyo/addProfileToList/index.js +2 -15
- package/dist/destinations/klaviyo/addProfileToList/index.js.map +1 -1
- package/dist/destinations/klaviyo/index.js +3 -9
- package/dist/destinations/klaviyo/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/customEvent/generated-types.d.ts +1 -0
- package/dist/destinations/optimizely-data-platform/customEvent/index.js +8 -1
- package/dist/destinations/optimizely-data-platform/customEvent/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/emailEvent/generated-types.d.ts +1 -1
- package/dist/destinations/optimizely-data-platform/emailEvent/index.js +14 -8
- package/dist/destinations/optimizely-data-platform/emailEvent/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/fields.d.ts +1 -0
- package/dist/destinations/optimizely-data-platform/fields.js +10 -4
- package/dist/destinations/optimizely-data-platform/fields.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/index.js +22 -8
- package/dist/destinations/optimizely-data-platform/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/nonEcommCustomEvent/generated-types.d.ts +2 -1
- package/dist/destinations/optimizely-data-platform/nonEcommCustomEvent/index.js +2 -0
- package/dist/destinations/optimizely-data-platform/nonEcommCustomEvent/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/upsertContact/generated-types.d.ts +3 -0
- package/dist/destinations/optimizely-data-platform/upsertContact/index.js +8 -1
- package/dist/destinations/optimizely-data-platform/upsertContact/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/utils.d.ts +5 -0
- package/dist/destinations/optimizely-data-platform/utils.js +14 -1
- package/dist/destinations/optimizely-data-platform/utils.js.map +1 -1
- package/dist/destinations/responsys/index.js +1 -1
- package/dist/destinations/responsys/index.js.map +1 -1
- package/dist/destinations/segment/segment-properties.d.ts +1 -0
- package/dist/destinations/segment/segment-properties.js +7 -1
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendGroup/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendGroup/index.js +39 -25
- package/dist/destinations/segment/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment/sendIdentify/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendIdentify/index.js +39 -25
- package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment/sendPage/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendPage/index.js +47 -33
- package/dist/destinations/segment/sendPage/index.js.map +1 -1
- package/dist/destinations/segment/sendScreen/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendScreen/index.js +40 -26
- package/dist/destinations/segment/sendScreen/index.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendTrack/index.js +43 -29
- package/dist/destinations/segment/sendTrack/index.js.map +1 -1
- package/dist/destinations/segment-profiles/index.js +1 -3
- package/dist/destinations/segment-profiles/index.js.map +1 -1
- package/dist/destinations/segment-profiles/segment-properties.d.ts +0 -2
- package/dist/destinations/segment-profiles/segment-properties.js +1 -14
- package/dist/destinations/segment-profiles/segment-properties.js.map +1 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +11 -10
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js +37 -30
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.d.ts +2 -2
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js +4 -4
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +0 -14
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +0 -5
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +0 -113
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +0 -20
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +0 -5
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +0 -174
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +0 -1
- package/dist/destinations/responsys/rsp-operations.d.ts +0 -14
- package/dist/destinations/responsys/rsp-operations.js +0 -33
- package/dist/destinations/responsys/rsp-operations.js.map +0 -1
- package/dist/destinations/responsys/rsp-properties.d.ts +0 -4
- package/dist/destinations/responsys/rsp-properties.js +0 -27
- package/dist/destinations/responsys/rsp-properties.js.map +0 -1
- package/dist/destinations/segment-profiles/sendTrack/generated-types.d.ts +0 -10
- package/dist/destinations/segment-profiles/sendTrack/generated-types.js +0 -3
- package/dist/destinations/segment-profiles/sendTrack/generated-types.js.map +0 -1
- package/dist/destinations/segment-profiles/sendTrack/index.js +0 -41
- package/dist/destinations/segment-profiles/sendTrack/index.js.map +0 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +0 -3
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +0 -43
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +0 -1
- /package/dist/destinations/{responsys/asyncMergePetRecords → kevel-audience}/generated-types.js +0 -0
- /package/dist/destinations/{responsys/asyncMergeProfileListMembers → kevel-audience/syncKevelAudience}/generated-types.js +0 -0
- /package/dist/destinations/{segment-profiles/sendTrack → kevel-audience/syncKevelAudience}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendGroup/index.ts"],"names":[],"mappings":";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AA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -23,39 +23,53 @@ const action = {
|
|
|
23
23
|
user_agent: segment_properties_1.user_agent,
|
|
24
24
|
timezone: segment_properties_1.timezone,
|
|
25
25
|
group_id: segment_properties_1.group_id,
|
|
26
|
-
traits: segment_properties_1.traits
|
|
26
|
+
traits: segment_properties_1.traits,
|
|
27
|
+
enable_batching: segment_properties_1.enable_batching
|
|
27
28
|
},
|
|
28
29
|
perform: (_request, { payload, statsContext }) => {
|
|
29
30
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
30
31
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
31
32
|
}
|
|
32
|
-
const identifyPayload =
|
|
33
|
-
userId: payload?.user_id,
|
|
34
|
-
anonymousId: payload?.anonymous_id,
|
|
35
|
-
timestamp: payload?.timestamp,
|
|
36
|
-
context: {
|
|
37
|
-
app: payload?.application,
|
|
38
|
-
campaign: payload?.campaign_parameters,
|
|
39
|
-
device: payload?.device,
|
|
40
|
-
ip: payload?.ip_address,
|
|
41
|
-
locale: payload?.locale,
|
|
42
|
-
location: payload?.location,
|
|
43
|
-
network: payload?.network,
|
|
44
|
-
os: payload?.operating_system,
|
|
45
|
-
page: payload?.page,
|
|
46
|
-
screen: payload?.screen,
|
|
47
|
-
userAgent: payload?.user_agent,
|
|
48
|
-
timezone: payload?.timezone,
|
|
49
|
-
groupId: payload?.group_id
|
|
50
|
-
},
|
|
51
|
-
traits: {
|
|
52
|
-
...payload?.traits
|
|
53
|
-
},
|
|
54
|
-
type: 'identify'
|
|
55
|
-
};
|
|
33
|
+
const identifyPayload = convertPayload(payload);
|
|
56
34
|
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendIdentify']);
|
|
57
35
|
return { batch: [identifyPayload] };
|
|
36
|
+
},
|
|
37
|
+
performBatch: (_request, { payload, statsContext }) => {
|
|
38
|
+
const identifyPayload = payload.map((data) => {
|
|
39
|
+
if (!data.anonymous_id && !data.user_id) {
|
|
40
|
+
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
41
|
+
}
|
|
42
|
+
return convertPayload(data);
|
|
43
|
+
});
|
|
44
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:identifyBatchPayload']);
|
|
45
|
+
return { batch: identifyPayload };
|
|
58
46
|
}
|
|
59
47
|
};
|
|
48
|
+
function convertPayload(data) {
|
|
49
|
+
return {
|
|
50
|
+
userId: data?.user_id,
|
|
51
|
+
anonymousId: data?.anonymous_id,
|
|
52
|
+
timestamp: data?.timestamp,
|
|
53
|
+
context: {
|
|
54
|
+
app: data?.application,
|
|
55
|
+
campaign: data?.campaign_parameters,
|
|
56
|
+
device: data?.device,
|
|
57
|
+
ip: data?.ip_address,
|
|
58
|
+
locale: data?.locale,
|
|
59
|
+
location: data?.location,
|
|
60
|
+
network: data?.network,
|
|
61
|
+
os: data?.operating_system,
|
|
62
|
+
page: data?.page,
|
|
63
|
+
screen: data?.screen,
|
|
64
|
+
userAgent: data?.user_agent,
|
|
65
|
+
timezone: data?.timezone,
|
|
66
|
+
groupId: data?.group_id
|
|
67
|
+
},
|
|
68
|
+
traits: {
|
|
69
|
+
...data?.traits
|
|
70
|
+
},
|
|
71
|
+
type: 'identify'
|
|
72
|
+
};
|
|
73
|
+
}
|
|
60
74
|
exports.default = action;
|
|
61
75
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendIdentify/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendIdentify/index.ts"],"names":[],"mappings":";;AAGA,8DAmB8B;AAC9B,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,gIAAgI;IAClI,mBAAmB,EAAE,mBAAmB;IACxC,MA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,CAAA;QAEF,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC,CAAA;QAC1G,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAA;IACnC,CAAC;CACF,CAAA;AAED,SAAS,cAAc,CAAC,IAAa;IACnC,OAAO;QACL,MAAM,EAAE,IAAI,EAAE,OAAO;QACrB,WAAW,EAAE,IAAI,EAAE,YAAY;QAC/B,SAAS,EAAE,IAAI,EAAE,SAAS;QAC1B,OAAO,EAAE;YACP,GAAG,EAAE,IAAI,EAAE,WAAW;YACtB,QAAQ,EAAE,IAAI,EAAE,mBAAmB;YACnC,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,EAAE,EAAE,IAAI,EAAE,UAAU;YACpB,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,QAAQ,EAAE,IAAI,EAAE,QAAQ;YACxB,OAAO,EAAE,IAAI,EAAE,OAAO;YACtB,EAAE,EAAE,IAAI,EAAE,gBAAgB;YAC1B,IAAI,EAAE,IAAI,EAAE,IAAI;YAChB,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,SAAS,EAAE,IAAI,EAAE,UAAU;YAC3B,QAAQ,EAAE,IAAI,EAAE,QAAQ;YACxB,OAAO,EAAE,IAAI,EAAE,QAAQ;SACxB;QACD,MAAM,EAAE;YACN,GAAG,IAAI,EAAE,MAAM;SAChB;QACD,IAAI,EAAE,UAAU;KACjB,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -25,47 +25,61 @@ const action = {
|
|
|
25
25
|
user_agent: segment_properties_1.user_agent,
|
|
26
26
|
timezone: segment_properties_1.timezone,
|
|
27
27
|
group_id: segment_properties_1.group_id,
|
|
28
|
-
properties: segment_properties_1.properties
|
|
28
|
+
properties: segment_properties_1.properties,
|
|
29
|
+
enable_batching: segment_properties_1.enable_batching
|
|
29
30
|
},
|
|
30
31
|
perform: (_request, { payload, statsContext }) => {
|
|
31
32
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
32
33
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
33
34
|
}
|
|
34
|
-
const pagePayload =
|
|
35
|
-
userId: payload?.user_id,
|
|
36
|
-
anonymousId: payload?.anonymous_id,
|
|
37
|
-
timestamp: payload?.timestamp,
|
|
38
|
-
name: payload?.page_name,
|
|
39
|
-
context: {
|
|
40
|
-
app: payload?.application,
|
|
41
|
-
campaign: payload?.campaign_parameters,
|
|
42
|
-
device: payload?.device,
|
|
43
|
-
ip: payload?.ip_address,
|
|
44
|
-
locale: payload?.locale,
|
|
45
|
-
location: payload?.location,
|
|
46
|
-
network: payload?.network,
|
|
47
|
-
os: payload?.operating_system,
|
|
48
|
-
page: payload?.page,
|
|
49
|
-
screen: payload?.screen,
|
|
50
|
-
userAgent: payload?.user_agent,
|
|
51
|
-
timezone: payload?.timezone,
|
|
52
|
-
groupId: payload?.group_id
|
|
53
|
-
},
|
|
54
|
-
properties: {
|
|
55
|
-
name: payload?.page_name,
|
|
56
|
-
category: payload?.page_category,
|
|
57
|
-
path: payload?.page?.path,
|
|
58
|
-
referrer: payload?.page?.referrer,
|
|
59
|
-
search: payload?.page?.search,
|
|
60
|
-
title: payload?.page?.title,
|
|
61
|
-
url: payload?.page?.url,
|
|
62
|
-
...payload?.properties
|
|
63
|
-
},
|
|
64
|
-
type: 'page'
|
|
65
|
-
};
|
|
35
|
+
const pagePayload = convertPayload(payload);
|
|
66
36
|
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendPage']);
|
|
67
37
|
return { batch: [pagePayload] };
|
|
38
|
+
},
|
|
39
|
+
performBatch: (_request, { payload, statsContext }) => {
|
|
40
|
+
const pagePayload = payload.map((data) => {
|
|
41
|
+
if (!data.anonymous_id && !data.user_id) {
|
|
42
|
+
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
43
|
+
}
|
|
44
|
+
return convertPayload(data);
|
|
45
|
+
});
|
|
46
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendBatchPage']);
|
|
47
|
+
return { batch: pagePayload };
|
|
68
48
|
}
|
|
69
49
|
};
|
|
50
|
+
function convertPayload(data) {
|
|
51
|
+
return {
|
|
52
|
+
userId: data?.user_id,
|
|
53
|
+
anonymousId: data?.anonymous_id,
|
|
54
|
+
timestamp: data?.timestamp,
|
|
55
|
+
name: data?.page_name,
|
|
56
|
+
context: {
|
|
57
|
+
app: data?.application,
|
|
58
|
+
campaign: data?.campaign_parameters,
|
|
59
|
+
device: data?.device,
|
|
60
|
+
ip: data?.ip_address,
|
|
61
|
+
locale: data?.locale,
|
|
62
|
+
location: data?.location,
|
|
63
|
+
network: data?.network,
|
|
64
|
+
os: data?.operating_system,
|
|
65
|
+
page: data?.page,
|
|
66
|
+
screen: data?.screen,
|
|
67
|
+
userAgent: data?.user_agent,
|
|
68
|
+
timezone: data?.timezone,
|
|
69
|
+
groupId: data?.group_id
|
|
70
|
+
},
|
|
71
|
+
properties: {
|
|
72
|
+
name: data?.page_name,
|
|
73
|
+
category: data?.page_category,
|
|
74
|
+
path: data?.page?.path,
|
|
75
|
+
referrer: data?.page?.referrer,
|
|
76
|
+
search: data?.page?.search,
|
|
77
|
+
title: data?.page?.title,
|
|
78
|
+
url: data?.page?.url,
|
|
79
|
+
...data?.properties
|
|
80
|
+
},
|
|
81
|
+
type: 'page'
|
|
82
|
+
};
|
|
83
|
+
}
|
|
70
84
|
exports.default = action;
|
|
71
85
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendPage/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendPage/index.ts"],"names":[],"mappings":";;AAGA,8DAqB8B;AAC9B,sCAAk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IAAI,EAAE,QAAQ;YAC9B,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM;YAC1B,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK;YACxB,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG;YACpB,GAAG,IAAI,EAAE,UAAU;SACpB;QACD,IAAI,EAAE,MAAM;KACb,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -24,40 +24,54 @@ const action = {
|
|
|
24
24
|
user_agent: segment_properties_1.user_agent,
|
|
25
25
|
timezone: segment_properties_1.timezone,
|
|
26
26
|
group_id: segment_properties_1.group_id,
|
|
27
|
-
properties: segment_properties_1.properties
|
|
27
|
+
properties: segment_properties_1.properties,
|
|
28
|
+
enable_batching: segment_properties_1.enable_batching
|
|
28
29
|
},
|
|
29
30
|
perform: (_request, { payload, statsContext }) => {
|
|
30
31
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
31
32
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
32
33
|
}
|
|
33
|
-
const screenPayload =
|
|
34
|
-
userId: payload?.user_id,
|
|
35
|
-
anonymousId: payload?.anonymous_id,
|
|
36
|
-
timestamp: payload?.timestamp,
|
|
37
|
-
name: payload?.screen_name,
|
|
38
|
-
context: {
|
|
39
|
-
app: payload?.application,
|
|
40
|
-
campaign: payload?.campaign_parameters,
|
|
41
|
-
device: payload?.device,
|
|
42
|
-
ip: payload?.ip_address,
|
|
43
|
-
locale: payload?.locale,
|
|
44
|
-
location: payload?.location,
|
|
45
|
-
network: payload?.network,
|
|
46
|
-
os: payload?.operating_system,
|
|
47
|
-
page: payload?.page,
|
|
48
|
-
screen: payload?.screen,
|
|
49
|
-
userAgent: payload?.user_agent,
|
|
50
|
-
groupId: payload?.group_id
|
|
51
|
-
},
|
|
52
|
-
properties: {
|
|
53
|
-
name: payload?.screen_name,
|
|
54
|
-
...payload?.properties
|
|
55
|
-
},
|
|
56
|
-
type: 'screen'
|
|
57
|
-
};
|
|
34
|
+
const screenPayload = convertPayload(payload);
|
|
58
35
|
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendScreen']);
|
|
59
36
|
return { batch: [screenPayload] };
|
|
37
|
+
},
|
|
38
|
+
performBatch: (_request, { payload, statsContext }) => {
|
|
39
|
+
const screenPayload = payload.map((data) => {
|
|
40
|
+
if (!data.anonymous_id && !data.user_id) {
|
|
41
|
+
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
42
|
+
}
|
|
43
|
+
return convertPayload(data);
|
|
44
|
+
});
|
|
45
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendBatchScreen']);
|
|
46
|
+
return { batch: screenPayload };
|
|
60
47
|
}
|
|
61
48
|
};
|
|
49
|
+
function convertPayload(data) {
|
|
50
|
+
return {
|
|
51
|
+
userId: data?.user_id,
|
|
52
|
+
anonymousId: data?.anonymous_id,
|
|
53
|
+
timestamp: data?.timestamp,
|
|
54
|
+
name: data?.screen_name,
|
|
55
|
+
context: {
|
|
56
|
+
app: data?.application,
|
|
57
|
+
campaign: data?.campaign_parameters,
|
|
58
|
+
device: data?.device,
|
|
59
|
+
ip: data?.ip_address,
|
|
60
|
+
locale: data?.locale,
|
|
61
|
+
location: data?.location,
|
|
62
|
+
network: data?.network,
|
|
63
|
+
os: data?.operating_system,
|
|
64
|
+
page: data?.page,
|
|
65
|
+
screen: data?.screen,
|
|
66
|
+
userAgent: data?.user_agent,
|
|
67
|
+
groupId: data?.group_id
|
|
68
|
+
},
|
|
69
|
+
properties: {
|
|
70
|
+
name: data?.screen_name,
|
|
71
|
+
...data?.properties
|
|
72
|
+
},
|
|
73
|
+
type: 'screen'
|
|
74
|
+
};
|
|
75
|
+
}
|
|
62
76
|
exports.default = action;
|
|
63
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendScreen/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendScreen/index.ts"],"names":[],"mappings":";;AAGA,8DAoB8B;AAC9B,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,8FAA8F;IAC3G,mBAAmB,EAAE,iBAAiB;IACtC,MAAM,EAAE;QACN,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,SAAS,EAAT,8BAAS;QACT,WAAW,EAAX,gCAAW;QACX,WAAW,EAAX,gCAAW;QACX,mBAAmB,EAAnB,wCAAmB;QACnB,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,MAAM,EAAN,2BAAM;QACN,QAAQ,EAAR,6BAAQ;QACR,OAAO,EAAP,4BAAO;QACP,gBAAgB,EAAhB,qCAAgB;QAChB,IAAI,EAAJ,yBAAI;QACJ,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,QAAQ,EAAR,6BAAQ;QACR,QAAQ,EAAR,6BAAQ;QACR,UAAU,EAAV,+BAAU;QACV,eAAe,EAAf,oCAAe;KAChB;IACD,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/C,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YAC7C,MAAM,+CAAsC,CAAA;SAC7C;QAED,MAAM,aAAa,GAAW,cAAc,CAAC,OAAO,CAAC,CAAA;QAErD,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAA;QAChG,OAAO,EAAE,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,CAAA;IACnC,CAAC;IACD,YAAY,EAAE,CAAC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UAAU;SACpB;QACD,IAAI,EAAE,QAAQ;KACf,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -25,43 +25,57 @@ const action = {
|
|
|
25
25
|
timezone: segment_properties_1.timezone,
|
|
26
26
|
group_id: segment_properties_1.group_id,
|
|
27
27
|
properties: segment_properties_1.properties,
|
|
28
|
-
traits: segment_properties_1.traits
|
|
28
|
+
traits: segment_properties_1.traits,
|
|
29
|
+
enable_batching: segment_properties_1.enable_batching
|
|
29
30
|
},
|
|
30
31
|
perform: (_request, { payload, statsContext }) => {
|
|
31
32
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
32
33
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
33
34
|
}
|
|
34
|
-
const trackPayload =
|
|
35
|
-
userId: payload?.user_id,
|
|
36
|
-
anonymousId: payload?.anonymous_id,
|
|
37
|
-
timestamp: payload?.timestamp,
|
|
38
|
-
event: payload?.event_name,
|
|
39
|
-
context: {
|
|
40
|
-
traits: {
|
|
41
|
-
...payload?.traits
|
|
42
|
-
},
|
|
43
|
-
app: payload?.application,
|
|
44
|
-
campaign: payload?.campaign_parameters,
|
|
45
|
-
device: payload?.device,
|
|
46
|
-
ip: payload?.ip_address,
|
|
47
|
-
locale: payload?.locale,
|
|
48
|
-
location: payload?.location,
|
|
49
|
-
network: payload?.network,
|
|
50
|
-
os: payload?.operating_system,
|
|
51
|
-
page: payload?.page,
|
|
52
|
-
screen: payload?.screen,
|
|
53
|
-
userAgent: payload?.user_agent,
|
|
54
|
-
timezone: payload?.timezone,
|
|
55
|
-
groupId: payload?.group_id
|
|
56
|
-
},
|
|
57
|
-
properties: {
|
|
58
|
-
...payload?.properties
|
|
59
|
-
},
|
|
60
|
-
type: 'track'
|
|
61
|
-
};
|
|
35
|
+
const trackPayload = convertPayload(payload);
|
|
62
36
|
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendTrack']);
|
|
63
37
|
return { batch: [trackPayload] };
|
|
38
|
+
},
|
|
39
|
+
performBatch: (_request, { payload, statsContext }) => {
|
|
40
|
+
const trackPayload = payload.map((data) => {
|
|
41
|
+
if (!data.anonymous_id && !data.user_id) {
|
|
42
|
+
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
43
|
+
}
|
|
44
|
+
return convertPayload(data);
|
|
45
|
+
});
|
|
46
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendBatchTrack']);
|
|
47
|
+
return { batch: trackPayload };
|
|
64
48
|
}
|
|
65
49
|
};
|
|
50
|
+
function convertPayload(data) {
|
|
51
|
+
return {
|
|
52
|
+
userId: data?.user_id,
|
|
53
|
+
anonymousId: data?.anonymous_id,
|
|
54
|
+
timestamp: data?.timestamp,
|
|
55
|
+
event: data?.event_name,
|
|
56
|
+
context: {
|
|
57
|
+
traits: {
|
|
58
|
+
...data?.traits
|
|
59
|
+
},
|
|
60
|
+
app: data?.application,
|
|
61
|
+
campaign: data?.campaign_parameters,
|
|
62
|
+
device: data?.device,
|
|
63
|
+
ip: data?.ip_address,
|
|
64
|
+
locale: data?.locale,
|
|
65
|
+
location: data?.location,
|
|
66
|
+
network: data?.network,
|
|
67
|
+
os: data?.operating_system,
|
|
68
|
+
page: data?.page,
|
|
69
|
+
screen: data?.screen,
|
|
70
|
+
userAgent: data?.user_agent,
|
|
71
|
+
timezone: data?.timezone,
|
|
72
|
+
groupId: data?.group_id
|
|
73
|
+
},
|
|
74
|
+
properties: {
|
|
75
|
+
...data?.properties
|
|
76
|
+
},
|
|
77
|
+
type: 'track'
|
|
78
|
+
};
|
|
79
|
+
}
|
|
66
80
|
exports.default = action;
|
|
67
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendTrack/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src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ACpB;QACD,IAAI,EAAE,OAAO;KACd,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const sendGroup_1 = __importDefault(require("./sendGroup"));
|
|
7
7
|
const sendIdentify_1 = __importDefault(require("./sendIdentify"));
|
|
8
8
|
const sendSubscription_1 = __importDefault(require("./sendSubscription"));
|
|
9
|
-
const sendTrack_1 = __importDefault(require("./sendTrack"));
|
|
10
9
|
const destination = {
|
|
11
10
|
name: 'Segment Profiles',
|
|
12
11
|
slug: 'actions-segment-profiles',
|
|
@@ -14,8 +13,7 @@ const destination = {
|
|
|
14
13
|
actions: {
|
|
15
14
|
sendGroup: sendGroup_1.default,
|
|
16
15
|
sendIdentify: sendIdentify_1.default,
|
|
17
|
-
sendSubscription: sendSubscription_1.default
|
|
18
|
-
sendTrack: sendTrack_1.default
|
|
16
|
+
sendSubscription: sendSubscription_1.default
|
|
19
17
|
}
|
|
20
18
|
};
|
|
21
19
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAGA,4DAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAGA,4DAAmC;AAEnC,kEAAyC;AAEzC,0EAAiD;AAEjD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IACb,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;QACT,YAAY,EAAZ,sBAAY;QACZ,gBAAgB,EAAhB,0BAAgB;KACjB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -5,5 +5,3 @@ export declare const group_id: InputField;
|
|
|
5
5
|
export declare const traits: InputField;
|
|
6
6
|
export declare const engage_space: InputField;
|
|
7
7
|
export declare const timestamp: InputField;
|
|
8
|
-
export declare const event_name: InputField;
|
|
9
|
-
export declare const properties: InputField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.timestamp = exports.engage_space = exports.traits = exports.group_id = exports.anonymous_id = exports.user_id = void 0;
|
|
4
4
|
exports.user_id = {
|
|
5
5
|
label: 'User ID',
|
|
6
6
|
description: 'Unique identifier for the user in your database. A userId or an anonymousId is required.',
|
|
@@ -38,17 +38,4 @@ exports.timestamp = {
|
|
|
38
38
|
'@path': '$.timestamp'
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
exports.event_name = {
|
|
42
|
-
label: 'Event Name',
|
|
43
|
-
description: 'Name of the action that a user has performed.',
|
|
44
|
-
type: 'string',
|
|
45
|
-
required: true
|
|
46
|
-
};
|
|
47
|
-
exports.properties = {
|
|
48
|
-
label: 'Properties',
|
|
49
|
-
description: 'Free-form dictionary of properties that describe the screen.',
|
|
50
|
-
type: 'object',
|
|
51
|
-
defaultObjectUI: 'keyvalue',
|
|
52
|
-
additionalProperties: true
|
|
53
|
-
};
|
|
54
41
|
//# sourceMappingURL=segment-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-properties.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/segment-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,0FAA0F;IACvG,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,kJAAkJ;IACpJ,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,0EAA0E;IACvF,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,sSAAsS;IACxS,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,6BAA6B;IAC1C,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA
|
|
1
|
+
{"version":3,"file":"segment-properties.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/segment-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,0FAA0F;IACvG,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,kJAAkJ;IACpJ,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,0EAA0E;IACvF,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,sSAAsS;IACxS,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,6BAA6B;IAC1C,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA"}
|
|
@@ -77,7 +77,6 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
77
77
|
const { integration, event_name, event_time, user_data, custom_data, action_source, app_data } = data[0];
|
|
78
78
|
const { em, ph } = user_data;
|
|
79
79
|
const { brands, content_category, content_ids, currency, num_items, value } = custom_data;
|
|
80
|
-
const { app_id } = app_data;
|
|
81
80
|
expect(integration).toBe('segment');
|
|
82
81
|
expect(event_name).toBe('PURCHASE');
|
|
83
82
|
expect(event_time).toBe(1652368875449);
|
|
@@ -86,7 +85,7 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
86
85
|
expect(currency).toBe('USD');
|
|
87
86
|
expect(value).toBe(15);
|
|
88
87
|
expect(action_source).toBe('website');
|
|
89
|
-
expect(
|
|
88
|
+
expect(app_data).toBeUndefined();
|
|
90
89
|
expect(brands).toEqual(['Hasbro', 'Mattel']);
|
|
91
90
|
expect(content_category).toEqual(['games', 'games']);
|
|
92
91
|
expect(content_ids).toEqual(['123', '456']);
|
|
@@ -117,7 +116,6 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
117
116
|
const { integration, event_name, event_source_url, event_time, user_data, custom_data, action_source, app_data } = data[0];
|
|
118
117
|
const { client_ip_address, client_user_agent, em, ph } = user_data;
|
|
119
118
|
const { currency, value } = custom_data;
|
|
120
|
-
const { app_id } = app_data;
|
|
121
119
|
expect(integration).toBe('segment');
|
|
122
120
|
expect(event_name).toBe('PURCHASE');
|
|
123
121
|
expect(event_source_url).toBe('https://segment.com/academy/');
|
|
@@ -129,7 +127,7 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
129
127
|
expect(currency).toBe('USD');
|
|
130
128
|
expect(value).toBe(15);
|
|
131
129
|
expect(action_source).toBe('website');
|
|
132
|
-
expect(
|
|
130
|
+
expect(app_data).toBeUndefined();
|
|
133
131
|
});
|
|
134
132
|
it('should fail web event without pixel_id', async () => {
|
|
135
133
|
nock_1.default(/.*/).post(/.*/).reply(200);
|
|
@@ -197,7 +195,6 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
197
195
|
const { integration, event_name, event_source_url, event_time, user_data, custom_data, action_source, app_data } = data[0];
|
|
198
196
|
const { client_ip_address, client_user_agent, em, ph } = user_data;
|
|
199
197
|
const { currency, value } = custom_data;
|
|
200
|
-
const { app_id } = app_data;
|
|
201
198
|
expect(integration).toBe('segment');
|
|
202
199
|
expect(event_name).toBe('SAVE');
|
|
203
200
|
expect(event_source_url).toBe('https://segment.com/academy/');
|
|
@@ -208,8 +205,8 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
208
205
|
expect(ph[0]).toBe('dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383');
|
|
209
206
|
expect(currency).toBe('USD');
|
|
210
207
|
expect(value).toBe(15);
|
|
211
|
-
expect(action_source).toBe('
|
|
212
|
-
expect(
|
|
208
|
+
expect(action_source).toBe('OFFLINE');
|
|
209
|
+
expect(app_data).toBeUndefined();
|
|
213
210
|
});
|
|
214
211
|
it('should handle a mobile app event conversion type', async () => {
|
|
215
212
|
nock_1.default(/.*/).post(/.*/).reply(200);
|
|
@@ -240,6 +237,7 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
240
237
|
const { integration, event_name, event_source_url, event_time, user_data, custom_data, action_source, app_data } = data[0];
|
|
241
238
|
const { client_ip_address, client_user_agent, em, ph } = user_data;
|
|
242
239
|
const { currency, value } = custom_data;
|
|
240
|
+
const { extinfo, advertiser_tracking_enabled } = app_data;
|
|
243
241
|
expect(integration).toBe('segment');
|
|
244
242
|
expect(event_name).toBe('SAVE');
|
|
245
243
|
expect(event_source_url).toBe('https://segment.com/academy/');
|
|
@@ -251,7 +249,8 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
251
249
|
expect(currency).toBe('USD');
|
|
252
250
|
expect(value).toBe(15);
|
|
253
251
|
expect(action_source).toBe('app');
|
|
254
|
-
expect(
|
|
252
|
+
expect(extinfo).toEqual(['i2', '', '', '', '17.2', 'iPhone12,1', '', '', '', '', '', '', '', '', '', '']);
|
|
253
|
+
expect(advertiser_tracking_enabled).toBe(0);
|
|
255
254
|
});
|
|
256
255
|
it('should fail invalid currency', async () => {
|
|
257
256
|
nock_1.default(/.*/).post(/.*/).reply(200);
|
|
@@ -324,7 +323,7 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
324
323
|
const { integration, event_name, event_source_url, event_time, user_data, custom_data, action_source, app_data } = data[0];
|
|
325
324
|
const { client_ip_address, client_user_agent, em, ph } = user_data;
|
|
326
325
|
const { currency, value } = custom_data;
|
|
327
|
-
const { app_id } = app_data;
|
|
326
|
+
const { app_id, advertiser_tracking_enabled } = app_data;
|
|
328
327
|
expect(integration).toBe('segment');
|
|
329
328
|
expect(event_name).toBe('CUSTOM_EVENT_5');
|
|
330
329
|
expect(event_source_url).toBe('https://segment.com/academy/');
|
|
@@ -337,6 +336,7 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
337
336
|
expect(value).toBe(15);
|
|
338
337
|
expect(action_source).toBe('app');
|
|
339
338
|
expect(app_id).toBe('123');
|
|
339
|
+
expect(advertiser_tracking_enabled).toBe(0);
|
|
340
340
|
});
|
|
341
341
|
it('should fail event missing all Snap identifiers', async () => {
|
|
342
342
|
const event = actions_core_1.createTestEvent({
|
|
@@ -388,11 +388,12 @@ const capiV3tests = () => describe('CAPIv3 Implementation', () => {
|
|
|
388
388
|
const { data } = body;
|
|
389
389
|
expect(data.length).toBe(1);
|
|
390
390
|
const { integration, event_name, event_time, user_data, action_source } = data[0];
|
|
391
|
-
const { em } = user_data;
|
|
391
|
+
const { em, ph } = user_data;
|
|
392
392
|
expect(integration).toBe('segment');
|
|
393
393
|
expect(event_name).toBe('PURCHASE');
|
|
394
394
|
expect(event_time).toBe(1652368875449);
|
|
395
395
|
expect(em[0]).toBe('cc779c04191c2e736d89e45c11339c8382832bcaf70383f7df94e3d08ba7a6d9');
|
|
396
|
+
expect(ph).toBeUndefined();
|
|
396
397
|
expect(action_source).toBe('website');
|
|
397
398
|
});
|
|
398
399
|
it('should handle event with phone as only Snap identifier', async () => {
|