@segment/action-destinations 3.30.2 → 3.31.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/amplitude/groupIdentifyUser/index.js +2 -2
- package/dist/destinations/amplitude/groupIdentifyUser/index.js.map +1 -1
- package/dist/destinations/amplitude/identifyUser/index.js +13 -13
- package/dist/destinations/amplitude/identifyUser/index.js.map +1 -1
- package/dist/destinations/amplitude/mapUser/index.js +3 -3
- package/dist/destinations/amplitude/mapUser/index.js.map +1 -1
- package/dist/destinations/facebook-conversions-api/addToCart/generated-types.d.ts +37 -0
- package/dist/destinations/facebook-conversions-api/addToCart/generated-types.js +3 -0
- package/dist/destinations/facebook-conversions-api/addToCart/generated-types.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/addToCart/index.d.ts +5 -0
- package/dist/destinations/facebook-conversions-api/addToCart/index.js +89 -0
- package/dist/destinations/facebook-conversions-api/addToCart/index.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/constants.d.ts +4 -0
- package/dist/destinations/facebook-conversions-api/constants.js +485 -0
- package/dist/destinations/facebook-conversions-api/constants.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/custom/generated-types.d.ts +30 -0
- package/dist/destinations/facebook-conversions-api/custom/generated-types.js +3 -0
- package/dist/destinations/facebook-conversions-api/custom/generated-types.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/custom/index.d.ts +5 -0
- package/dist/destinations/facebook-conversions-api/custom/index.js +57 -0
- package/dist/destinations/facebook-conversions-api/custom/index.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/fb-capi-properties.d.ts +13 -0
- package/dist/destinations/facebook-conversions-api/fb-capi-properties.js +100 -0
- package/dist/destinations/facebook-conversions-api/fb-capi-properties.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.d.ts +7 -0
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js +227 -0
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/generated-types.d.ts +3 -0
- package/dist/destinations/facebook-conversions-api/generated-types.js +3 -0
- package/dist/destinations/facebook-conversions-api/generated-types.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/index.d.ts +4 -0
- package/dist/destinations/facebook-conversions-api/index.js +44 -0
- package/dist/destinations/facebook-conversions-api/index.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/initiateCheckout/generated-types.d.ts +37 -0
- package/dist/destinations/facebook-conversions-api/initiateCheckout/generated-types.js +3 -0
- package/dist/destinations/facebook-conversions-api/initiateCheckout/generated-types.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/initiateCheckout/index.d.ts +5 -0
- package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js +92 -0
- package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/pageView/generated-types.d.ts +26 -0
- package/dist/destinations/facebook-conversions-api/pageView/generated-types.js +3 -0
- package/dist/destinations/facebook-conversions-api/pageView/generated-types.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/pageView/index.d.ts +5 -0
- package/dist/destinations/facebook-conversions-api/pageView/index.js +43 -0
- package/dist/destinations/facebook-conversions-api/pageView/index.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/purchase/generated-types.d.ts +38 -0
- package/dist/destinations/facebook-conversions-api/purchase/generated-types.js +3 -0
- package/dist/destinations/facebook-conversions-api/purchase/generated-types.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/purchase/index.d.ts +5 -0
- package/dist/destinations/facebook-conversions-api/purchase/index.js +95 -0
- package/dist/destinations/facebook-conversions-api/purchase/index.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/search/generated-types.d.ts +37 -0
- package/dist/destinations/facebook-conversions-api/search/generated-types.js +3 -0
- package/dist/destinations/facebook-conversions-api/search/generated-types.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/search/index.d.ts +5 -0
- package/dist/destinations/facebook-conversions-api/search/index.js +96 -0
- package/dist/destinations/facebook-conversions-api/search/index.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/viewContent/generated-types.d.ts +38 -0
- package/dist/destinations/facebook-conversions-api/viewContent/generated-types.js +3 -0
- package/dist/destinations/facebook-conversions-api/viewContent/generated-types.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/viewContent/index.d.ts +5 -0
- package/dist/destinations/facebook-conversions-api/viewContent/index.js +90 -0
- package/dist/destinations/facebook-conversions-api/viewContent/index.js.map +1 -0
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/slack/postToChannel/index.js +5 -5
- package/dist/destinations/slack/postToChannel/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const fb_capi_properties_1 = require("../fb-capi-properties");
|
|
5
|
+
const fb_capi_user_data_1 = require("../fb-capi-user-data");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Page View',
|
|
9
|
+
description: 'Send a page view event when a user lands on a page',
|
|
10
|
+
defaultSubscription: 'type = "page"',
|
|
11
|
+
fields: {
|
|
12
|
+
action_source: { ...fb_capi_properties_1.action_source, required: true },
|
|
13
|
+
event_time: { ...fb_capi_properties_1.event_time, required: true },
|
|
14
|
+
user_data: fb_capi_user_data_1.user_data_field,
|
|
15
|
+
event_id: fb_capi_properties_1.event_id,
|
|
16
|
+
event_source_url: fb_capi_properties_1.event_source_url
|
|
17
|
+
},
|
|
18
|
+
perform: (request, { payload, settings }) => {
|
|
19
|
+
if (!payload.user_data) {
|
|
20
|
+
throw new actions_core_1.IntegrationError('Must include at least one user data property', 'Misconfigured required field', 400);
|
|
21
|
+
}
|
|
22
|
+
if (payload.action_source === 'website' && payload.user_data.client_user_agent === undefined) {
|
|
23
|
+
throw new actions_core_1.IntegrationError('If action source is "Website" then client_user_agent must be defined', 'Misconfigured required field', 400);
|
|
24
|
+
}
|
|
25
|
+
return request(`https://graph.facebook.com/v${constants_1.API_VERSION}/${settings.pixelId}/events`, {
|
|
26
|
+
method: 'POST',
|
|
27
|
+
json: {
|
|
28
|
+
data: [
|
|
29
|
+
{
|
|
30
|
+
event_name: 'PageView',
|
|
31
|
+
event_time: payload.event_time,
|
|
32
|
+
action_source: payload.action_source,
|
|
33
|
+
event_source_url: payload.event_source_url,
|
|
34
|
+
event_id: payload.event_id,
|
|
35
|
+
user_data: fb_capi_user_data_1.hash_user_data({ user_data: payload.user_data })
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.default = action;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/pageView/index.ts"],"names":[],"mappings":";;AAAA,wDAA2E;AAC3E,8DAA6F;AAC7F,4DAAsE;AAGtE,4CAA0C;AAC1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,oDAAoD;IACjE,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,aAAa,EAAE,EAAE,GAAG,kCAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnD,UAAU,EAAE,EAAE,GAAG,+BAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7C,SAAS,EAAE,mCAAe;QAC1B,QAAQ,EAAE,6BAAQ;QAClB,gBAAgB,EAAE,qCAAgB;KACnC;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YACtB,MAAM,IAAI,+BAAgB,CAAC,8CAA8C,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;SAChH;QAED,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,iBAAiB,KAAK,SAAS,EAAE;YAC5F,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,8BAA8B,EAC9B,GAAG,CACJ,CAAA;SACF;QACD,OAAO,OAAO,CAAC,+BAA+B,uBAAW,IAAI,QAAQ,CAAC,OAAO,SAAS,EAAE;YACtF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ;wBACE,UAAU,EAAE,UAAU;wBACtB,UAAU,EAAE,OAAO,CAAC,UAAU;wBAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;wBACpC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;wBAC1C,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,SAAS,EAAE,kCAAc,CAAC,EAAC,SAAS,EAAE,OAAO,CAAC,SAAS,EAAC,CAAC;qBAC1D;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
action_source: string;
|
|
3
|
+
currency: string;
|
|
4
|
+
event_time: string;
|
|
5
|
+
user_data: {
|
|
6
|
+
externalId?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
phone?: string;
|
|
9
|
+
gender?: string;
|
|
10
|
+
dateOfBirth?: string;
|
|
11
|
+
lastName?: string;
|
|
12
|
+
firstName?: string;
|
|
13
|
+
city?: string;
|
|
14
|
+
state?: string;
|
|
15
|
+
zip?: string;
|
|
16
|
+
country?: string;
|
|
17
|
+
client_ip_address?: string;
|
|
18
|
+
client_user_agent?: string;
|
|
19
|
+
fbc?: string;
|
|
20
|
+
fbp?: string;
|
|
21
|
+
subscriptionID?: string;
|
|
22
|
+
leadID?: number;
|
|
23
|
+
fbLoginID?: number;
|
|
24
|
+
};
|
|
25
|
+
value: number;
|
|
26
|
+
content_ids?: string[];
|
|
27
|
+
content_name?: string;
|
|
28
|
+
content_type?: string;
|
|
29
|
+
contents?: {
|
|
30
|
+
id?: string;
|
|
31
|
+
quantity?: number;
|
|
32
|
+
item_price?: number;
|
|
33
|
+
delivery_category?: string;
|
|
34
|
+
}[];
|
|
35
|
+
event_id?: string;
|
|
36
|
+
event_source_url?: string;
|
|
37
|
+
num_items?: number;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/purchase/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const fb_capi_properties_1 = require("../fb-capi-properties");
|
|
6
|
+
const fb_capi_user_data_1 = require("../fb-capi-user-data");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Purchase',
|
|
9
|
+
description: 'Send event when a user completes a purchase',
|
|
10
|
+
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
11
|
+
fields: {
|
|
12
|
+
action_source: { ...fb_capi_properties_1.action_source, required: true },
|
|
13
|
+
currency: { ...fb_capi_properties_1.currency, required: true },
|
|
14
|
+
event_time: { ...fb_capi_properties_1.event_time, required: true },
|
|
15
|
+
user_data: fb_capi_user_data_1.user_data_field,
|
|
16
|
+
value: {
|
|
17
|
+
...fb_capi_properties_1.value,
|
|
18
|
+
required: true,
|
|
19
|
+
default: { '@path': '$.properties.revenue' }
|
|
20
|
+
},
|
|
21
|
+
content_ids: fb_capi_properties_1.content_ids,
|
|
22
|
+
content_name: fb_capi_properties_1.content_name,
|
|
23
|
+
content_type: fb_capi_properties_1.content_type,
|
|
24
|
+
contents: {
|
|
25
|
+
...fb_capi_properties_1.contents,
|
|
26
|
+
default: {
|
|
27
|
+
'@arrayPath': [
|
|
28
|
+
'$.properties.products',
|
|
29
|
+
{
|
|
30
|
+
id: {
|
|
31
|
+
'@path': '$.product_id'
|
|
32
|
+
},
|
|
33
|
+
quantity: {
|
|
34
|
+
'@path': '$.quantity'
|
|
35
|
+
},
|
|
36
|
+
item_price: {
|
|
37
|
+
'@path': '$.price'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
event_id: fb_capi_properties_1.event_id,
|
|
44
|
+
event_source_url: fb_capi_properties_1.event_source_url,
|
|
45
|
+
num_items: fb_capi_properties_1.num_items
|
|
46
|
+
},
|
|
47
|
+
perform: (request, { payload, settings }) => {
|
|
48
|
+
if (!constants_1.CURRENCY_ISO_CODES.has(payload.currency)) {
|
|
49
|
+
throw new actions_core_1.IntegrationError(`${payload.currency} is not a valid currency code.`, 'Misconfigured required field', 400);
|
|
50
|
+
}
|
|
51
|
+
if (!payload.user_data) {
|
|
52
|
+
throw new actions_core_1.IntegrationError('Must include at least one user data property', 'Misconfigured required field', 400);
|
|
53
|
+
}
|
|
54
|
+
if (payload.action_source === 'website' && payload.user_data.client_user_agent === undefined) {
|
|
55
|
+
throw new actions_core_1.IntegrationError('If action source is "Website" then client_user_agent must be defined', 'Misconfigured required field', 400);
|
|
56
|
+
}
|
|
57
|
+
const valid_delivery_categories = ['in_store', 'curbside', 'home_delivery'];
|
|
58
|
+
if (payload.contents) {
|
|
59
|
+
payload.contents.forEach((obj, index) => {
|
|
60
|
+
if (!obj.id) {
|
|
61
|
+
throw new actions_core_1.IntegrationError("Contents objects must include an 'id' parameter.", 'Misconfigured required field', 400);
|
|
62
|
+
}
|
|
63
|
+
if (obj.delivery_category && !valid_delivery_categories.includes(obj.delivery_category)) {
|
|
64
|
+
throw new actions_core_1.IntegrationError(`contents[${index}].delivery_category must be one of {in_store, home_delivery, curbside}.`, 'Misconfigured field', 400);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return request(`https://graph.facebook.com/v${constants_1.API_VERSION}/${settings.pixelId}/events`, {
|
|
69
|
+
method: 'POST',
|
|
70
|
+
json: {
|
|
71
|
+
data: [
|
|
72
|
+
{
|
|
73
|
+
event_name: 'Purchase',
|
|
74
|
+
event_time: payload.event_time,
|
|
75
|
+
action_source: payload.action_source,
|
|
76
|
+
event_source_url: payload.event_source_url,
|
|
77
|
+
event_id: payload.event_id,
|
|
78
|
+
user_data: fb_capi_user_data_1.hash_user_data({ user_data: payload.user_data }),
|
|
79
|
+
custom_data: {
|
|
80
|
+
currency: payload.currency,
|
|
81
|
+
value: payload.value,
|
|
82
|
+
content_ids: payload.content_ids,
|
|
83
|
+
content_name: payload.content_name,
|
|
84
|
+
content_type: payload.content_type,
|
|
85
|
+
contents: payload.contents,
|
|
86
|
+
num_items: payload.num_items
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.default = action;
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/purchase/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,4CAA8D;AAC9D,8DAY8B;AAC9B,4DAAsE;AAEtE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,6CAA6C;IAC1D,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,aAAa,EAAE,EAAE,GAAG,kCAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnD,QAAQ,EAAE,EAAE,GAAG,6BAAQ,EAAE,QAAQ,EAAE,IAA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O,CAAC,SAAS;yBAC7B;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
action_source: string;
|
|
3
|
+
event_time: string;
|
|
4
|
+
user_data: {
|
|
5
|
+
externalId?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
phone?: string;
|
|
8
|
+
gender?: string;
|
|
9
|
+
dateOfBirth?: string;
|
|
10
|
+
lastName?: string;
|
|
11
|
+
firstName?: string;
|
|
12
|
+
city?: string;
|
|
13
|
+
state?: string;
|
|
14
|
+
zip?: string;
|
|
15
|
+
country?: string;
|
|
16
|
+
client_ip_address?: string;
|
|
17
|
+
client_user_agent?: string;
|
|
18
|
+
fbc?: string;
|
|
19
|
+
fbp?: string;
|
|
20
|
+
subscriptionID?: string;
|
|
21
|
+
leadID?: number;
|
|
22
|
+
fbLoginID?: number;
|
|
23
|
+
};
|
|
24
|
+
content_category?: string;
|
|
25
|
+
content_ids?: string[];
|
|
26
|
+
contents?: {
|
|
27
|
+
id?: string;
|
|
28
|
+
quantity?: number;
|
|
29
|
+
item_price?: number;
|
|
30
|
+
delivery_category?: string;
|
|
31
|
+
}[];
|
|
32
|
+
currency?: string;
|
|
33
|
+
event_id?: string;
|
|
34
|
+
event_source_url?: string;
|
|
35
|
+
search_string?: string;
|
|
36
|
+
value?: number;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/search/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const fb_capi_properties_1 = require("../fb-capi-properties");
|
|
6
|
+
const fb_capi_user_data_1 = require("../fb-capi-user-data");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Search',
|
|
9
|
+
description: 'Send event when a user searches content or products',
|
|
10
|
+
defaultSubscription: 'type = "track" and event = "Products Searched"',
|
|
11
|
+
fields: {
|
|
12
|
+
action_source: { ...fb_capi_properties_1.action_source, required: true },
|
|
13
|
+
event_time: { ...fb_capi_properties_1.event_time, required: true },
|
|
14
|
+
user_data: fb_capi_user_data_1.user_data_field,
|
|
15
|
+
content_category: fb_capi_properties_1.content_category,
|
|
16
|
+
content_ids: fb_capi_properties_1.content_ids,
|
|
17
|
+
contents: {
|
|
18
|
+
...fb_capi_properties_1.contents,
|
|
19
|
+
default: {
|
|
20
|
+
'@arrayPath': [
|
|
21
|
+
'$.properties',
|
|
22
|
+
{
|
|
23
|
+
id: {
|
|
24
|
+
'@path': '$.product_id'
|
|
25
|
+
},
|
|
26
|
+
quantity: {
|
|
27
|
+
'@path': '$.quantity'
|
|
28
|
+
},
|
|
29
|
+
item_price: {
|
|
30
|
+
'@path': '$.price'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
currency: fb_capi_properties_1.currency,
|
|
37
|
+
event_id: fb_capi_properties_1.event_id,
|
|
38
|
+
event_source_url: fb_capi_properties_1.event_source_url,
|
|
39
|
+
search_string: {
|
|
40
|
+
label: 'Search String',
|
|
41
|
+
description: 'A search query made by a user. This must be a string.',
|
|
42
|
+
type: 'string',
|
|
43
|
+
default: {
|
|
44
|
+
'@path': '$.properties.query'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
value: fb_capi_properties_1.value
|
|
48
|
+
},
|
|
49
|
+
perform: (request, { payload, settings }) => {
|
|
50
|
+
if (payload.currency && !constants_1.CURRENCY_ISO_CODES.has(payload.currency)) {
|
|
51
|
+
throw new actions_core_1.IntegrationError(`${payload.currency} is not a valid currency code.`, 'Misconfigured required field', 400);
|
|
52
|
+
}
|
|
53
|
+
if (!payload.user_data) {
|
|
54
|
+
throw new actions_core_1.IntegrationError('Must include at least one user data property', 'Misconfigured required field', 400);
|
|
55
|
+
}
|
|
56
|
+
if (payload.action_source === 'website' && payload.user_data.client_user_agent === undefined) {
|
|
57
|
+
throw new actions_core_1.IntegrationError('If action source is "Website" then client_user_agent must be defined', 'Misconfigured required field', 400);
|
|
58
|
+
}
|
|
59
|
+
const valid_delivery_categories = ['in_store', 'curbside', 'home_delivery'];
|
|
60
|
+
if (payload.contents) {
|
|
61
|
+
payload.contents.forEach((obj, index) => {
|
|
62
|
+
if (!obj.id) {
|
|
63
|
+
throw new actions_core_1.IntegrationError("Contents objects must include an 'id' parameter.", 'Misconfigured required field', 400);
|
|
64
|
+
}
|
|
65
|
+
if (obj.delivery_category && !valid_delivery_categories.includes(obj.delivery_category)) {
|
|
66
|
+
throw new actions_core_1.IntegrationError(`contents[${index}].delivery_category must be one of {in_store, home_delivery, curbside}.`, 'Misconfigured field', 400);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return request(`https://graph.facebook.com/v${constants_1.API_VERSION}/${settings.pixelId}/events`, {
|
|
71
|
+
method: 'POST',
|
|
72
|
+
json: {
|
|
73
|
+
data: [
|
|
74
|
+
{
|
|
75
|
+
event_name: 'Search',
|
|
76
|
+
event_time: payload.event_time,
|
|
77
|
+
action_source: payload.action_source,
|
|
78
|
+
event_id: payload.event_id,
|
|
79
|
+
event_source_url: payload.event_source_url,
|
|
80
|
+
user_data: fb_capi_user_data_1.hash_user_data({ user_data: payload.user_data }),
|
|
81
|
+
custom_data: {
|
|
82
|
+
currency: payload.currency,
|
|
83
|
+
content_ids: payload.content_ids,
|
|
84
|
+
contents: payload.contents,
|
|
85
|
+
content_category: payload.content_category,
|
|
86
|
+
value: payload.value,
|
|
87
|
+
search_string: payload.search_string
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.default = action;
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/search/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,4CAA8D;AAC9D,8DAU8B;AAC9B,4DAAsE;AAEtE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,qDAAqD;IAClE,mBAAmB,EAAE,gDAAgD;IACrE,MAAM,EAAE;QACN,aAAa,EAAE,EAAE,GAAG,kCAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnD,UAAU,EAAE,EAAE,GAAG,+BAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7C,SAAS,EAAE,mCAAe;QAC1B,gBAAgB,EAAE,qCAAgB;QAClC,WAAW,EAAE,gCAAW;QACxB,QAAQ,EAAE;YACR,GAAG,6BAAQ;YACX,OAAO,EAAE;gBAEP,YAAY,EAAE;oBACZ,cAAc;oBACd;wBACE,EAAE,EAAE;4BACF,OAAO,EAAE,cAAc;yBACxB;wBACD,QAAQ,EAAE;4BACR,OAAO,EAAE,YAAY;yBACtB;wBACD,UAAU,EAAE;4BACV,OAAO,EAAE,SAAS;yBACnB;qBACF;iBACF;aACF;SACF;QACD,QAAQ,EAAE,6BAAQ;QAClB,QAAQ,EAAE,6BAAQ;QAClB,gBAAgB,EAAE,qCAAgB;QAClC,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,uDAAuD;YACpE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;QACD,KAAK,EAAE,0BAAK;KACb;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAA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;wBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;wBAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;wBACpC,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;wBAC1C,SAAS,EAAE,kCAAc,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;wBAC3D,WAAW,EAAE;4BACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;4BAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;4BAC1C,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,aAAa,EAAE,OAAO,CAAC,aAAa;yBACrC;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
action_source: string;
|
|
3
|
+
event_time: string;
|
|
4
|
+
user_data: {
|
|
5
|
+
externalId?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
phone?: string;
|
|
8
|
+
gender?: string;
|
|
9
|
+
dateOfBirth?: string;
|
|
10
|
+
lastName?: string;
|
|
11
|
+
firstName?: string;
|
|
12
|
+
city?: string;
|
|
13
|
+
state?: string;
|
|
14
|
+
zip?: string;
|
|
15
|
+
country?: string;
|
|
16
|
+
client_ip_address?: string;
|
|
17
|
+
client_user_agent?: string;
|
|
18
|
+
fbc?: string;
|
|
19
|
+
fbp?: string;
|
|
20
|
+
subscriptionID?: string;
|
|
21
|
+
leadID?: number;
|
|
22
|
+
fbLoginID?: number;
|
|
23
|
+
};
|
|
24
|
+
content_category?: string;
|
|
25
|
+
content_ids?: string[];
|
|
26
|
+
content_name?: string;
|
|
27
|
+
content_type?: string;
|
|
28
|
+
contents?: {
|
|
29
|
+
id?: string;
|
|
30
|
+
quantity?: number;
|
|
31
|
+
item_price?: number;
|
|
32
|
+
delivery_category?: string;
|
|
33
|
+
}[];
|
|
34
|
+
currency?: string;
|
|
35
|
+
event_id?: string;
|
|
36
|
+
event_source_url?: string;
|
|
37
|
+
value?: number;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/viewContent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const fb_capi_properties_1 = require("../fb-capi-properties");
|
|
5
|
+
const fb_capi_user_data_1 = require("../fb-capi-user-data");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'View Content',
|
|
9
|
+
description: 'Send event when a user views content or a product',
|
|
10
|
+
defaultSubscription: 'type = "track" and event = "Product Viewed"',
|
|
11
|
+
fields: {
|
|
12
|
+
action_source: { ...fb_capi_properties_1.action_source, required: true },
|
|
13
|
+
event_time: { ...fb_capi_properties_1.event_time, required: true },
|
|
14
|
+
user_data: fb_capi_user_data_1.user_data_field,
|
|
15
|
+
content_category: fb_capi_properties_1.content_category,
|
|
16
|
+
content_ids: { ...fb_capi_properties_1.content_ids, default: { '@path': '$.properties.product_id' } },
|
|
17
|
+
content_name: fb_capi_properties_1.content_name,
|
|
18
|
+
content_type: fb_capi_properties_1.content_type,
|
|
19
|
+
contents: {
|
|
20
|
+
...fb_capi_properties_1.contents,
|
|
21
|
+
default: {
|
|
22
|
+
'@arrayPath': [
|
|
23
|
+
'$.properties',
|
|
24
|
+
{
|
|
25
|
+
id: {
|
|
26
|
+
'@path': '$.product_id'
|
|
27
|
+
},
|
|
28
|
+
quantity: {
|
|
29
|
+
'@path': '$.quantity'
|
|
30
|
+
},
|
|
31
|
+
item_price: {
|
|
32
|
+
'@path': '$.price'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
currency: fb_capi_properties_1.currency,
|
|
39
|
+
event_id: fb_capi_properties_1.event_id,
|
|
40
|
+
event_source_url: fb_capi_properties_1.event_source_url,
|
|
41
|
+
value: { ...fb_capi_properties_1.value, default: { '@path': '$.properties.price' } }
|
|
42
|
+
},
|
|
43
|
+
perform: (request, { payload, settings }) => {
|
|
44
|
+
if (payload.currency && !constants_1.CURRENCY_ISO_CODES.has(payload.currency)) {
|
|
45
|
+
throw new actions_core_1.IntegrationError(`${payload.currency} is not a valid currency code.`, 'Misconfigured required field', 400);
|
|
46
|
+
}
|
|
47
|
+
if (!payload.user_data) {
|
|
48
|
+
throw new actions_core_1.IntegrationError('Must include at least one user data property', 'Misconfigured required field', 400);
|
|
49
|
+
}
|
|
50
|
+
if (payload.action_source === 'website' && payload.user_data.client_user_agent === undefined) {
|
|
51
|
+
throw new actions_core_1.IntegrationError('If action source is "Website" then client_user_agent must be defined', 'Misconfigured required field', 400);
|
|
52
|
+
}
|
|
53
|
+
const valid_delivery_categories = ['in_store', 'curbside', 'home_delivery'];
|
|
54
|
+
if (payload.contents) {
|
|
55
|
+
payload.contents.forEach((obj, index) => {
|
|
56
|
+
if (!obj.id) {
|
|
57
|
+
throw new actions_core_1.IntegrationError("Contents objects must include an 'id' parameter.", 'Misconfigured required field', 400);
|
|
58
|
+
}
|
|
59
|
+
if (obj.delivery_category && !valid_delivery_categories.includes(obj.delivery_category)) {
|
|
60
|
+
throw new actions_core_1.IntegrationError(`contents[${index}].delivery_category must be one of {in_store, home_delivery, curbside}.`, 'Misconfigured field', 400);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return request(`https://graph.facebook.com/v${constants_1.API_VERSION}/${settings.pixelId}/events`, {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
json: {
|
|
67
|
+
data: [
|
|
68
|
+
{
|
|
69
|
+
event_name: 'ViewContent',
|
|
70
|
+
event_time: payload.event_time,
|
|
71
|
+
action_source: payload.action_source,
|
|
72
|
+
event_id: payload.event_id,
|
|
73
|
+
event_source_url: payload.event_source_url,
|
|
74
|
+
user_data: fb_capi_user_data_1.hash_user_data({ user_data: payload.user_data }),
|
|
75
|
+
custom_data: {
|
|
76
|
+
currency: payload.currency,
|
|
77
|
+
value: payload.value,
|
|
78
|
+
content_ids: payload.content_ids,
|
|
79
|
+
content_name: payload.content_name,
|
|
80
|
+
content_type: payload.content_type,
|
|
81
|
+
contents: payload.contents
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.default = action;
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/viewContent/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,8DAY8B;AAC9B,4DAAsE;AAGtE,4CAA8D;AAE9D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,mDAAmD;IAChE,mBAAmB,EAAE,6CAA6C;IAClE,MAAM,EAAE;QACN,aAAa,EAAE,EAAE,GAAG,kCAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnD,UAAU,EAAE,EAAE,GAAG,+BAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7C,SAAS,EAAE,mCAAe;QAC1B,gBAAgB,EAAE,qCAAgB;QAClC,WAAW,EAAE,EAAE,GAAG,gCAAW,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE,EAAE;QAChF,YAAY,EAAE,iCAAY;QAC1B,YAAY,EAAE,iCAAY;QAC1B,QAAQ,EAAE;YAC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CAAC,GAAG,CAAC,EAAE,EAAE;oBACX,MAAM,IAAI,+BAAgB,CACxB,kDAAkD,EAClD,8BAA8B,EAC9B,GAAG,CACJ,CAAA;iBACF;gBAED,IAAI,GAAG,CAAC,iBAAiB,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;oBACvF,MAAM,IAAI,+BAAgB,CACxB,YAAY,KAAK,yEAAyE,EAC1F,qBAAqB,EACrB,GAAG,CACJ,CAAA;iBACF;YACH,CAAC,CAAC,CAAA;SACH;QAED,OAAO,OAAO,CAAC,+BAA+B,uBAAW,IAAI,QAAQ,CAAC,OAAO,SAAS,EAAE;YACtF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ;wBACE,UAAU,EAAE,aAAa;wBACzB,UAAU,EAAE,OAAO,CAAC,UAAU;wBAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;wBACpC,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;wBAC1C,SAAS,EAAE,kCAAc,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;wBAC3D,WAAW,EAAE;4BACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,WAAW,EAAE,OAAO,CAAC,WAAW;4BAChC,YAAY,EAAE,OAAO,CAAC,YAAY;4BAClC,YAAY,EAAE,OAAO,CAAC,YAAY;4BAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ;yBAC3B;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -28,6 +28,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
28
28
|
exports.destinations = {};
|
|
29
29
|
exports.manifest = {};
|
|
30
30
|
register('60f64ae3eaebd66d17d28e9f', './1plusx');
|
|
31
|
+
register('61806e472cd47ea1104885fc', './facebook-conversions-api');
|
|
31
32
|
register('5f7dd6d21ad74f3842b1fc47', './amplitude');
|
|
32
33
|
register('60f9d0d048950c356be2e4da', './braze');
|
|
33
34
|
register('5f7dd78fe27ce7ff2b8bfa37', './customerio');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/destinations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAAmD;AACnD,gDAAuB;AAWV,QAAA,YAAY,GAA0C,EAAE,CAAA;AACxD,QAAA,QAAQ,GAAsC,EAAE,CAAA;AAU7D,QAAQ,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAA;AAChD,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,cAAc,CAAC,CAAA;AACpD,QAAQ,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAA;AAC5D,QAAQ,CAAC,0BAA0B,EAAE,+BAA+B,CAAC,CAAA;AACrE,QAAQ,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAA;AAClD,QAAQ,CAAC,0BAA0B,EAAE,+BAA+B,CAAC,CAAA;AACrE,QAAQ,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,CAAA;AACnE,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAA;AAC5D,QAAQ,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAA;AAChD,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAAC,CAAA;AAEjD,SAAS,QAAQ,CAAC,EAAc,EAAE,eAAuB;IAEvD,MAAM,UAAU,GAAG,O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,gDAQC;AAEM,KAAK,UAAU,uBAAuB,CAAC,WAAmB;IAC/D,OAAO,kBAAkB,CAAC,WAAW,CAAC,IAAI,uBAAuB,CAAC,WAAW,CAAC,CAAA;AAChF,CAAC;AAFD,0DAEC"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const action = {
|
|
4
4
|
title: 'Post Message',
|
|
5
|
-
description: 'Post a message to
|
|
5
|
+
description: 'Post a message to the specified Slack workspace and channel when the associated trigger criteria are met.',
|
|
6
6
|
fields: {
|
|
7
7
|
url: {
|
|
8
8
|
label: 'Webhook URL',
|
|
9
|
-
description: '
|
|
9
|
+
description: 'The webhook provided by Slack to connect with the desired Slack workspace.',
|
|
10
10
|
type: 'string',
|
|
11
11
|
required: true,
|
|
12
12
|
format: 'uri'
|
|
@@ -19,18 +19,18 @@ const action = {
|
|
|
19
19
|
},
|
|
20
20
|
channel: {
|
|
21
21
|
label: 'Channel',
|
|
22
|
-
description: '
|
|
22
|
+
description: 'The channel within the Slack workspace. Do not include the `#` character. For example, use `general`, not `#general`.',
|
|
23
23
|
type: 'string'
|
|
24
24
|
},
|
|
25
25
|
username: {
|
|
26
26
|
label: 'User',
|
|
27
|
-
description: '
|
|
27
|
+
description: 'The sender of the posted message.',
|
|
28
28
|
type: 'string',
|
|
29
29
|
default: 'Segment'
|
|
30
30
|
},
|
|
31
31
|
icon_url: {
|
|
32
32
|
label: 'Icon URL',
|
|
33
|
-
description: 'URL
|
|
33
|
+
description: 'The URL of the image that appears next to the User.',
|
|
34
34
|
type: 'string',
|
|
35
35
|
default: 'https://logo.clearbit.com/segment.com'
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/slack/postToChannel/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/slack/postToChannel/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,2GAA2G;IAC7G,MAAM,EAAE;QACN,GAAG,EAAE;YACH,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,4EAA4E;YACzF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,KAAK;SACd;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,kIAAkI;YACpI,IAAI,EAAE,MAAM;SACb;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EACT,uHAAuH;YACzH,IAAI,EAAE,QAAQ;SACf;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,SAAS;SACnB;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,qDAAqD;YAClE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,uCAAuC;SACjD;KACF;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE;YAC1B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;aAC3B;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
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.
|
|
4
|
+
"version": "3.31.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -57,5 +57,6 @@
|
|
|
57
57
|
"setupFilesAfterEnv": [
|
|
58
58
|
"<rootDir>/test/setup-after-env.ts"
|
|
59
59
|
]
|
|
60
|
-
}
|
|
60
|
+
},
|
|
61
|
+
"gitHead": "427977fc64a82166ad32310fc5eb96c90e6c7798"
|
|
61
62
|
}
|