@segment/action-destinations 3.39.1 → 3.41.1-alpha.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/customerio/createUpdateDevice/index.js +1 -5
- package/dist/destinations/customerio/createUpdateDevice/index.js.map +1 -1
- package/dist/destinations/customerio/createUpdatePerson/index.js +1 -5
- package/dist/destinations/customerio/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/customerio/trackEvent/index.js +1 -5
- package/dist/destinations/customerio/trackEvent/index.js.map +1 -1
- package/dist/destinations/customerio/trackPageView/index.js +1 -5
- package/dist/destinations/customerio/trackPageView/index.js.map +1 -1
- package/dist/destinations/customerio/trackScreenView/index.js +1 -5
- package/dist/destinations/customerio/trackScreenView/index.js.map +1 -1
- package/dist/destinations/customerio/utils.d.ts +1 -0
- package/dist/destinations/customerio/utils.js +12 -1
- package/dist/destinations/customerio/utils.js.map +1 -1
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js +5 -5
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js.map +1 -1
- package/dist/destinations/friendbuy/cloudUtil.d.ts +6 -0
- package/dist/destinations/friendbuy/cloudUtil.js +39 -0
- package/dist/destinations/friendbuy/cloudUtil.js.map +1 -0
- package/dist/destinations/friendbuy/generated-types.d.ts +4 -0
- package/dist/destinations/friendbuy/generated-types.js +3 -0
- package/dist/destinations/friendbuy/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/index.d.ts +4 -0
- package/dist/destinations/friendbuy/index.js +57 -0
- package/dist/destinations/friendbuy/index.js.map +1 -0
- package/dist/destinations/friendbuy/trackCustomEvent/generated-types.d.ts +13 -0
- package/dist/destinations/friendbuy/trackCustomEvent/generated-types.js +3 -0
- package/dist/destinations/friendbuy/trackCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/trackCustomEvent/index.d.ts +5 -0
- package/dist/destinations/friendbuy/trackCustomEvent/index.js +36 -0
- package/dist/destinations/friendbuy/trackCustomEvent/index.js.map +1 -0
- package/dist/destinations/friendbuy/trackCustomer/generated-types.d.ts +25 -0
- package/dist/destinations/friendbuy/trackCustomer/generated-types.js +3 -0
- package/dist/destinations/friendbuy/trackCustomer/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/trackCustomer/index.d.ts +5 -0
- package/dist/destinations/friendbuy/trackCustomer/index.js +44 -0
- package/dist/destinations/friendbuy/trackCustomer/index.js.map +1 -0
- package/dist/destinations/friendbuy/trackPurchase/generated-types.d.ts +34 -0
- package/dist/destinations/friendbuy/trackPurchase/generated-types.js +3 -0
- package/dist/destinations/friendbuy/trackPurchase/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/trackPurchase/index.d.ts +5 -0
- package/dist/destinations/friendbuy/trackPurchase/index.js +56 -0
- package/dist/destinations/friendbuy/trackPurchase/index.js.map +1 -0
- package/dist/destinations/friendbuy/trackSignUp/generated-types.d.ts +19 -0
- package/dist/destinations/friendbuy/trackSignUp/generated-types.js +3 -0
- package/dist/destinations/friendbuy/trackSignUp/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/trackSignUp/index.d.ts +5 -0
- package/dist/destinations/friendbuy/trackSignUp/index.js +39 -0
- package/dist/destinations/friendbuy/trackSignUp/index.js.map +1 -0
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +5 -6
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
- package/dist/destinations/voyage/generated-types.d.ts +3 -0
- package/dist/destinations/voyage/generated-types.js +3 -0
- package/dist/destinations/voyage/generated-types.js.map +1 -0
- package/dist/destinations/voyage/index.d.ts +4 -0
- package/dist/destinations/voyage/index.js +43 -0
- package/dist/destinations/voyage/index.js.map +1 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.d.ts +19 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.js +3 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.js.map +1 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.d.ts +5 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.js +167 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.js.map +1 -0
- package/dist/destinations/voyage/utils.d.ts +31 -0
- package/dist/destinations/voyage/utils.js +8 -0
- package/dist/destinations/voyage/utils.js.map +1 -0
- package/dist/destinations/webhook/__test__/webhook.test.js +3 -29
- package/dist/destinations/webhook/__test__/webhook.test.js.map +1 -1
- package/dist/destinations/webhook/send/index.js +0 -11
- package/dist/destinations/webhook/send/index.js.map +1 -1
- package/dist/lib/test-data.js +13 -0
- package/dist/lib/test-data.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cloudUtil_1 = require("../cloudUtil");
|
|
4
|
+
const actions_shared_1 = require("@segment/actions-shared");
|
|
5
|
+
const actions_shared_2 = require("@segment/actions-shared");
|
|
6
|
+
const actions_shared_3 = require("@segment/actions-shared");
|
|
7
|
+
const actions_shared_4 = require("@segment/actions-shared");
|
|
8
|
+
const trackPurchaseMapi = {
|
|
9
|
+
fields: {
|
|
10
|
+
orderId: actions_shared_3.COPY,
|
|
11
|
+
amount: actions_shared_3.COPY,
|
|
12
|
+
currency: actions_shared_3.COPY,
|
|
13
|
+
coupon: { name: 'couponCode' },
|
|
14
|
+
attributionId: actions_shared_3.COPY,
|
|
15
|
+
referralCode: actions_shared_3.COPY,
|
|
16
|
+
giftCardCodes: actions_shared_3.COPY,
|
|
17
|
+
products: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
defaultObject: { sku: 'unknown', name: 'unknown', quantity: 1 },
|
|
20
|
+
fields: {
|
|
21
|
+
sku: actions_shared_3.COPY,
|
|
22
|
+
name: actions_shared_3.COPY,
|
|
23
|
+
quantity: actions_shared_3.COPY,
|
|
24
|
+
price: actions_shared_3.COPY,
|
|
25
|
+
description: actions_shared_3.COPY,
|
|
26
|
+
category: actions_shared_3.COPY,
|
|
27
|
+
url: actions_shared_3.COPY,
|
|
28
|
+
image_url: { name: 'imageUrl' }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
customerId: actions_shared_3.COPY,
|
|
32
|
+
email: actions_shared_3.COPY,
|
|
33
|
+
firstName: actions_shared_3.COPY,
|
|
34
|
+
lastName: actions_shared_3.COPY,
|
|
35
|
+
isNewCustomer: actions_shared_3.COPY,
|
|
36
|
+
age: actions_shared_3.DROP,
|
|
37
|
+
birthday: actions_shared_3.DROP,
|
|
38
|
+
ipAddress: actions_shared_3.COPY,
|
|
39
|
+
userAgent: actions_shared_3.COPY,
|
|
40
|
+
pageUrl: actions_shared_3.DROP,
|
|
41
|
+
pageTitle: actions_shared_3.DROP
|
|
42
|
+
},
|
|
43
|
+
unmappedFieldObject: 'additionalProperties'
|
|
44
|
+
};
|
|
45
|
+
const action = {
|
|
46
|
+
title: 'Track Purchase',
|
|
47
|
+
description: 'Record when a customer makes a purchase.',
|
|
48
|
+
fields: Object.assign({}, actions_shared_4.trackPurchaseFields, actions_shared_1.commonCustomerFields(false), actions_shared_2.contextFields),
|
|
49
|
+
perform: async (request, { settings, payload }) => {
|
|
50
|
+
const friendbuyPayload = actions_shared_3.mapEvent(trackPurchaseMapi, payload);
|
|
51
|
+
const requestParams = await cloudUtil_1.createRequestParams(request, settings, friendbuyPayload);
|
|
52
|
+
return request(`${cloudUtil_1.mapiUrl}/v1/event/purchase`, requestParams);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.default = action;
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackPurchase/index.ts"],"names":[],"mappings":";;AAKA,4CAA2D;AAC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,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,gBAAgB,GAAG,yBAAQ,CAAC,iBAAiB,EAAE,OAAsC,CAAC,CAAA;QAC5F,MAAM,aAAa,GAAG,MAAM,+BAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAA;QACpF,OAAO,OAAO,CAAC,GAAG,mBAAO,oBAAoB,EAAE,aAAa,CAAC,CAAA;IAC/D,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
customerId: string;
|
|
3
|
+
anonymousId?: string;
|
|
4
|
+
email: string;
|
|
5
|
+
isNewCustomer?: boolean;
|
|
6
|
+
loyaltyStatus?: string;
|
|
7
|
+
firstName?: string;
|
|
8
|
+
lastName?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
age?: number;
|
|
11
|
+
birthday?: string;
|
|
12
|
+
friendbuyAttributes?: {
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
pageUrl?: string;
|
|
16
|
+
pageTitle?: string;
|
|
17
|
+
userAgent?: string;
|
|
18
|
+
ipAddress?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackSignUp/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cloudUtil_1 = require("../cloudUtil");
|
|
4
|
+
const actions_shared_1 = require("@segment/actions-shared");
|
|
5
|
+
const actions_shared_2 = require("@segment/actions-shared");
|
|
6
|
+
const actions_shared_3 = require("@segment/actions-shared");
|
|
7
|
+
const actions_shared_4 = require("@segment/actions-shared");
|
|
8
|
+
const trackSignUpMapi = {
|
|
9
|
+
fields: {
|
|
10
|
+
coupon: { name: 'couponCode' },
|
|
11
|
+
attributionId: actions_shared_2.COPY,
|
|
12
|
+
referralCode: actions_shared_2.COPY,
|
|
13
|
+
customerId: actions_shared_2.COPY,
|
|
14
|
+
email: actions_shared_2.COPY,
|
|
15
|
+
isNewCustomer: actions_shared_2.COPY,
|
|
16
|
+
loyaltyStatus: actions_shared_2.COPY,
|
|
17
|
+
firstName: actions_shared_2.COPY,
|
|
18
|
+
lastName: actions_shared_2.COPY,
|
|
19
|
+
age: actions_shared_2.COPY,
|
|
20
|
+
birthday: { convert: actions_shared_4.parseDate },
|
|
21
|
+
ipAddress: actions_shared_2.COPY,
|
|
22
|
+
userAgent: actions_shared_2.COPY,
|
|
23
|
+
pageUrl: actions_shared_2.DROP,
|
|
24
|
+
pageTitle: actions_shared_2.DROP
|
|
25
|
+
},
|
|
26
|
+
unmappedFieldObject: 'additionalProperties'
|
|
27
|
+
};
|
|
28
|
+
const action = {
|
|
29
|
+
title: 'Track Sign Up',
|
|
30
|
+
description: 'Record when a customer signs up for a service.',
|
|
31
|
+
fields: Object.assign({}, actions_shared_3.trackSignUpFields, actions_shared_1.contextFields),
|
|
32
|
+
perform: async (request, { settings, payload }) => {
|
|
33
|
+
const friendbuyPayload = actions_shared_2.mapEvent(trackSignUpMapi, payload);
|
|
34
|
+
const requestParams = await cloudUtil_1.createRequestParams(request, settings, friendbuyPayload);
|
|
35
|
+
return request(`${cloudUtil_1.mapiUrl}/v1/event/account-sign-up`, requestParams);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.default = action;
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackSignUp/index.ts"],"names":[],"mappings":";;AAKA,4CAA2D;AAC3D,4DAAuD;AACvD,4DAA8D;AAC9D,4DAA2D;AAC3D,4DAAmD;AAEnD,MAAM,eAAe,GAAa;IAChC,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;QAC9B,aAAa,EAAE,qBAAI;QACnB,YAAY,EAAE,qBAAI;QAGlB,UAAU,EAAE,qBAAI;QAEhB,KAAK,EAAE,qBAAI;QACX,aAAa,EAAE,qBAAI;QACnB,aAAa,EAAE,qBAAI;QACnB,SAAS,EAAE,qBAAI;QACf,QAAQ,EAAE,qBAAI;QAEd,GAAG,EAAE,qBAAI;QACT,QAAQ,EAAE,EAAE,OAAO,EAAE,0BAAuB,EAAE;QAG9C,SAAS,EAAE,qBAAI;QACf,SAAS,EAAE,qBAAI;QACf,OAAO,EAAE,qBAAI;QACb,SAAS,EAAE,qBAAI;KAChB;IACD,mBAAmB,EAAE,sBAAsB;CAC5C,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,kCAAiB,EAAE,8BAAa,CAAC;IAE3D,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,gBAAgB,GAAG,yBAAQ,CAAC,eAAe,EAAE,OAAsC,CAAC,CAAA;QAC1F,MAAM,aAAa,GAAG,MAAM,+BAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAA;QACpF,OAAO,OAAO,CAAC,GAAG,mBAAO,2BAA2B,EAAE,aAAa,CAAC,CAAA;IACtE,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -33,6 +33,7 @@ register('5f7dd6d21ad74f3842b1fc47', './amplitude');
|
|
|
33
33
|
register('60f9d0d048950c356be2e4da', './braze');
|
|
34
34
|
register('61d7456b078e79929de4ee8c', './clevertap');
|
|
35
35
|
register('5f7dd78fe27ce7ff2b8bfa37', './customerio');
|
|
36
|
+
register('61dde0dc77eb0db0392649d3', './friendbuy');
|
|
36
37
|
register('60ad61f9ff47a16b8fb7b5d9', './google-analytics-4');
|
|
37
38
|
register('60ae8b97dcb6cc52d5d0d5ab', './google-enhanced-conversions');
|
|
38
39
|
register('615c7438d93d9b61b1e9e192', './mixpanel');
|
|
@@ -44,6 +45,7 @@ register('5f7dd8e302173ff732db5cc4', './slack');
|
|
|
44
45
|
register('615cae349d109d6b7496a131', './tiktok-conversions');
|
|
45
46
|
register('602efa1f249b9a5e2bf8a813', './twilio');
|
|
46
47
|
register('614a3c7d791c91c41bae7599', './webhook');
|
|
48
|
+
register('61dc4e96894a6d7954cc6e45', './voyage');
|
|
47
49
|
function register(id, destinationPath) {
|
|
48
50
|
const definition = require(destinationPath).default;
|
|
49
51
|
const resolvedPath = require.resolve(destinationPath);
|
|
@@ -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,4BAA4B,CAAC,CAAA;AAClE,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,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,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;IAChD,MAAM,WAAW,GAAG,oBAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAA;IAExE,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAA;KACZ;IAGD,OAAO,IAAI,0BAAW,CAAC,WAAyC,CAAC,CAAA;AACnE,CAAC;AAED,SAAgB,kBAAkB,CAAC,EAAU;IAC3C,MAAM,WAAW,GAAG,gBAAQ,CAAC,EAAE,CAAC,CAAA;IAEhC,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE;QAC5B,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,IAAI,0BAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;AAChD,CAAC;AARD,gDAQC;AAEM,KAAK,UAAU,uBAAuB,CAAC,WAAmB;IAC/D,OAAO,kBAAkB,CAAC,WAAW,CAAC,IAAI,uBAAuB,CAAC,WAAW,CAAC,CAAA;AAChF,CAAC;AAFD,0DAEC"}
|
|
@@ -56,7 +56,6 @@ const action = {
|
|
|
56
56
|
label: 'Email',
|
|
57
57
|
description: 'Email address of the user who triggered the conversion event.',
|
|
58
58
|
type: 'string',
|
|
59
|
-
required: true,
|
|
60
59
|
format: 'email',
|
|
61
60
|
default: {
|
|
62
61
|
'@if': {
|
|
@@ -80,9 +79,9 @@ const action = {
|
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
ttclid: {
|
|
83
|
-
label:
|
|
84
|
-
description:
|
|
85
|
-
type:
|
|
82
|
+
label: 'TikTok Click ID',
|
|
83
|
+
description: 'The value of the ttclid used to match website visitor events with TikTok ads. The ttclid is valid for 7 days. See [Set up ttclid](https://ads.tiktok.com/marketing_api/docs?rid=4eezrhr6lg4&id=1681728034437121) for details.',
|
|
84
|
+
type: 'string',
|
|
86
85
|
default: {
|
|
87
86
|
'@if': {
|
|
88
87
|
exists: { '@path': '$.properties.ttclid' },
|
|
@@ -98,7 +97,7 @@ const action = {
|
|
|
98
97
|
: '';
|
|
99
98
|
const userData = {
|
|
100
99
|
hashedExternalId: formatter_1.formatUserId(payload.external_id),
|
|
101
|
-
hashedEmail: formatter_1.formatEmail(payload.email),
|
|
100
|
+
hashedEmail: formatter_1.formatEmail(payload.email || ''),
|
|
102
101
|
hashedPhoneNumber: formatter_1.formatPhone(payload.phone_number)
|
|
103
102
|
};
|
|
104
103
|
return request('https://business-api.tiktok.com/open_api/v1.2/pixel/track/', {
|
|
@@ -116,7 +115,7 @@ const action = {
|
|
|
116
115
|
},
|
|
117
116
|
ad: {
|
|
118
117
|
callback: payload.ttclid
|
|
119
|
-
}
|
|
118
|
+
}
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-conversions/reportWebEvent/index.ts"],"names":[],"mappings":";;AAGA,2CAAoE;AAEpE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,6JAA6J;IAC/J,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mLAAmL;YACrL,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wDAAwD;YACrE,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,0DAA0D;SACxE;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ;aAClB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,sCAAsC;YAC7C,WAAW,EAAE,wEAAwE;YACrF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QAED,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EACT,2GAA2G;YAC7G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;iBACpC;aACF;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,+DAA+D;YAC5E,IAAI,EAAE,QAAQ;YACd,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-conversions/reportWebEvent/index.ts"],"names":[],"mappings":";;AAGA,2CAAoE;AAEpE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,6JAA6J;IAC/J,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mLAAmL;YACrL,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wDAAwD;YACrE,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,0DAA0D;SACxE;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,QA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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/voyage/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const trackOrderPlaced_1 = __importDefault(require("./trackOrderPlaced"));
|
|
8
|
+
const destination = {
|
|
9
|
+
name: 'Voyage',
|
|
10
|
+
slug: 'actions-voyage',
|
|
11
|
+
mode: 'cloud',
|
|
12
|
+
authentication: {
|
|
13
|
+
scheme: 'custom',
|
|
14
|
+
fields: {
|
|
15
|
+
apiKey: {
|
|
16
|
+
label: 'API Key',
|
|
17
|
+
description: 'Voyage API key. You can create a new API key or find your existing API key in the Advanced section of your [Settings page](https://app.voyagetext.com/dashboard/settings/advanced).',
|
|
18
|
+
type: 'string',
|
|
19
|
+
required: true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
extendRequest: ({ settings }) => {
|
|
24
|
+
return {
|
|
25
|
+
headers: {
|
|
26
|
+
'x-api-key': settings.apiKey
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
presets: [
|
|
31
|
+
{
|
|
32
|
+
name: 'Track Order Placed Event',
|
|
33
|
+
subscribe: 'type = "track"',
|
|
34
|
+
partnerAction: 'trackOrderPlaced',
|
|
35
|
+
mapping: actions_core_1.defaultValues(trackOrderPlaced_1.default.fields)
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
actions: {
|
|
39
|
+
trackOrderPlaced: trackOrderPlaced_1.default
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.default = destination;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/voyage/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAAqD;AACrD,0EAAiD;AAEjD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EACT,qLAAqL;gBACvL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IAED,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP,WAAW,EAAE,QAAQ,CAAC,MAAM;aAC7B;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP;YACE,IAAI,EAAE,0BAA0B;YAChC,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,kBAAkB;YACjC,OAAO,EAAE,4BAAa,CAAC,0BAAgB,CAAC,MAAM,CAAC;SAChD;KACF;IAED,OAAO,EAAE;QACP,gBAAgB,EAAhB,0BAAgB;KACjB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
DateCreated: string | number;
|
|
3
|
+
OrderNumber?: string;
|
|
4
|
+
SourceId?: string;
|
|
5
|
+
TokenId?: string;
|
|
6
|
+
CustomerId: string;
|
|
7
|
+
Url: string;
|
|
8
|
+
OrderTotal: number;
|
|
9
|
+
TotalSpent: number;
|
|
10
|
+
FirstName?: string;
|
|
11
|
+
lastName?: string;
|
|
12
|
+
Phone: string;
|
|
13
|
+
Email?: string;
|
|
14
|
+
Zip: string;
|
|
15
|
+
LastUpdated?: string | number;
|
|
16
|
+
ProductImageUrl?: string;
|
|
17
|
+
LinkReference?: string;
|
|
18
|
+
HomepageUrl?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/voyage/trackOrderPlaced/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Track Order Placed',
|
|
6
|
+
description: 'Track when an order is placed.',
|
|
7
|
+
defaultSubscription: 'type = "track"',
|
|
8
|
+
fields: {
|
|
9
|
+
DateCreated: {
|
|
10
|
+
label: 'Timestamp',
|
|
11
|
+
description: 'Date of cart creation. Default to current date and time.',
|
|
12
|
+
type: 'datetime',
|
|
13
|
+
required: true,
|
|
14
|
+
default: {
|
|
15
|
+
'@path': '$.timestamp'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
OrderNumber: {
|
|
19
|
+
label: 'Order Number',
|
|
20
|
+
description: 'Order number from e-commerce platform.',
|
|
21
|
+
type: 'string',
|
|
22
|
+
default: {
|
|
23
|
+
'@path': '$.properties.OrderNumber'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
SourceId: {
|
|
27
|
+
label: 'Order ID',
|
|
28
|
+
description: 'Order id from e-commerce platform (same as checkout id).',
|
|
29
|
+
type: 'string',
|
|
30
|
+
default: {
|
|
31
|
+
'@path': '$.properties.SourceId'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
TokenId: {
|
|
35
|
+
label: 'Token ID',
|
|
36
|
+
description: 'A reference to the order that is a string value.',
|
|
37
|
+
type: 'string',
|
|
38
|
+
default: {
|
|
39
|
+
'@path': '$.properties.TokenId'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
CustomerId: {
|
|
43
|
+
label: 'Customer ID',
|
|
44
|
+
description: 'Customer ID from e-commerce platform.',
|
|
45
|
+
type: 'string',
|
|
46
|
+
required: true,
|
|
47
|
+
default: {
|
|
48
|
+
'@path': '$.properties.CustomerId'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
Url: {
|
|
52
|
+
label: 'Order URL',
|
|
53
|
+
description: 'Link for user to click on to see status.',
|
|
54
|
+
type: 'string',
|
|
55
|
+
format: 'uri',
|
|
56
|
+
required: true,
|
|
57
|
+
default: {
|
|
58
|
+
'@path': '$.properties.Url'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
OrderTotal: {
|
|
62
|
+
label: 'Order Total',
|
|
63
|
+
description: 'Total Order Value.',
|
|
64
|
+
type: 'number',
|
|
65
|
+
required: true,
|
|
66
|
+
default: {
|
|
67
|
+
'@path': '$.properties.OrderTotal'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
TotalSpent: {
|
|
71
|
+
label: 'Total Spent',
|
|
72
|
+
description: 'Total customer lifetime spend.',
|
|
73
|
+
type: 'number',
|
|
74
|
+
required: true,
|
|
75
|
+
default: {
|
|
76
|
+
'@path': '$.properties.TotalSpent'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
FirstName: {
|
|
80
|
+
label: 'First name',
|
|
81
|
+
description: "Customer's first name.",
|
|
82
|
+
type: 'string',
|
|
83
|
+
default: {
|
|
84
|
+
'@path': '$.properties.FirstName'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
lastName: {
|
|
88
|
+
label: 'Last name',
|
|
89
|
+
description: "Customer's last name.",
|
|
90
|
+
type: 'string',
|
|
91
|
+
default: {
|
|
92
|
+
'@path': '$.properties.lastName'
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
Phone: {
|
|
96
|
+
label: 'Phone number',
|
|
97
|
+
description: "Customer's phone number.",
|
|
98
|
+
type: 'string',
|
|
99
|
+
required: true,
|
|
100
|
+
default: {
|
|
101
|
+
'@path': '$.properties.Phone'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
Email: {
|
|
105
|
+
label: 'Email',
|
|
106
|
+
description: "Customer's email address",
|
|
107
|
+
type: 'string',
|
|
108
|
+
format: 'email',
|
|
109
|
+
default: {
|
|
110
|
+
'@path': '$.properties.Email'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
Zip: {
|
|
114
|
+
label: 'Zip code',
|
|
115
|
+
description: "Customer's postal code",
|
|
116
|
+
type: 'string',
|
|
117
|
+
required: true,
|
|
118
|
+
default: {
|
|
119
|
+
'@path': '$.properties.Zip'
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
LastUpdated: {
|
|
123
|
+
label: 'Last Updated',
|
|
124
|
+
description: 'The date and time when the updates interacted with.',
|
|
125
|
+
type: 'datetime',
|
|
126
|
+
default: {
|
|
127
|
+
'@path': '$.timestamp'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
ProductImageUrl: {
|
|
131
|
+
label: 'Product Image URL',
|
|
132
|
+
description: 'URL with product image.',
|
|
133
|
+
type: 'string',
|
|
134
|
+
format: 'uri',
|
|
135
|
+
default: {
|
|
136
|
+
'@path': '$.properties.ProductImageUrl'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
LinkReference: {
|
|
140
|
+
label: 'Link reference',
|
|
141
|
+
description: 'Used as a key to link events together.',
|
|
142
|
+
type: 'string',
|
|
143
|
+
default: {
|
|
144
|
+
'@path': '$.properties.LinkReference'
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
HomepageUrl: {
|
|
148
|
+
label: 'Homepage URL',
|
|
149
|
+
description: "URL of the tenant's e-commerce homepage.",
|
|
150
|
+
type: 'string',
|
|
151
|
+
format: 'uri',
|
|
152
|
+
default: {
|
|
153
|
+
'@path': '$.properties.HomepageUrl'
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
perform: (request, { payload }) => {
|
|
158
|
+
const body = {
|
|
159
|
+
eventTypeId: utils_1.EventTypeId,
|
|
160
|
+
phone: payload.Phone,
|
|
161
|
+
eventMeta: payload
|
|
162
|
+
};
|
|
163
|
+
return request(utils_1.EventEndpoint, { method: 'POST', json: body });
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
exports.default = action;
|
|
167
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/voyage/trackOrderPlaced/index.ts"],"names":[],"mappings":";;AAIA,oCAAqD;AAGrD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,gBAAgB;IAErC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,0DAA0D;YACvE,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,0BAA0B;aACpC;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,0DAA0D;YACvE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,sBAAsB;aAChC;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IA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are const EventApiUri = "/customEvent";
|
|
3
|
+
export declare const EventEndpoint: string;
|
|
4
|
+
export declare const EventTypeId = 7310;
|
|
5
|
+
declare type EventBody<EventMeta> = {
|
|
6
|
+
eventTypeId: number;
|
|
7
|
+
phone: string;
|
|
8
|
+
subscriberId?: string;
|
|
9
|
+
eventMeta: EventMeta;
|
|
10
|
+
};
|
|
11
|
+
declare type OrderPlacedPayload = {
|
|
12
|
+
DateCreated: string | number;
|
|
13
|
+
OrderNumber?: string;
|
|
14
|
+
SourceId?: string;
|
|
15
|
+
TokenId?: string;
|
|
16
|
+
CustomerId: string;
|
|
17
|
+
Url: string;
|
|
18
|
+
OrderTotal: number;
|
|
19
|
+
TotalSpent: number;
|
|
20
|
+
FirstName?: string;
|
|
21
|
+
LastName?: string;
|
|
22
|
+
Phone: string;
|
|
23
|
+
Email?: string;
|
|
24
|
+
Zip: string;
|
|
25
|
+
LastUpdated?: string | number;
|
|
26
|
+
ProductImageUrl?: string;
|
|
27
|
+
LinkReference?: string;
|
|
28
|
+
HomepageUrl?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare type OrderPlacedBody = EventBody<OrderPlacedPayload>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventTypeId = exports.EventEndpoint = exports.EventApiUri = exports.BaseApiUrl = void 0;
|
|
4
|
+
exports.BaseApiUrl = 'https://api.voyagetext.com/api/v1';
|
|
5
|
+
exports.EventApiUri = '/customEvent';
|
|
6
|
+
exports.EventEndpoint = exports.BaseApiUrl + exports.EventApiUri;
|
|
7
|
+
exports.EventTypeId = 7310;
|
|
8
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/voyage/utils.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,mCAAmC,CAAA;AAEhD,QAAA,WAAW,GAAG,cAAc,CAAA;AAE5B,QAAA,aAAa,GAAG,kBAAU,GAAG,mBAAW,CAAA;AAExC,QAAA,WAAW,GAAG,IAAI,CAAA"}
|
|
@@ -11,7 +11,7 @@ const timestamp = new Date().toISOString();
|
|
|
11
11
|
describe('Webhook', () => {
|
|
12
12
|
describe('send', () => {
|
|
13
13
|
it('should work with default mapping', async () => {
|
|
14
|
-
const url = 'https://
|
|
14
|
+
const url = 'https://example.com';
|
|
15
15
|
const event = actions_core_1.createTestEvent({
|
|
16
16
|
timestamp,
|
|
17
17
|
event: 'Test Event'
|
|
@@ -30,7 +30,7 @@ describe('Webhook', () => {
|
|
|
30
30
|
expect(responses[0].status).toBe(200);
|
|
31
31
|
});
|
|
32
32
|
it('supports customizations', async () => {
|
|
33
|
-
const url = 'https://
|
|
33
|
+
const url = 'https://example.build';
|
|
34
34
|
const event = actions_core_1.createTestEvent({
|
|
35
35
|
timestamp,
|
|
36
36
|
event: 'Test Event'
|
|
@@ -49,7 +49,7 @@ describe('Webhook', () => {
|
|
|
49
49
|
expect(responses[0].status).toBe(200);
|
|
50
50
|
});
|
|
51
51
|
it('supports customizations', async () => {
|
|
52
|
-
const url = 'https://
|
|
52
|
+
const url = 'https://example.build';
|
|
53
53
|
const event = actions_core_1.createTestEvent({
|
|
54
54
|
timestamp,
|
|
55
55
|
event: 'Test Event'
|
|
@@ -67,32 +67,6 @@ describe('Webhook', () => {
|
|
|
67
67
|
expect(responses.length).toBe(1);
|
|
68
68
|
expect(responses[0].status).toBe(200);
|
|
69
69
|
});
|
|
70
|
-
it('restricts usage to mme-e2e urls', async () => {
|
|
71
|
-
const url = 'https://api.acme.com/webhook';
|
|
72
|
-
const event = actions_core_1.createTestEvent({
|
|
73
|
-
timestamp,
|
|
74
|
-
event: 'Test Event'
|
|
75
|
-
});
|
|
76
|
-
const data = { cool: true };
|
|
77
|
-
nock_1.default(url).put('/', data).reply(200);
|
|
78
|
-
try {
|
|
79
|
-
await testDestination.testAction('send', {
|
|
80
|
-
event,
|
|
81
|
-
mapping: {
|
|
82
|
-
url,
|
|
83
|
-
method: 'PUT',
|
|
84
|
-
data: { cool: true }
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
fail('expected testAction to reject');
|
|
88
|
-
}
|
|
89
|
-
catch (err) {
|
|
90
|
-
const error = err;
|
|
91
|
-
expect(error.status).toBe(400);
|
|
92
|
-
expect(error.code).toBe('Bad Request');
|
|
93
|
-
expect(error.message).toBe("invalid url 'https://api.acme.com/webhook'");
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
70
|
});
|
|
97
71
|
});
|
|
98
72
|
//# sourceMappingURL=webhook.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.test.js","sourceRoot":"","sources":["../../../../src/destinations/webhook/__test__/webhook.test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"webhook.test.js","sourceRoot":"","sources":["../../../../src/destinations/webhook/__test__/webhook.test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,wDAA8E;AAC9E,qDAA8B;AAE9B,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAO,CAAC,CAAA;AACtD,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;AAE1C,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;YAChD,MAAM,GAAG,GAAG,qBAAqB,CAAA;YACjC,MAAM,KAAK,GAAG,8BAAe,CAAC;gBAC5B,SAAS;gBACT,KAAK,EAAE,YAAY;aACpB,CAAC,CAAA;YAEF,cAAI,CAAC,GAAG,CAAC;iBACN,IAAI,CAAC,GAAG,EAAE,KAAY,CAAC;iBACvB,KAAK,CAAC,GAAG,CAAC,CAAA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