@segment/action-destinations 3.74.4-alpha.3 → 3.74.4-alpha.6
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/personas-messaging-twilio/generated-types.d.ts +0 -1
- package/dist/destinations/personas-messaging-twilio/index.js +2 -10
- package/dist/destinations/personas-messaging-twilio/index.js.map +1 -1
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js +1 -3
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/generated-types.d.ts +2 -2
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +3 -41
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +0 -30
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js +0 -308
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -1
- package/package.json +2 -2
|
@@ -129,13 +129,6 @@ const destination = {
|
|
|
129
129
|
format: 'uri',
|
|
130
130
|
required: false
|
|
131
131
|
},
|
|
132
|
-
twilioHostname: {
|
|
133
|
-
label: 'Twilio host name',
|
|
134
|
-
description: 'Overrides the default Twilio host name used mainly for testing without having to send real messages.',
|
|
135
|
-
type: 'string',
|
|
136
|
-
default: 'api.twilio.com',
|
|
137
|
-
required: false
|
|
138
|
-
},
|
|
139
132
|
connectionOverrides: {
|
|
140
133
|
label: 'Connection Overrides',
|
|
141
134
|
description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
|
|
@@ -145,9 +138,8 @@ const destination = {
|
|
|
145
138
|
properties: ConnectionOverridesProperties
|
|
146
139
|
}
|
|
147
140
|
},
|
|
148
|
-
testAuthentication: (request
|
|
149
|
-
|
|
150
|
-
return request(`https://${hostName}/2010-04-01`);
|
|
141
|
+
testAuthentication: (request) => {
|
|
142
|
+
return request('https://api.twilio.com/2010-04-01');
|
|
151
143
|
}
|
|
152
144
|
},
|
|
153
145
|
actions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/personas-messaging-twilio/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA+B;AAE/B,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAsC,EAAE;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC;SACd,IAAI,CAAC,CAAC,CAAC;SACP,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACzD,CAAC,CAAA;AAED,MAAM,6BAA6B,GAA+B;IAChE,EAAE,EAAE;QACF,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,gGAAgG;QAC7G,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;KACzB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,0IAA0I;QAC5I,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;KACzB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,2DAA2D;QACxE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;KACzB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,uFAAuF;QACpG,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;KACrB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,iCAAiC;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AI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,0BAA0B;gBACjC,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,+DAA+D;gBAC5E,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,KAAK;aAChB;YACD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/personas-messaging-twilio/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA+B;AAE/B,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAsC,EAAE;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC;SACd,IAAI,CAAC,CAAC,CAAC;SACP,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACzD,CAAC,CAAA;AAED,MAAM,6BAA6B,GAA+B;IAChE,EAAE,EAAE;QACF,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,gGAAgG;QAC7G,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;KACzB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,cAAc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AE,aAAa;gBACtB,UAAU,EAAE,6BAA6B;aAC1C;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,mCAAmC,CAAC,CAAA;QACrD,CAAC;KACF;IASD,OAAO,EAAE;QACP,OAAO,EAAP,iBAAO;KACR;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -18,7 +18,6 @@ const fetchProfileTraits = async (request, settings, profileId) => {
|
|
|
18
18
|
return body.traits;
|
|
19
19
|
};
|
|
20
20
|
const EXTERNAL_ID_KEY = 'phone';
|
|
21
|
-
const DEFAULT_HOSTNAME = 'api.twilio.com';
|
|
22
21
|
const DEFAULT_CONNECTION_OVERRIDES = 'rp=all&rc=5';
|
|
23
22
|
const action = {
|
|
24
23
|
title: 'Send SMS',
|
|
@@ -150,8 +149,7 @@ const action = {
|
|
|
150
149
|
webhookUrlWithParams.hash = connectionOverrides || DEFAULT_CONNECTION_OVERRIDES;
|
|
151
150
|
body.append('StatusCallback', webhookUrlWithParams.toString());
|
|
152
151
|
}
|
|
153
|
-
|
|
154
|
-
return request(`https://${hostname}/2010-04-01/Accounts/${settings.twilioAccountSID}/Messages.json`, {
|
|
152
|
+
return request(`https://api.twilio.com/2010-04-01/Accounts/${settings.twilioAccountSID}/Messages.json`, {
|
|
155
153
|
method: 'POST',
|
|
156
154
|
headers: {
|
|
157
155
|
authorization: `Basic ${token}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/personas-messaging-twilio/sendSms/index.ts"],"names":[],"mappings":";;AAAA,uCAA6C;AAK7C,wDAAwD;AAExD,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAE7B,MAAM,qBAAqB,GAAG,CAAC,WAAmB,EAAU,EAAE;IAC5D,OAAO,4BAA4B,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAA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AC,CAAA;gBAChD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;oBACzC,oBAAoB,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;iBACvE;gBAED,oBAAoB,CAAC,IAAI,GAAG,mBAAmB,IAAI,4BAA4B,CAAA;gBAE/E,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,CAAA;aAC/D;YAED,OAAO,OAAO,CAAC,8CAA8C,QAAQ,CAAC,gBAAgB,gBAAgB,EAAE;gBACtG,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,KAAK,EAAE;iBAChC;gBACD,IAAI;aACL,CAAC,CAAA;SACH;aAAM;YACL,MAAM,IAAI,+BAAgB,CACxB,+DAA+D,UAAU,CAAC,kBAAkB,IAAI,EAChG,kCAAkC,EAClC,GAAG,CACJ,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,49 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const snap_capi_properties_1 = require("../snap-capi-properties");
|
|
5
|
-
const CONVERSION_EVENT_URL = 'https://tr.snapchat.com/v2/conversion';
|
|
6
3
|
const action = {
|
|
7
4
|
title: 'Report Conversion Event',
|
|
8
5
|
description: 'Report events directly to Snapchat. Data shared can power Snap solutions such as custom audience targeting, campaign optimization, Dynamic Ads, and more.',
|
|
9
|
-
fields: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
event_tag: snap_capi_properties_1.event_tag,
|
|
13
|
-
timestamp: { ...snap_capi_properties_1.timestamp, required: true },
|
|
14
|
-
email: snap_capi_properties_1.email,
|
|
15
|
-
mobile_ad_id: snap_capi_properties_1.mobile_ad_id,
|
|
16
|
-
uuid_c1: snap_capi_properties_1.uuid_c1,
|
|
17
|
-
idfv: snap_capi_properties_1.idfv,
|
|
18
|
-
phone_number: snap_capi_properties_1.phone_number,
|
|
19
|
-
user_agent: snap_capi_properties_1.user_agent,
|
|
20
|
-
ip_address: snap_capi_properties_1.ip_address,
|
|
21
|
-
item_category: snap_capi_properties_1.item_category,
|
|
22
|
-
item_ids: snap_capi_properties_1.item_ids,
|
|
23
|
-
description: snap_capi_properties_1.description,
|
|
24
|
-
number_items: snap_capi_properties_1.number_items,
|
|
25
|
-
price: snap_capi_properties_1.price,
|
|
26
|
-
currency: snap_capi_properties_1.currency,
|
|
27
|
-
transaction_id: snap_capi_properties_1.transaction_id,
|
|
28
|
-
level: snap_capi_properties_1.level,
|
|
29
|
-
client_dedup_id: snap_capi_properties_1.client_dedup_id,
|
|
30
|
-
search_string: snap_capi_properties_1.search_string,
|
|
31
|
-
page_url: snap_capi_properties_1.page_url,
|
|
32
|
-
sign_up_method: snap_capi_properties_1.sign_up_method
|
|
33
|
-
},
|
|
34
|
-
perform: (request, data) => {
|
|
35
|
-
const payload = snap_capi_properties_1.formatPayload(data.payload);
|
|
36
|
-
const settings = snap_capi_properties_1.conversionType(data.settings, data.payload.event_conversion_type);
|
|
37
|
-
if (data.payload.currency && !snap_capi_properties_1.CURRENCY_ISO_4217_CODES.has(data.payload.currency)) {
|
|
38
|
-
throw new actions_core_1.IntegrationError(`${data.payload.currency} is not a valid currency code.`, 'Misconfigured required field', 400);
|
|
39
|
-
}
|
|
40
|
-
return request(CONVERSION_EVENT_URL, {
|
|
41
|
-
method: 'post',
|
|
42
|
-
json: {
|
|
43
|
-
...payload,
|
|
44
|
-
...settings
|
|
45
|
-
}
|
|
46
|
-
});
|
|
6
|
+
fields: {},
|
|
7
|
+
perform: () => {
|
|
8
|
+
return;
|
|
47
9
|
}
|
|
48
10
|
};
|
|
49
11
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/snap-conversions-api/reportConversionEvent/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/snap-conversions-api/reportConversionEvent/index.ts"],"names":[],"mappings":";;AAqFA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,2JAA2J;IAC7J,MAAM,EAAE,EAAE;IAEV,OAAO,EAAE,GAAG,EAAE;QACZ,OAAM;IACR,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { InputField } from '@segment/actions-core/src/destination-kit/types';
|
|
2
|
-
import { Settings } from '../snap-conversions-api/generated-types';
|
|
3
|
-
import { Payload } from './reportConversionEvent/generated-types';
|
|
4
|
-
export declare const CURRENCY_ISO_4217_CODES: Set<string>;
|
|
5
|
-
export declare const event_type: InputField;
|
|
6
|
-
export declare const event_conversion_type: InputField;
|
|
7
|
-
export declare const event_tag: InputField;
|
|
8
|
-
export declare const timestamp: InputField;
|
|
9
|
-
export declare const email: InputField;
|
|
10
|
-
export declare const mobile_ad_id: InputField;
|
|
11
|
-
export declare const uuid_c1: InputField;
|
|
12
|
-
export declare const idfv: InputField;
|
|
13
|
-
export declare const phone_number: InputField;
|
|
14
|
-
export declare const user_agent: InputField;
|
|
15
|
-
export declare const ip_address: InputField;
|
|
16
|
-
export declare const item_category: InputField;
|
|
17
|
-
export declare const item_ids: InputField;
|
|
18
|
-
export declare const description: InputField;
|
|
19
|
-
export declare const number_items: InputField;
|
|
20
|
-
export declare const price: InputField;
|
|
21
|
-
export declare const currency: InputField;
|
|
22
|
-
export declare const transaction_id: InputField;
|
|
23
|
-
export declare const level: InputField;
|
|
24
|
-
export declare const client_dedup_id: InputField;
|
|
25
|
-
export declare const search_string: InputField;
|
|
26
|
-
export declare const page_url: InputField;
|
|
27
|
-
export declare const sign_up_method: InputField;
|
|
28
|
-
export declare const conversionType: (settings: Settings, event_conversion_type: String) => Settings;
|
|
29
|
-
export declare const hash: (value: string | undefined) => string | undefined;
|
|
30
|
-
export declare const formatPayload: (payload: Payload) => Object;
|
|
@@ -1,310 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatPayload = exports.hash = exports.conversionType = exports.sign_up_method = exports.page_url = exports.search_string = exports.client_dedup_id = exports.level = exports.transaction_id = exports.currency = exports.price = exports.number_items = exports.description = exports.item_ids = exports.item_category = exports.ip_address = exports.user_agent = exports.phone_number = exports.idfv = exports.uuid_c1 = exports.mobile_ad_id = exports.email = exports.timestamp = exports.event_tag = exports.event_conversion_type = exports.event_type = exports.CURRENCY_ISO_4217_CODES = void 0;
|
|
4
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
-
const crypto_1 = require("crypto");
|
|
6
|
-
exports.CURRENCY_ISO_4217_CODES = new Set([
|
|
7
|
-
'USD',
|
|
8
|
-
'AED',
|
|
9
|
-
'AUD',
|
|
10
|
-
'BGN',
|
|
11
|
-
'BRL',
|
|
12
|
-
'CAD',
|
|
13
|
-
'CHF',
|
|
14
|
-
'CLP',
|
|
15
|
-
'CNY',
|
|
16
|
-
'COP',
|
|
17
|
-
'CZK',
|
|
18
|
-
'DKK',
|
|
19
|
-
'EGP',
|
|
20
|
-
'EUR',
|
|
21
|
-
'GBP',
|
|
22
|
-
'GIP',
|
|
23
|
-
'HKD',
|
|
24
|
-
'HRK',
|
|
25
|
-
'HUF',
|
|
26
|
-
'IDR',
|
|
27
|
-
'ILS',
|
|
28
|
-
'INR',
|
|
29
|
-
'JPY',
|
|
30
|
-
'KRW',
|
|
31
|
-
'KWD',
|
|
32
|
-
'KZT',
|
|
33
|
-
'LBP',
|
|
34
|
-
'MXN',
|
|
35
|
-
'MYR',
|
|
36
|
-
'NGN',
|
|
37
|
-
'NOK',
|
|
38
|
-
'NZD',
|
|
39
|
-
'PEN',
|
|
40
|
-
'PHP',
|
|
41
|
-
'PKR',
|
|
42
|
-
'PLN',
|
|
43
|
-
'QAR',
|
|
44
|
-
'RON',
|
|
45
|
-
'RUB',
|
|
46
|
-
'SAR',
|
|
47
|
-
'SEK',
|
|
48
|
-
'SGD',
|
|
49
|
-
'THB',
|
|
50
|
-
'TRY',
|
|
51
|
-
'TWD',
|
|
52
|
-
'TZS',
|
|
53
|
-
'UAH',
|
|
54
|
-
'VND',
|
|
55
|
-
'ZAR',
|
|
56
|
-
'ALL',
|
|
57
|
-
'BHD',
|
|
58
|
-
'DZD',
|
|
59
|
-
'GHS',
|
|
60
|
-
'IQD',
|
|
61
|
-
'ISK',
|
|
62
|
-
'JOD',
|
|
63
|
-
'KES',
|
|
64
|
-
'MAD',
|
|
65
|
-
'OMR',
|
|
66
|
-
'XOF'
|
|
67
|
-
]);
|
|
68
|
-
exports.event_type = {
|
|
69
|
-
label: 'Event Type',
|
|
70
|
-
description: 'The conversion event type. For custom events, you must use one of the predefined event types (i.e. CUSTOM_EVENT_1). Please refer to the possible event types in [Snapchat Marketing API docs](https://marketingapi.snapchat.com/docs/conversion.html#conversion-parameters).',
|
|
71
|
-
type: 'string'
|
|
72
|
-
};
|
|
73
|
-
exports.event_conversion_type = {
|
|
74
|
-
label: 'Event Conversion Type',
|
|
75
|
-
description: 'Where the event took place. This must be OFFLINE, WEB, or MOBILE_APP.',
|
|
76
|
-
type: 'string',
|
|
77
|
-
choices: [
|
|
78
|
-
{ label: 'Offline', value: 'OFFLINE' },
|
|
79
|
-
{ label: 'Web', value: 'WEB' },
|
|
80
|
-
{ label: 'Mobile App', value: 'MOBILE_APP' }
|
|
81
|
-
]
|
|
82
|
-
};
|
|
83
|
-
exports.event_tag = {
|
|
84
|
-
label: 'Event Tag',
|
|
85
|
-
description: 'Custom event label.',
|
|
86
|
-
type: 'string'
|
|
87
|
-
};
|
|
88
|
-
exports.timestamp = {
|
|
89
|
-
label: 'Event Timestamp',
|
|
90
|
-
description: 'The Epoch timestamp for when the conversion happened. The timestamp cannot be more than 28 days in the past.',
|
|
91
|
-
type: 'string',
|
|
92
|
-
default: {
|
|
93
|
-
'@path': '$.timestamp'
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
exports.email = {
|
|
97
|
-
label: 'Email',
|
|
98
|
-
description: 'Email address of the user who triggered the conversion event. Segment will normalize and hash this value before sending to Snapchat.',
|
|
99
|
-
type: 'string',
|
|
100
|
-
default: {
|
|
101
|
-
'@if': {
|
|
102
|
-
exists: { '@path': '$.properties.email' },
|
|
103
|
-
then: { '@path': '$.properties.email' },
|
|
104
|
-
else: { '@path': '$.traits.email' }
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
exports.mobile_ad_id = {
|
|
109
|
-
label: 'Mobile Ad Identifier',
|
|
110
|
-
description: 'Mobile ad identifier (IDFA or AAID) of the user who triggered the conversion event. Segment will normalize and hash this value before sending to Snapchat.',
|
|
111
|
-
type: 'string',
|
|
112
|
-
default: {
|
|
113
|
-
'@path': '$.context.device.advertisingId'
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
exports.uuid_c1 = {
|
|
117
|
-
label: 'uuid_c1 Cookie',
|
|
118
|
-
description: 'Unique user ID cookie. If you are using the Pixel SDK, you can access a cookie1 by looking at the _scid value.',
|
|
119
|
-
type: 'string'
|
|
120
|
-
};
|
|
121
|
-
exports.idfv = {
|
|
122
|
-
label: 'Identifier for Vendor',
|
|
123
|
-
description: 'IDFV of the user’s device. Segment will normalize and hash this value before sending to Snapchat.',
|
|
124
|
-
type: 'string',
|
|
125
|
-
default: {
|
|
126
|
-
'@path': '$.context.device.id'
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
exports.phone_number = {
|
|
130
|
-
label: 'Phone Number',
|
|
131
|
-
description: 'Phone number of the user who triggered the conversion event. Segment will normalize and hash this value before sending to Snapchat.',
|
|
132
|
-
type: 'string',
|
|
133
|
-
default: {
|
|
134
|
-
'@if': {
|
|
135
|
-
exists: { '@path': '$.properties.phone' },
|
|
136
|
-
then: { '@path': '$.properties.phone' },
|
|
137
|
-
else: { '@path': '$.traits.phone' }
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
exports.user_agent = {
|
|
142
|
-
label: 'User Agent',
|
|
143
|
-
description: 'User agent from the user’s device.',
|
|
144
|
-
type: 'string',
|
|
145
|
-
default: {
|
|
146
|
-
'@path': '$.context.userAgent'
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
exports.ip_address = {
|
|
150
|
-
label: 'IP Address',
|
|
151
|
-
description: 'IP address of the device or browser. Segment will normalize and hash this value before sending to Snapchat.',
|
|
152
|
-
type: 'string',
|
|
153
|
-
default: {
|
|
154
|
-
'@path': '$.context.ip'
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
exports.item_category = {
|
|
158
|
-
label: 'Item Category',
|
|
159
|
-
description: 'Category of the item.',
|
|
160
|
-
type: 'string',
|
|
161
|
-
default: {
|
|
162
|
-
'@path': '$.properties.category'
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
exports.item_ids = {
|
|
166
|
-
label: 'Item IDs',
|
|
167
|
-
description: 'International Article Number (EAN) when applicable, or other product or category identifier.',
|
|
168
|
-
type: 'string',
|
|
169
|
-
default: {
|
|
170
|
-
'@path': '$.properties.product_id'
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
exports.description = {
|
|
174
|
-
label: 'Description',
|
|
175
|
-
description: 'A string description for additional info.',
|
|
176
|
-
type: 'string'
|
|
177
|
-
};
|
|
178
|
-
exports.number_items = {
|
|
179
|
-
label: 'Number of Items',
|
|
180
|
-
description: 'Number of items.',
|
|
181
|
-
type: 'string',
|
|
182
|
-
default: {
|
|
183
|
-
'@path': '$.properties.quantity'
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
exports.price = {
|
|
187
|
-
label: 'Price',
|
|
188
|
-
description: 'Value of the purchase.This should be a single number.',
|
|
189
|
-
type: 'number',
|
|
190
|
-
default: {
|
|
191
|
-
'@if': {
|
|
192
|
-
exists: { '@path': '$.properties.price' },
|
|
193
|
-
then: { '@path': '$.properties.price' },
|
|
194
|
-
else: { '@path': '$.properties.value' }
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
exports.currency = {
|
|
199
|
-
label: 'Currency',
|
|
200
|
-
description: 'Currency for the value specified as ISO 4217 code.',
|
|
201
|
-
type: 'string',
|
|
202
|
-
default: {
|
|
203
|
-
'@path': '$.properties.currency'
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
exports.transaction_id = {
|
|
207
|
-
label: 'Transaction ID',
|
|
208
|
-
description: 'Transaction ID or order ID tied to the conversion event. Please refer to the [Snapchat Marketing API docs](https://marketingapi.snapchat.com/docs/conversion.html#deduplication) for information on how this field is used for deduplication against Snap Pixel SDK and App Adds Kit events.',
|
|
209
|
-
type: 'string',
|
|
210
|
-
default: {
|
|
211
|
-
'@path': '$.properties.order_id'
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
exports.level = {
|
|
215
|
-
label: 'Level',
|
|
216
|
-
description: 'Represents a level in the context of a game.',
|
|
217
|
-
type: 'string'
|
|
218
|
-
};
|
|
219
|
-
exports.client_dedup_id = {
|
|
220
|
-
label: 'Client Deduplication ID',
|
|
221
|
-
description: 'If you are reporting events via more than one method (Snap Pixel, App Ads Kit, Conversions API) you should use the same client_dedup_id across all methods. Please refer to the [Snapchat Marketing API docs](https://marketingapi.snapchat.com/docs/conversion.html#deduplication) for information on how this field is used for deduplication against Snap Pixel SDK and App Adds Kit events.',
|
|
222
|
-
type: 'string'
|
|
223
|
-
};
|
|
224
|
-
exports.search_string = {
|
|
225
|
-
label: 'Search String',
|
|
226
|
-
description: 'The text string that was searched for.',
|
|
227
|
-
type: 'string',
|
|
228
|
-
default: {
|
|
229
|
-
'@path': '$.properties.query'
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
exports.page_url = {
|
|
233
|
-
label: 'Page URL',
|
|
234
|
-
description: 'The URL of the web page where the event took place.',
|
|
235
|
-
type: 'string',
|
|
236
|
-
default: {
|
|
237
|
-
'@path': '$.context.page.url'
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
exports.sign_up_method = {
|
|
241
|
-
label: 'Sign Up Method',
|
|
242
|
-
description: 'A string indicating the sign up method.',
|
|
243
|
-
type: 'string'
|
|
244
|
-
};
|
|
245
|
-
const conversionType = (settings, event_conversion_type) => {
|
|
246
|
-
if (event_conversion_type === 'MOBILE_APP') {
|
|
247
|
-
if (settings?.snap_app_id === undefined ||
|
|
248
|
-
settings?.app_id === undefined ||
|
|
249
|
-
settings?.snap_app_id === '' ||
|
|
250
|
-
settings?.app_id === '') {
|
|
251
|
-
throw new actions_core_1.IntegrationError('If event conversion type is "MOBILE_APP" then snap_app_id and app_id must be defined', 'Misconfigured required field', 400);
|
|
252
|
-
}
|
|
253
|
-
delete settings?.pixel_id;
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
if (settings?.pixel_id === undefined) {
|
|
257
|
-
throw new actions_core_1.IntegrationError(`If event conversion type is "${event_conversion_type}" then pixel_id must be defined`, 'Misconfigured required field', 400);
|
|
258
|
-
}
|
|
259
|
-
delete settings?.snap_app_id;
|
|
260
|
-
delete settings?.app_id;
|
|
261
|
-
}
|
|
262
|
-
return settings;
|
|
263
|
-
};
|
|
264
|
-
exports.conversionType = conversionType;
|
|
265
|
-
const hash = (value) => {
|
|
266
|
-
if (value === undefined)
|
|
267
|
-
return;
|
|
268
|
-
const hash = crypto_1.createHash('sha256');
|
|
269
|
-
hash.update(value);
|
|
270
|
-
return hash.digest('hex');
|
|
271
|
-
};
|
|
272
|
-
exports.hash = hash;
|
|
273
|
-
const formatPayload = (payload) => {
|
|
274
|
-
if (payload.email) {
|
|
275
|
-
payload.email = payload.email.replace(/\s/g, '').toLowerCase();
|
|
276
|
-
}
|
|
277
|
-
if (payload.phone_number) {
|
|
278
|
-
payload.phone_number = payload.phone_number.replace(/\D|^0+/g, '');
|
|
279
|
-
}
|
|
280
|
-
if (payload.mobile_ad_id) {
|
|
281
|
-
payload.mobile_ad_id = payload.mobile_ad_id.toLowerCase();
|
|
282
|
-
}
|
|
283
|
-
return {
|
|
284
|
-
event_type: payload?.event_type,
|
|
285
|
-
event_conversion_type: payload?.event_conversion_type,
|
|
286
|
-
event_tag: payload?.event_tag,
|
|
287
|
-
timestamp: Date.parse(payload?.timestamp),
|
|
288
|
-
hashed_email: exports.hash(payload?.email),
|
|
289
|
-
mobile_ad_id: exports.hash(payload?.mobile_ad_id),
|
|
290
|
-
uuid_c1: payload?.uuid_c1,
|
|
291
|
-
hashed_idfv: exports.hash(payload?.idfv),
|
|
292
|
-
hashed_phone_number: exports.hash(payload?.phone_number),
|
|
293
|
-
user_agent: payload?.user_agent,
|
|
294
|
-
hashed_ip_address: exports.hash(payload?.ip_address),
|
|
295
|
-
item_category: payload?.item_category,
|
|
296
|
-
item_ids: payload?.item_ids,
|
|
297
|
-
description: payload?.description,
|
|
298
|
-
number_items: payload?.number_items,
|
|
299
|
-
price: payload?.price,
|
|
300
|
-
currency: payload?.currency,
|
|
301
|
-
transaction_id: payload?.transaction_id,
|
|
302
|
-
level: payload?.level,
|
|
303
|
-
client_dedup_id: payload?.client_dedup_id,
|
|
304
|
-
search_string: payload?.search_string,
|
|
305
|
-
page_url: payload?.page_url,
|
|
306
|
-
sign_up_method: payload?.sign_up_method
|
|
307
|
-
};
|
|
308
|
-
};
|
|
309
|
-
exports.formatPayload = formatPayload;
|
|
310
2
|
//# sourceMappingURL=snap-capi-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snap-capi-properties.js","sourceRoot":"","sources":["../../../src/destinations/snap-conversions-api/snap-capi-properties.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snap-capi-properties.js","sourceRoot":"","sources":["../../../src/destinations/snap-conversions-api/snap-capi-properties.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.74.4-alpha.
|
|
4
|
+
"version": "3.74.4-alpha.6",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"<rootDir>/test/setup-after-env.ts"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "9534fbd58adbe9fadc7388fa4b067a1cd2934597"
|
|
65
65
|
}
|