@segment/action-destinations 3.132.1-intercom-fix.12 → 3.132.1-staging.183
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/actable-predictive/index.js +1 -1
- package/dist/destinations/actable-predictive/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendCustomEvent/index.js +13 -13
- package/dist/destinations/actable-predictive/sendCustomEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendEmailEvent/index.js +20 -20
- package/dist/destinations/actable-predictive/sendEmailEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendTransactionEvent/index.js +28 -28
- package/dist/destinations/actable-predictive/sendTransactionEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendWebEvent/index.js +25 -25
- package/dist/destinations/actable-predictive/sendWebEvent/index.js.map +1 -1
- package/dist/destinations/actions-bingads/functions.d.ts +0 -0
- package/dist/destinations/actions-bingads/functions.js +2 -0
- package/dist/destinations/actions-bingads/functions.js.map +1 -0
- package/dist/destinations/actions-bingads/generated-types.d.ts +10 -0
- package/dist/destinations/actions-bingads/generated-types.js +3 -0
- package/dist/destinations/actions-bingads/generated-types.js.map +1 -0
- package/dist/destinations/actions-bingads/index.d.ts +4 -0
- package/dist/destinations/actions-bingads/index.js +77 -0
- package/dist/destinations/actions-bingads/index.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.d.ts +8 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.js +33 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.d.ts +7 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.js +3 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.d.ts +5 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.js +131 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.js.map +1 -0
- package/dist/destinations/braze/trackEvent/generated-types.d.ts +0 -1
- package/dist/destinations/braze/trackEvent/index.js +35 -11
- package/dist/destinations/braze/trackEvent/index.js.map +1 -1
- package/dist/destinations/braze/trackPurchase/index.js +43 -2
- package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
- package/dist/destinations/braze-cohorts/cohortChanges.d.ts +10 -0
- package/dist/destinations/braze-cohorts/cohortChanges.js +3 -0
- package/dist/destinations/braze-cohorts/cohortChanges.js.map +1 -0
- package/dist/destinations/clevertap/userDelete/index.js +4 -4
- package/dist/destinations/clevertap/userDelete/index.js.map +1 -1
- package/dist/destinations/cordial/addContactToList/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/addContactToList/index.js +2 -7
- package/dist/destinations/cordial/addContactToList/index.js.map +1 -1
- package/dist/destinations/cordial/addProductToCart/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/addProductToCart/index.js +3 -8
- package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
- package/dist/destinations/cordial/cordial-client.d.ts +11 -0
- package/dist/destinations/cordial/cordial-client.js +36 -8
- package/dist/destinations/cordial/cordial-client.js.map +1 -1
- package/dist/destinations/cordial/createContactactivity/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/createContactactivity/index.js +2 -7
- package/dist/destinations/cordial/createContactactivity/index.js.map +1 -1
- package/dist/destinations/cordial/generated-types.d.ts +1 -0
- package/dist/destinations/cordial/identities-fields.d.ts +3 -0
- package/dist/destinations/cordial/identities-fields.js +28 -0
- package/dist/destinations/cordial/identities-fields.js.map +1 -0
- package/dist/destinations/cordial/index.js +10 -2
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/mergeContacts/generated-types.d.ts +5 -0
- package/dist/destinations/cordial/mergeContacts/generated-types.js +3 -0
- package/dist/destinations/cordial/mergeContacts/generated-types.js.map +1 -0
- package/dist/destinations/cordial/mergeContacts/index.d.ts +5 -0
- package/dist/destinations/cordial/mergeContacts/index.js +40 -0
- package/dist/destinations/cordial/mergeContacts/index.js.map +1 -0
- package/dist/destinations/cordial/removeContactFromList/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/removeContactFromList/index.js +2 -7
- package/dist/destinations/cordial/removeContactFromList/index.js.map +1 -1
- package/dist/destinations/cordial/removeProductFromCart/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/removeProductFromCart/index.js +2 -7
- package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
- package/dist/destinations/cordial/upsertContact/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/upsertContact/index.js +2 -7
- package/dist/destinations/cordial/upsertContact/index.js.map +1 -1
- package/dist/destinations/cordial/upsertOrder/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/upsertOrder/index.js +10 -15
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
- package/dist/destinations/emarsys/addToContactList/generated-types.d.ts +5 -0
- package/dist/destinations/emarsys/addToContactList/generated-types.js +3 -0
- package/dist/destinations/emarsys/addToContactList/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/addToContactList/index.d.ts +5 -0
- package/dist/destinations/emarsys/addToContactList/index.js +116 -0
- package/dist/destinations/emarsys/addToContactList/index.js.map +1 -0
- package/dist/destinations/emarsys/emarsys-helper.d.ts +63 -0
- package/dist/destinations/emarsys/emarsys-helper.js +88 -0
- package/dist/destinations/emarsys/emarsys-helper.js.map +1 -0
- package/dist/destinations/emarsys/generated-types.d.ts +4 -0
- package/dist/destinations/emarsys/generated-types.js +3 -0
- package/dist/destinations/emarsys/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/index.d.ts +4 -0
- package/dist/destinations/emarsys/index.js +60 -0
- package/dist/destinations/emarsys/index.js.map +1 -0
- package/dist/destinations/emarsys/removeFromContactList/generated-types.d.ts +5 -0
- package/dist/destinations/emarsys/removeFromContactList/generated-types.js +3 -0
- package/dist/destinations/emarsys/removeFromContactList/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/removeFromContactList/index.d.ts +5 -0
- package/dist/destinations/emarsys/removeFromContactList/index.js +115 -0
- package/dist/destinations/emarsys/removeFromContactList/index.js.map +1 -0
- package/dist/destinations/emarsys/triggerEvent/generated-types.d.ts +8 -0
- package/dist/destinations/emarsys/triggerEvent/generated-types.js +3 -0
- package/dist/destinations/emarsys/triggerEvent/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/triggerEvent/index.d.ts +5 -0
- package/dist/destinations/emarsys/triggerEvent/index.js +126 -0
- package/dist/destinations/emarsys/triggerEvent/index.js.map +1 -0
- package/dist/destinations/emarsys/upsertContact/generated-types.d.ts +9 -0
- package/dist/destinations/emarsys/upsertContact/generated-types.js +3 -0
- package/dist/destinations/emarsys/upsertContact/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/upsertContact/index.d.ts +5 -0
- package/dist/destinations/emarsys/upsertContact/index.js +129 -0
- package/dist/destinations/emarsys/upsertContact/index.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +5 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.d.ts +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js +8 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +6 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +5 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +1 -0
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +1 -1
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +1 -1
- package/dist/destinations/google-sheets-partner/constants.d.ts +3 -0
- package/dist/destinations/google-sheets-partner/constants.js +7 -0
- package/dist/destinations/google-sheets-partner/constants.js.map +1 -0
- package/dist/destinations/google-sheets-partner/generated-types.d.ts +2 -0
- package/dist/destinations/google-sheets-partner/generated-types.js +3 -0
- package/dist/destinations/google-sheets-partner/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.d.ts +17 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.js +34 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/index.d.ts +4 -0
- package/dist/destinations/google-sheets-partner/index.js +43 -0
- package/dist/destinations/google-sheets-partner/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.d.ts +11 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.js +3 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.d.ts +5 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.js +79 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.d.ts +10 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.js +96 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.js.map +1 -0
- package/dist/destinations/index.js +3 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/livelike-cloud/trackEvent/generated-types.d.ts +1 -1
- package/dist/destinations/livelike-cloud/trackEvent/index.js +6 -12
- package/dist/destinations/livelike-cloud/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/index.js +1 -1
- package/dist/destinations/mixpanel/mixpanel-properties.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/trackPurchase/index.js.map +1 -1
- package/dist/destinations/salesforce/sf-properties.d.ts +1 -0
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- package/dist/destinations/saleswings/index.js +1 -1
- package/dist/destinations/saleswings/index.js.map +1 -1
- package/dist/destinations/segment/segment-properties.js +1 -2
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -1
- package/dist/destinations/tiktok-audiences/api/index.d.ts +11 -0
- package/dist/destinations/tiktok-audiences/api/index.js +38 -0
- package/dist/destinations/tiktok-audiences/api/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/constants.d.ts +2 -0
- package/dist/destinations/tiktok-audiences/constants.js +6 -0
- package/dist/destinations/tiktok-audiences/constants.js.map +1 -0
- package/dist/destinations/tiktok-audiences/generated-types.d.ts +3 -0
- package/dist/destinations/tiktok-audiences/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/index.d.ts +4 -0
- package/dist/destinations/tiktok-audiences/index.js +35 -0
- package/dist/destinations/tiktok-audiences/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/types.d.ts +33 -0
- package/dist/destinations/tiktok-audiences/types.js +3 -0
- package/dist/destinations/tiktok-audiences/types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/updateAudience/generated-types.d.ts +9 -0
- package/dist/destinations/tiktok-audiences/updateAudience/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/updateAudience/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/updateAudience/index.d.ts +5 -0
- package/dist/destinations/tiktok-audiences/updateAudience/index.js +160 -0
- package/dist/destinations/tiktok-audiences/updateAudience/index.js.map +1 -0
- package/package.json +2 -2
- package/dist/destinations/braze/utils.d.ts +0 -6
- package/dist/destinations/braze/utils.js +0 -81
- package/dist/destinations/braze/utils.js.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const formatter_1 = require("./formatter");
|
|
4
|
+
let authenticationToken = 'XXXXXXXX';
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Offline Conversions',
|
|
7
|
+
description: 'TODO',
|
|
8
|
+
fields: {
|
|
9
|
+
ConversionCurrencyCode: {
|
|
10
|
+
label: 'Conversion Currency Code',
|
|
11
|
+
description: 'Conversion Currency Code',
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true,
|
|
14
|
+
default: {
|
|
15
|
+
'@path': '$.properties.conversionCurrency'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
ConversionName: {
|
|
19
|
+
label: 'Conversion Name',
|
|
20
|
+
description: 'Conversion Name',
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: true,
|
|
23
|
+
default: {
|
|
24
|
+
'@path': '$.properties.conversionName'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
ConversionTime: {
|
|
28
|
+
label: 'Conversion Time',
|
|
29
|
+
description: 'Conversion Time',
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: true,
|
|
32
|
+
default: {
|
|
33
|
+
'@path': '$.properties.conversionTime'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
ConversionValue: {
|
|
37
|
+
label: 'Conversion Value',
|
|
38
|
+
description: 'Conversion Value',
|
|
39
|
+
type: 'string',
|
|
40
|
+
required: true,
|
|
41
|
+
default: {
|
|
42
|
+
'@path': '$.properties.conversionValue'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
MicrosoftClickId: {
|
|
46
|
+
label: 'Microsoft Click Id',
|
|
47
|
+
description: 'Microsoft Click Id',
|
|
48
|
+
type: 'string',
|
|
49
|
+
required: true,
|
|
50
|
+
default: {
|
|
51
|
+
'@path': '$.properties.msCId'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
perform: async (request, data) => {
|
|
56
|
+
const response_data = await formatter_1.getAccessToken({
|
|
57
|
+
client_id: data.settings.client_id,
|
|
58
|
+
scope: data.settings.scope,
|
|
59
|
+
redirect_uri: data.settings.redirect_uri,
|
|
60
|
+
grant_type: 'refresh_token',
|
|
61
|
+
client_secret: data.settings.client_secret,
|
|
62
|
+
refresh_token: data.settings.refreshToken
|
|
63
|
+
});
|
|
64
|
+
authenticationToken = response_data.access_token;
|
|
65
|
+
console.log('Access Token retrieved using Refresh Token ');
|
|
66
|
+
let conversionTime = data.payload.ConversionTime;
|
|
67
|
+
if (conversionTime.includes('UTC')) {
|
|
68
|
+
const val2 = conversionTime.replace(' UTC', '');
|
|
69
|
+
conversionTime = val2.replace(' ', 'T');
|
|
70
|
+
}
|
|
71
|
+
const conversionCurrency = data.payload.ConversionCurrencyCode;
|
|
72
|
+
const msCId = data.payload.MicrosoftClickId;
|
|
73
|
+
const conversionValue = data.payload.ConversionValue;
|
|
74
|
+
const conversionName = data.payload.ConversionName;
|
|
75
|
+
console.log('Conversion Goal: ', conversionName);
|
|
76
|
+
const endpoint = 'https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/V13/CampaignManagementService.svc?singleWsdl';
|
|
77
|
+
const sr = '<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" ' +
|
|
78
|
+
'xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' +
|
|
79
|
+
'<s:Header xmlns="https://bingads.microsoft.com/CampaignManagement/v13">' +
|
|
80
|
+
'<Action mustUnderstand="1">ApplyOfflineConversions</Action>' +
|
|
81
|
+
'<AuthenticationToken i:nil="false">' +
|
|
82
|
+
authenticationToken +
|
|
83
|
+
'</AuthenticationToken>' +
|
|
84
|
+
'<CustomerAccountId i:nil="false">' +
|
|
85
|
+
data.settings.customer_account_id +
|
|
86
|
+
'</CustomerAccountId>' +
|
|
87
|
+
'<CustomerId i:nil="false">' +
|
|
88
|
+
data.settings.customer_id +
|
|
89
|
+
'</CustomerId>' +
|
|
90
|
+
'<DeveloperToken i:nil="false">' +
|
|
91
|
+
data.settings.developer_token +
|
|
92
|
+
'</DeveloperToken>' +
|
|
93
|
+
'</s:Header>' +
|
|
94
|
+
'<s:Body>' +
|
|
95
|
+
'<ApplyOfflineConversionsRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v13">' +
|
|
96
|
+
'<OfflineConversions i:nil="false"><OfflineConversion><ConversionCurrencyCode i:nil="false">' +
|
|
97
|
+
conversionCurrency +
|
|
98
|
+
'</ConversionCurrencyCode>' +
|
|
99
|
+
'<ConversionName i:nil="false">' +
|
|
100
|
+
conversionName +
|
|
101
|
+
'</ConversionName>' +
|
|
102
|
+
'<ConversionTime>' +
|
|
103
|
+
conversionTime +
|
|
104
|
+
'</ConversionTime>' +
|
|
105
|
+
'<ConversionValue i:nil="false">' +
|
|
106
|
+
conversionValue +
|
|
107
|
+
'</ConversionValue>' +
|
|
108
|
+
'<MicrosoftClickId i:nil="false">' +
|
|
109
|
+
msCId +
|
|
110
|
+
'</MicrosoftClickId></OfflineConversion></OfflineConversions>' +
|
|
111
|
+
'</ApplyOfflineConversionsRequest></s:Body></s:Envelope>';
|
|
112
|
+
try {
|
|
113
|
+
const response = await request(endpoint, {
|
|
114
|
+
method: 'post',
|
|
115
|
+
headers: {
|
|
116
|
+
SOAPAction: 'ApplyOfflineConversions',
|
|
117
|
+
'Content-Type': 'text/xml;charset=utf-8'
|
|
118
|
+
},
|
|
119
|
+
body: sr,
|
|
120
|
+
redirect: 'follow'
|
|
121
|
+
});
|
|
122
|
+
console.log('***** Conversion Attributed successfully! *****');
|
|
123
|
+
console.log(response);
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
console.log(error.message);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
exports.default = action;
|
|
131
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/actions-bingads/offlineConversions/index.ts"],"names":[],"mappings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B,mBAAmB;YACnB,aAAa;YACb,UAAU;YACV,+FAA+F;YAC/F,6FAA6F;YAC7F,kBAAkB;YAClB,2BAA2B;YAC3B,gCAAgC;YAChC,cAAc;YACd,mBAAmB;YACnB,kBAAkB;YAClB,cAAc;YACd,mBAAmB;YACnB,iCAAiC;YACjC,eAAe;YACf,oBAAoB;YACpB,kCAAkC;YAClC,KAAK;YACL,8DAA8D;YAC9D,yDAAyD,CAAA;QAE3D,IAAI;YACF,MAAM,QAAQ,GAA8B,MAAM,OAAO,CAAC,QAAQ,EAAE;gBAClE,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,UAAU,EAAE,yBAAyB;oBACrC,cAAc,EAAE,wBAAwB;iBACzC;gBACD,IAAI,EAAE,EAAE;gBACR,QAAQ,EAAE,QAAQ;aACnB,CAAC,CAAA;YACF,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAA;YAC9D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;SACtB;QAAC,OAAO,KAAK,EAAE;YAEd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;SAC3B;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const dayjs_1 = __importDefault(require("../../../lib/dayjs"));
|
|
8
|
+
const userAlias_1 = require("../userAlias");
|
|
9
|
+
function toISO8601(date) {
|
|
10
|
+
if (date === null || date === undefined) {
|
|
11
|
+
return date;
|
|
12
|
+
}
|
|
13
|
+
const d = dayjs_1.default(date);
|
|
14
|
+
return d.isValid() ? d.toISOString() : undefined;
|
|
15
|
+
}
|
|
4
16
|
const action = {
|
|
5
17
|
title: 'Track Event',
|
|
6
18
|
description: 'Record custom events in Braze',
|
|
@@ -69,19 +81,31 @@ const action = {
|
|
|
69
81
|
description: 'Setting this flag to true will put the API in "Update Only" mode. When using a "user_alias", "Update Only" mode is always true.',
|
|
70
82
|
type: 'boolean',
|
|
71
83
|
default: false
|
|
72
|
-
},
|
|
73
|
-
enable_batching: {
|
|
74
|
-
type: 'boolean',
|
|
75
|
-
label: 'Batch Data to Braze',
|
|
76
|
-
description: 'If true, Segment will batch events before sending to Braze’s user track endpoint. Braze accepts batches of up to 75 events.',
|
|
77
|
-
default: false
|
|
78
84
|
}
|
|
79
85
|
},
|
|
80
86
|
perform: (request, { settings, payload }) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
const { braze_id, external_id } = payload;
|
|
88
|
+
const user_alias = userAlias_1.getUserAlias(payload.user_alias);
|
|
89
|
+
if (!braze_id && !user_alias && !external_id) {
|
|
90
|
+
throw new actions_core_1.IntegrationError('One of "external_id" or "user_alias" or "braze_id" is required.', 'Missing required fields', 400);
|
|
91
|
+
}
|
|
92
|
+
return request(`${settings.endpoint}/users/track`, {
|
|
93
|
+
method: 'post',
|
|
94
|
+
json: {
|
|
95
|
+
events: [
|
|
96
|
+
{
|
|
97
|
+
braze_id,
|
|
98
|
+
external_id,
|
|
99
|
+
user_alias,
|
|
100
|
+
app_id: settings.app_id,
|
|
101
|
+
name: payload.name,
|
|
102
|
+
time: toISO8601(payload.time),
|
|
103
|
+
properties: payload.properties,
|
|
104
|
+
_update_existing_only: payload._update_existing_only
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
});
|
|
85
109
|
}
|
|
86
110
|
};
|
|
87
111
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/braze/trackEvent/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/braze/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAwD;AAIxD,+DAAsC;AACtC,4CAA2C;AAK3C,SAAS,SAAS,CAAC,IAAe;IAChC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;QACvC,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,CAAC,GAAG,eAAK,CAAC,IAAI,CAAC,CAAA;IACrB,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AAClD,CAAC;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,+BAA+B;IAC5C,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,yGAAyG;YAC3G,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,KAAK,EAAE,YAAY;oBACnB,IAAI,EAAE,QAAQ;iBACf;gBACD,WAAW,EAAE;oBACX,KAAK,EAAE,aAAa;oBACpB,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,uBAAuB;YAC9B,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,gBAAgB;YAC7B,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;wBAC9B,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;qBACrD;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const dayjs_1 = __importDefault(require("../../../lib/dayjs"));
|
|
8
|
+
const userAlias_1 = require("../userAlias");
|
|
9
|
+
function toISO8601(date) {
|
|
10
|
+
if (date === null || date === undefined) {
|
|
11
|
+
return date;
|
|
12
|
+
}
|
|
13
|
+
const d = dayjs_1.default(date);
|
|
14
|
+
return d.isValid() ? d.toISOString() : undefined;
|
|
15
|
+
}
|
|
4
16
|
const action = {
|
|
5
17
|
title: 'Track Purchase',
|
|
6
18
|
description: 'Record purchases in Braze',
|
|
@@ -93,7 +105,36 @@ const action = {
|
|
|
93
105
|
}
|
|
94
106
|
},
|
|
95
107
|
perform: (request, { settings, payload }) => {
|
|
96
|
-
|
|
108
|
+
const { braze_id, external_id } = payload;
|
|
109
|
+
const user_alias = userAlias_1.getUserAlias(payload.user_alias);
|
|
110
|
+
if (!braze_id && !user_alias && !external_id) {
|
|
111
|
+
throw new actions_core_1.IntegrationError('One of "external_id" or "user_alias" or "braze_id" is required.', 'Missing required fields', 400);
|
|
112
|
+
}
|
|
113
|
+
if (payload.products.length === 0) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const reservedKeys = Object.keys(action.fields.products.properties ?? {});
|
|
117
|
+
const properties = actions_core_1.omit(payload.properties, reservedKeys);
|
|
118
|
+
const base = {
|
|
119
|
+
braze_id,
|
|
120
|
+
external_id,
|
|
121
|
+
user_alias,
|
|
122
|
+
app_id: settings.app_id,
|
|
123
|
+
time: toISO8601(payload.time),
|
|
124
|
+
properties,
|
|
125
|
+
_update_existing_only: payload._update_existing_only
|
|
126
|
+
};
|
|
127
|
+
const purchases = payload.products.map((product) => ({
|
|
128
|
+
...base,
|
|
129
|
+
product_id: product.product_id,
|
|
130
|
+
currency: product.currency ?? 'USD',
|
|
131
|
+
price: product.price,
|
|
132
|
+
quantity: product.quantity
|
|
133
|
+
}));
|
|
134
|
+
return request(`${settings.endpoint}/users/track`, {
|
|
135
|
+
method: 'post',
|
|
136
|
+
json: { purchases }
|
|
137
|
+
});
|
|
97
138
|
}
|
|
98
139
|
};
|
|
99
140
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/braze/trackPurchase/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/braze/trackPurchase/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA8D;AAI9D,+DAAsC;AACtC,4CAA2C;AAK3C,SAAS,SAAS,CAAC,IAAe;IAChC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;QACvC,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,CAAC,GAAG,eAAK,CAAC,IAAI,CAAC,CAAA;IACrB,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AAClD,CAAC;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,2BAA2B;IACxC,mBAAmB,EAAE,2BAA2B;IAChD,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,U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U;YAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;YACnC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAC,CAAC,CAAA;QAEH,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,cAAc,EAAE;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,SAAS,EAAE;SACpB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohortChanges.js","sourceRoot":"","sources":["../../../src/destinations/braze-cohorts/cohortChanges.ts"],"names":[],"mappings":""}
|
|
@@ -10,18 +10,18 @@ const action = {
|
|
|
10
10
|
description: 'The ID of the profile which you want to delete',
|
|
11
11
|
default: { '@path': '$.userId' },
|
|
12
12
|
required: true
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
14
|
},
|
|
15
15
|
perform: (request, { settings, payload }) => {
|
|
16
16
|
const event = {
|
|
17
|
-
identity: payload.identity
|
|
17
|
+
identity: payload.identity
|
|
18
18
|
};
|
|
19
19
|
return request(`${settings.clevertapEndpoint}/1/delete/profiles.json`, {
|
|
20
20
|
method: 'post',
|
|
21
21
|
json: event,
|
|
22
22
|
headers: {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
'X-CleverTap-Account-Id': `${settings.clevertapAccountId}`,
|
|
24
|
+
'X-CleverTap-Passcode': `${settings.clevertapPasscode}`
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userDelete/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gDAAgD;YAC7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userDelete/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gDAAgD;YAC7D,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;YAChC,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,KAAK,GAAgB;YACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAA;QACD,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,iBAAiB,yBAAyB,EAAE;YACrE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;YACX,OAAO,EAAE;gBACP,wBAAwB,EAAE,GAAG,QAAQ,CAAC,kBAAkB,EAAE;gBAC1D,sBAAsB,EAAE,GAAG,QAAQ,CAAC,iBAAiB,EAAE;aACxD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,18 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const identities_fields_1 = __importDefault(require("../identities-fields"));
|
|
7
8
|
const action = {
|
|
8
9
|
title: 'Add Contact to List',
|
|
9
10
|
description: 'Add contact to a list. If the list does not exist in Cordial it will be created.',
|
|
10
11
|
defaultSubscription: 'type = "group"',
|
|
11
12
|
fields: {
|
|
12
|
-
|
|
13
|
-
label: 'User Identities',
|
|
14
|
-
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
-
type: 'object',
|
|
16
|
-
required: true,
|
|
17
|
-
defaultObjectUI: 'keyvalue:only'
|
|
18
|
-
},
|
|
13
|
+
...identities_fields_1.default,
|
|
19
14
|
groupId: {
|
|
20
15
|
label: 'Group ID',
|
|
21
16
|
description: 'Segment group id. Required.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addContactToList/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addContactToList/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,6EAAqD;AAErD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,kFAAkF;IAC/F,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,GAAG,2BAAkB;QACrB,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,4GAA4G;YAC9G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACzC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,18 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const identities_fields_1 = __importDefault(require("../identities-fields"));
|
|
7
8
|
const action = {
|
|
8
9
|
title: 'Add Product to Cart',
|
|
9
10
|
description: 'Add product to Cordial contact cart',
|
|
10
11
|
defaultSubscription: 'type = "track" and event = "Product Added"',
|
|
11
12
|
fields: {
|
|
12
|
-
|
|
13
|
-
label: 'User Identities',
|
|
14
|
-
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
-
type: 'object',
|
|
16
|
-
required: true,
|
|
17
|
-
defaultObjectUI: 'keyvalue:only'
|
|
18
|
-
},
|
|
13
|
+
...identities_fields_1.default,
|
|
19
14
|
productID: {
|
|
20
15
|
label: 'Product ID',
|
|
21
16
|
description: 'Internal identifier of a product',
|
|
@@ -105,7 +100,7 @@ const action = {
|
|
|
105
100
|
coupon: { '@path': '$.properties.coupon' }
|
|
106
101
|
},
|
|
107
102
|
defaultObjectUI: 'keyvalue:only'
|
|
108
|
-
}
|
|
103
|
+
}
|
|
109
104
|
},
|
|
110
105
|
perform: (request, { settings, payload }) => {
|
|
111
106
|
const client = new cordial_client_1.default(settings, request);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addProductToCart/index.ts"],"names":[],"mappings":";;;;;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addProductToCart/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,6EAAqD;AAErD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,qCAAqC;IAClD,mBAAmB,EAAE,4CAA4C;IACjE,MAAM,EAAE;QACN,GAAG,2BAAkB;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;SACF;QACD,GAAG,EAAE;YACH,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,kBAAkB;aAC5B;SACF;QACD,GAAG,EAAE;YACH,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB;aAC7B;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,SAAS,EAAE;YACT,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;QACD,GAAG,EAAE;YACH,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,kBAAkB;aAC5B;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,wBAAwB;aAClC;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,KAAK,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;gBACxC,OAAO,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE;gBAC5C,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;aAC3C;YACD,eAAe,EAAE,eAAe;SACjC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACzC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -7,10 +7,20 @@ import { Payload as UpsertContactPayload } from './upsertContact/generated-types
|
|
|
7
7
|
import { Payload as AddProductToCartPayload } from './addProductToCart/generated-types';
|
|
8
8
|
import { Payload as RemoveProductFromCartPayload } from './removeProductFromCart/generated-types';
|
|
9
9
|
import { Payload as UpsertOrder } from './upsertOrder/generated-types';
|
|
10
|
+
import { Payload as MergeContacts } from './mergeContacts/generated-types';
|
|
11
|
+
export interface IdentifiableRequest {
|
|
12
|
+
segmentId?: string | null;
|
|
13
|
+
anonymousId?: string | null;
|
|
14
|
+
userIdentities?: {
|
|
15
|
+
[k: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
10
18
|
declare class CordialClient {
|
|
11
19
|
private readonly apiUrl;
|
|
12
20
|
private readonly request;
|
|
21
|
+
private readonly identityKeys;
|
|
13
22
|
constructor(settings: Settings, request: RequestClient);
|
|
23
|
+
extractIdentities(payload: IdentifiableRequest): IdentifiableRequest;
|
|
14
24
|
addContactActivity(payload: CreateContactactivityPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
15
25
|
upsertContact(payload: UpsertContactPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
16
26
|
addContactToList(payload: AddContactToListPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
@@ -18,5 +28,6 @@ declare class CordialClient {
|
|
|
18
28
|
addProductToCart(payload: AddProductToCartPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
19
29
|
removeProductFromCart(payload: RemoveProductFromCartPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
20
30
|
upsertOrder(payload: UpsertOrder): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
31
|
+
mergeContacts(payload: MergeContacts): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
21
32
|
}
|
|
22
33
|
export default CordialClient;
|
|
@@ -4,12 +4,23 @@ class CordialClient {
|
|
|
4
4
|
constructor(settings, request) {
|
|
5
5
|
this.apiUrl = `${settings.endpoint}/api/segment`;
|
|
6
6
|
this.request = request;
|
|
7
|
+
this.identityKeys = {
|
|
8
|
+
segmentIdKey: settings.segmentIdKey
|
|
9
|
+
};
|
|
7
10
|
}
|
|
8
|
-
|
|
11
|
+
extractIdentities(payload) {
|
|
12
|
+
return {
|
|
13
|
+
segmentId: payload.segmentId,
|
|
14
|
+
anonymousId: payload.anonymousId,
|
|
15
|
+
userIdentities: payload.userIdentities
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
async addContactActivity(payload) {
|
|
9
19
|
return this.request(`${this.apiUrl}/createContactactivity`, {
|
|
10
20
|
method: 'post',
|
|
11
21
|
json: {
|
|
12
|
-
|
|
22
|
+
...this.identityKeys,
|
|
23
|
+
...this.extractIdentities(payload),
|
|
13
24
|
action: payload.action,
|
|
14
25
|
time: payload.time,
|
|
15
26
|
properties: payload.properties,
|
|
@@ -21,7 +32,8 @@ class CordialClient {
|
|
|
21
32
|
return this.request(`${this.apiUrl}/upsertContact`, {
|
|
22
33
|
method: 'post',
|
|
23
34
|
json: {
|
|
24
|
-
|
|
35
|
+
...this.identityKeys,
|
|
36
|
+
...this.extractIdentities(payload),
|
|
25
37
|
attributes: payload.attributes
|
|
26
38
|
}
|
|
27
39
|
});
|
|
@@ -30,7 +42,8 @@ class CordialClient {
|
|
|
30
42
|
return this.request(`${this.apiUrl}/addContactToList`, {
|
|
31
43
|
method: 'post',
|
|
32
44
|
json: {
|
|
33
|
-
|
|
45
|
+
...this.identityKeys,
|
|
46
|
+
...this.extractIdentities(payload),
|
|
34
47
|
groupId: payload.groupId,
|
|
35
48
|
listName: payload.listName
|
|
36
49
|
}
|
|
@@ -40,7 +53,8 @@ class CordialClient {
|
|
|
40
53
|
return this.request(`${this.apiUrl}/removeContactFromList`, {
|
|
41
54
|
method: 'post',
|
|
42
55
|
json: {
|
|
43
|
-
|
|
56
|
+
...this.identityKeys,
|
|
57
|
+
...this.extractIdentities(payload),
|
|
44
58
|
groupId: payload.groupId
|
|
45
59
|
}
|
|
46
60
|
});
|
|
@@ -49,7 +63,8 @@ class CordialClient {
|
|
|
49
63
|
return this.request(`${this.apiUrl}/addProductToCart`, {
|
|
50
64
|
method: 'post',
|
|
51
65
|
json: {
|
|
52
|
-
|
|
66
|
+
...this.identityKeys,
|
|
67
|
+
...this.extractIdentities(payload),
|
|
53
68
|
productID: payload.productID,
|
|
54
69
|
sku: payload.sku,
|
|
55
70
|
qty: payload.qty,
|
|
@@ -67,7 +82,8 @@ class CordialClient {
|
|
|
67
82
|
return this.request(`${this.apiUrl}/removeProductFromCart`, {
|
|
68
83
|
method: 'post',
|
|
69
84
|
json: {
|
|
70
|
-
|
|
85
|
+
...this.identityKeys,
|
|
86
|
+
...this.extractIdentities(payload),
|
|
71
87
|
productID: payload.productID,
|
|
72
88
|
qty: payload.qty
|
|
73
89
|
}
|
|
@@ -77,7 +93,8 @@ class CordialClient {
|
|
|
77
93
|
return this.request(`${this.apiUrl}/upsertOrder`, {
|
|
78
94
|
method: 'post',
|
|
79
95
|
json: {
|
|
80
|
-
|
|
96
|
+
...this.identityKeys,
|
|
97
|
+
...this.extractIdentities(payload),
|
|
81
98
|
orderID: payload.orderID,
|
|
82
99
|
purchaseDate: payload.purchaseDate,
|
|
83
100
|
status: payload.status,
|
|
@@ -87,6 +104,17 @@ class CordialClient {
|
|
|
87
104
|
}
|
|
88
105
|
});
|
|
89
106
|
}
|
|
107
|
+
mergeContacts(payload) {
|
|
108
|
+
return this.request(`${this.apiUrl}/mergeContacts`, {
|
|
109
|
+
method: 'post',
|
|
110
|
+
json: {
|
|
111
|
+
...this.identityKeys,
|
|
112
|
+
anonymousId: payload.anonymousId,
|
|
113
|
+
segmentId: payload.segmentId,
|
|
114
|
+
previousId: payload.previousId
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
90
118
|
}
|
|
91
119
|
exports.default = CordialClient;
|
|
92
120
|
//# sourceMappingURL=cordial-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cordial-client.js","sourceRoot":"","sources":["../../../src/destinations/cordial/cordial-client.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cordial-client.js","sourceRoot":"","sources":["../../../src/destinations/cordial/cordial-client.ts"],"names":[],"mappings":";;AAmBA,MAAM,aAAa;IAKjB,YAAY,QAAkB,EAAE,OAAsB;QACpD,IAAI,CAAC,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,cAAc,CAAA;QAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,YAAY,GAAG;YAClB,YAAY,EAAE,QAAQ,CAAC,YAAY;SACpC,CAAA;IACH,CAAC;IAED,iBAAiB,CAAC,OAA4B;QAC5C,OAAO;YACL,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,cAAc,EAAE,OAAO,CAAC,cAAc;SACvC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAqC;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,wBAAwB,EAAE;YAC1D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,GAAG,IAAI,CAAC,YAAY;gBACpB,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;gBAClC,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,gBAAgB,EAAE;YAClD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,GAAG,IAAI,CAAC,YAAY;gBACpB,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;gBAClC,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B;SACF,CAAC,CAAA;IACJ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CAAC,CAAA;IACJ,CAAC;CACF;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -4,18 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const identities_fields_1 = __importDefault(require("../identities-fields"));
|
|
7
8
|
const action = {
|
|
8
9
|
title: 'Create Contactactivity',
|
|
9
10
|
description: 'Create a new contact activity.',
|
|
10
11
|
defaultSubscription: 'type = "track" or type = "page"',
|
|
11
12
|
fields: {
|
|
12
|
-
|
|
13
|
-
label: 'User Identities',
|
|
14
|
-
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
-
type: 'object',
|
|
16
|
-
required: true,
|
|
17
|
-
defaultObjectUI: 'keyvalue:only'
|
|
18
|
-
},
|
|
13
|
+
...identities_fields_1.default,
|
|
19
14
|
action: {
|
|
20
15
|
label: 'Event name',
|
|
21
16
|
description: 'Event name. Required.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/createContactactivity/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/createContactactivity/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,6EAAqD;AAErD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,iCAAiC;IACtD,MAAM,EAAE;QACN,GAAG,2BAAkB;QACrB,MAAM,EAAE;YACN,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;oBAC9B,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;oBAC5B,IAAI,EAAE,UAAU;iBACjB;aACF;SACF;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,+GAA+G;YACjH,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,qDAAqD;YAClE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,eAAe;YACtB,WAAW,EACT,4HAA4H;YAC9H,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|