@segment/action-destinations 3.246.0-snap-connector → 3.246.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/acoustic-s3tc/index.js +3 -3
- package/dist/destinations/acoustic-s3tc/index.js.map +1 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.d.ts +6 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js +26 -25
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js.map +1 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/generated-types.d.ts +1 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/index.js +12 -10
- package/dist/destinations/acoustic-s3tc/receiveEvents/index.js.map +1 -1
- package/dist/destinations/avo/index.js +4 -4
- package/dist/destinations/avo/index.js.map +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/customerio/createUpdateDevice/generated-types.d.ts +3 -0
- package/dist/destinations/customerio/createUpdateDevice/index.js +29 -17
- package/dist/destinations/customerio/createUpdateDevice/index.js.map +1 -1
- package/dist/destinations/customerio/createUpdateObject/generated-types.d.ts +3 -0
- package/dist/destinations/customerio/createUpdateObject/index.js +80 -39
- package/dist/destinations/customerio/createUpdateObject/index.js.map +1 -1
- package/dist/destinations/customerio/createUpdatePerson/generated-types.d.ts +4 -1
- package/dist/destinations/customerio/createUpdatePerson/index.d.ts +1 -1
- package/dist/destinations/customerio/createUpdatePerson/index.js +51 -41
- package/dist/destinations/customerio/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/customerio/deleteDevice/index.js +15 -5
- package/dist/destinations/customerio/deleteDevice/index.js.map +1 -1
- package/dist/destinations/customerio/deletePerson/index.js +4 -8
- package/dist/destinations/customerio/deletePerson/index.js.map +1 -1
- package/dist/destinations/customerio/deleteRelationship/index.js +4 -8
- package/dist/destinations/customerio/deleteRelationship/index.js.map +1 -1
- package/dist/destinations/customerio/index.js +39 -15
- package/dist/destinations/customerio/index.js.map +1 -1
- package/dist/destinations/customerio/suppressPerson/index.js +4 -8
- package/dist/destinations/customerio/suppressPerson/index.js.map +1 -1
- package/dist/destinations/customerio/trackEvent/index.js +26 -32
- package/dist/destinations/customerio/trackEvent/index.js.map +1 -1
- package/dist/destinations/customerio/trackPageView/generated-types.d.ts +1 -0
- package/dist/destinations/customerio/trackPageView/index.js +26 -29
- package/dist/destinations/customerio/trackPageView/index.js.map +1 -1
- package/dist/destinations/customerio/trackScreenView/generated-types.d.ts +1 -0
- package/dist/destinations/customerio/trackScreenView/index.js +25 -29
- package/dist/destinations/customerio/trackScreenView/index.js.map +1 -1
- package/dist/destinations/customerio/unsuppressPerson/index.js +4 -8
- package/dist/destinations/customerio/unsuppressPerson/index.js.map +1 -1
- package/dist/destinations/customerio/utils.d.ts +46 -2
- package/dist/destinations/customerio/utils.js +88 -13
- package/dist/destinations/customerio/utils.js.map +1 -1
- package/dist/destinations/display-video-360/shared.d.ts +10 -5
- package/dist/destinations/display-video-360/shared.js +11 -6
- package/dist/destinations/display-video-360/shared.js.map +1 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +5 -2
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +98 -18
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -1
- package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +8 -2
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/addToCart/index.js +8 -2
- package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/addToWishlist/index.js +8 -2
- package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/beginCheckout/index.js +8 -2
- package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/customEvent/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/customEvent/index.js +8 -2
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.d.ts +2 -0
- package/dist/destinations/google-analytics-4/ga4-functions.js +13 -1
- package/dist/destinations/google-analytics-4/ga4-functions.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-properties.d.ts +2 -0
- package/dist/destinations/google-analytics-4/ga4-properties.js +19 -1
- package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-types.d.ts +4 -0
- package/dist/destinations/google-analytics-4/generateLead/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/generateLead/index.js +8 -2
- package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/login/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/login/index.js +8 -2
- package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/pageView/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/pageView/index.js +8 -2
- package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/purchase/index.js +8 -2
- package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/refund/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/refund/index.js +8 -2
- package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/removeFromCart/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/removeFromCart/index.js +8 -2
- package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/search/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/search/index.js +8 -2
- package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/selectItem/index.js +8 -2
- package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/selectPromotion/index.js +8 -2
- package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/signUp/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/signUp/index.js +8 -2
- package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewCart/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/viewCart/index.js +8 -2
- package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/viewItem/index.js +8 -2
- package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItemList/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/viewItemList/index.js +8 -2
- package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +2 -0
- package/dist/destinations/google-analytics-4/viewPromotion/index.js +8 -2
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.d.ts +2 -0
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +31 -0
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.d.ts +2 -0
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +31 -0
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
- package/dist/destinations/klaviyo/orderCompleted/index.js +29 -12
- package/dist/destinations/klaviyo/orderCompleted/index.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +43 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/linkedin-conversions/api/api.test.js +120 -0
- package/dist/destinations/linkedin-conversions/api/api.test.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.d.ts +4 -1
- package/dist/destinations/linkedin-conversions/api/index.js +118 -27
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/generated-types.d.ts +4 -3
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +12 -6
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/types.d.ts +2 -0
- package/dist/destinations/marketo-static-lists/addToList/generated-types.d.ts +8 -1
- package/dist/destinations/marketo-static-lists/addToList/index.js +2 -1
- package/dist/destinations/marketo-static-lists/addToList/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/constants.js +2 -2
- package/dist/destinations/marketo-static-lists/constants.js.map +1 -1
- package/dist/destinations/marketo-static-lists/functions.d.ts +1 -0
- package/dist/destinations/marketo-static-lists/functions.js +30 -13
- package/dist/destinations/marketo-static-lists/functions.js.map +1 -1
- package/dist/destinations/marketo-static-lists/index.js +3 -2
- package/dist/destinations/marketo-static-lists/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/properties.d.ts +3 -1
- package/dist/destinations/marketo-static-lists/properties.js +88 -6
- package/dist/destinations/marketo-static-lists/properties.js.map +1 -1
- package/dist/destinations/marketo-static-lists/removeFromList/generated-types.d.ts +2 -1
- package/dist/destinations/marketo-static-lists/removeFromList/index.js +2 -1
- package/dist/destinations/marketo-static-lists/removeFromList/index.js.map +1 -1
- package/dist/destinations/mixpanel/utils.d.ts +13 -0
- package/dist/destinations/mixpanel/utils.js +117 -0
- package/dist/destinations/mixpanel/utils.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js +3 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/index.d.ts +5 -0
- package/dist/destinations/movable-ink/categoryView/index.js +43 -0
- package/dist/destinations/movable-ink/categoryView/index.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +20 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js +3 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/index.d.ts +5 -0
- package/dist/destinations/movable-ink/conversion/index.js +45 -0
- package/dist/destinations/movable-ink/conversion/index.js.map +1 -0
- package/dist/destinations/movable-ink/fields.d.ts +21 -0
- package/dist/destinations/movable-ink/fields.js +236 -0
- package/dist/destinations/movable-ink/fields.js.map +1 -0
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +7 -0
- package/dist/destinations/movable-ink/identify/generated-types.js +3 -0
- package/dist/destinations/movable-ink/identify/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/identify/index.d.ts +5 -0
- package/dist/destinations/movable-ink/identify/index.js +32 -0
- package/dist/destinations/movable-ink/identify/index.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productAdded/index.js +43 -0
- package/dist/destinations/movable-ink/productAdded/index.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +21 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productViewed/index.js +43 -0
- package/dist/destinations/movable-ink/productViewed/index.js.map +1 -0
- package/dist/destinations/movable-ink/search/generated-types.d.ts +12 -0
- package/dist/destinations/movable-ink/search/generated-types.js +3 -0
- package/dist/destinations/movable-ink/search/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/search/index.d.ts +5 -0
- package/dist/destinations/movable-ink/search/index.js +43 -0
- package/dist/destinations/movable-ink/search/index.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +25 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +3 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +5 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +48 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +1 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +14 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js +3 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +1 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +5 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +113 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +1 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +20 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js +3 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +1 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +5 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +174 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +1 -0
- package/dist/destinations/responsys/rsp-operations.d.ts +14 -0
- package/dist/destinations/responsys/rsp-operations.js +33 -0
- package/dist/destinations/responsys/rsp-operations.js.map +1 -0
- package/dist/destinations/responsys/rsp-properties.d.ts +4 -0
- package/dist/destinations/responsys/rsp-properties.js +27 -0
- package/dist/destinations/responsys/rsp-properties.js.map +1 -0
- package/dist/destinations/schematic/trackEvent/generated-types.d.ts +1 -0
- package/dist/destinations/schematic/trackEvent/index.js +19 -3
- package/dist/destinations/schematic/trackEvent/index.js.map +1 -1
- package/dist/destinations/{tiktok-conversions → tiktok-offline-conversions/reportOfflineEvent}/formatter.js +11 -11
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +3 -3
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +305 -4
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.d.ts +4 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js +3 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.d.ts +5 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js +33 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.d.ts +6 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js +3 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.d.ts +5 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.js +45 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.js.map +1 -0
- package/dist/destinations/yahoo-audiences/utils.d.ts +4 -0
- package/dist/destinations/yahoo-audiences/utils.js +30 -0
- package/dist/destinations/yahoo-audiences/utils.js.map +1 -0
- package/package.json +1 -1
- package/dist/destinations/mixpanel/incrementProperties/__test__/__snapshots__/snapshot.test.js.snap +0 -18
- package/dist/destinations/tiktok-conversions/common_fields.d.ts +0 -2
- package/dist/destinations/tiktok-conversions/common_fields.js +0 -245
- package/dist/destinations/tiktok-conversions/common_fields.js.map +0 -1
- package/dist/destinations/tiktok-conversions/formatter.js.map +0 -1
- package/dist/destinations/tiktok-conversions/utils.d.ts +0 -4
- package/dist/destinations/tiktok-conversions/utils.js +0 -65
- package/dist/destinations/tiktok-conversions/utils.js.map +0 -1
- package/dist/destinations/tiktok-offline-conversions/utils.d.ts +0 -8
- package/dist/destinations/tiktok-offline-conversions/utils.js +0 -67
- package/dist/destinations/tiktok-offline-conversions/utils.js.map +0 -1
- package/dist/destinations/{tiktok-conversions → tiktok-offline-conversions/reportOfflineEvent}/formatter.d.ts +1 -1
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
7
|
const index_1 = __importDefault(require("./receiveEvents/index"));
|
|
8
8
|
const mod = `
|
|
9
|
-
Last-Modified:
|
|
9
|
+
Last-Modified: 02.01.2024 10.30.43
|
|
10
10
|
`;
|
|
11
11
|
const presets = [
|
|
12
12
|
{
|
|
@@ -15,7 +15,7 @@ const presets = [
|
|
|
15
15
|
partnerAction: 'receiveEvents',
|
|
16
16
|
mapping: {
|
|
17
17
|
...actions_core_1.defaultValues(index_1.default.fields),
|
|
18
|
-
|
|
18
|
+
uniqueRecipientId: {
|
|
19
19
|
'@if': {
|
|
20
20
|
exists: { '@path': '$.properties.email' },
|
|
21
21
|
then: { '@path': '$.properties.email' },
|
|
@@ -31,7 +31,7 @@ const presets = [
|
|
|
31
31
|
partnerAction: 'receiveEvents',
|
|
32
32
|
mapping: {
|
|
33
33
|
...actions_core_1.defaultValues(index_1.default.fields),
|
|
34
|
-
|
|
34
|
+
uniqueRecipientId: {
|
|
35
35
|
'@if': {
|
|
36
36
|
exists: { '@path': '$.traits.email' },
|
|
37
37
|
then: { '@path': '$.traits.email' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/acoustic-s3tc/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,kEAAiD;AAEjD,MAAM,GAAG,GAAG;;CAEX,CAAA;AAID,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,eAAe;QAC9B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,eAAa,CAAC,MAAM,CAAC;YACtC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/acoustic-s3tc/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,kEAAiD;AAEjD,MAAM,GAAG,GAAG;;CAEX,CAAA;AAID,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,eAAe;QAC9B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,eAAa,CAAC,MAAM,CAAC;YACtC,iBAAiB,EAAE;gBACjB,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAA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YACD,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,oEAAoE;gBACjF,OAAO,EAAE,WAAW;gBACpB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,KAAK,GAAG,IAAI;gBACzB,OAAO,EAAE,aAAa;gBACtB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;aAChB;SACF;KACF;IACD,OAAO;IACP,OAAO,EAAE;QACP,aAAa,EAAb,eAAa;KACd;CACF,CAAA;AACD,kBAAe,WAAW,CAAA"}
|
|
@@ -4,4 +4,9 @@ export declare function parseSections(section: {
|
|
|
4
4
|
}, nestDepth: number): {
|
|
5
5
|
[key: string]: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function addUpdateEvents(payload: Payload,
|
|
7
|
+
export declare function addUpdateEvents(payload: Payload, uniqRecip: string): {
|
|
8
|
+
propertiesTraitsKV: {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
l: string;
|
|
12
|
+
};
|
|
@@ -9,7 +9,7 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
9
9
|
function parseSections(section, nestDepth) {
|
|
10
10
|
const parseResults = {};
|
|
11
11
|
if (nestDepth > 10)
|
|
12
|
-
throw new actions_core_1.IntegrationError('Event data exceeds nesting depth.', 'NESTING_DEPTH_EXCEEDED', 400);
|
|
12
|
+
throw new actions_core_1.IntegrationError('Event data exceeds nesting depth. Plese use mapping to flatten the data to no more than three levels deep.', 'NESTING_DEPTH_EXCEEDED', 400);
|
|
13
13
|
try {
|
|
14
14
|
if (section === null)
|
|
15
15
|
section = { null: '' };
|
|
@@ -36,13 +36,20 @@ function parseSections(section, nestDepth) {
|
|
|
36
36
|
return parseResults;
|
|
37
37
|
}
|
|
38
38
|
exports.parseSections = parseSections;
|
|
39
|
-
function addUpdateEvents(payload,
|
|
40
|
-
let eventName = '';
|
|
41
|
-
let eventValue = '';
|
|
42
|
-
let csvRows = 'EMAIL, EventSource, EventName, EventValue, EventTimestamp\n';
|
|
43
|
-
const eventSource = get_1.default(payload, 'type', 'Null') + ' Event';
|
|
44
|
-
const timestamp = get_1.default(payload, 'timestamp', 'Null');
|
|
39
|
+
function addUpdateEvents(payload, uniqRecip) {
|
|
45
40
|
let propertiesTraitsKV = {};
|
|
41
|
+
propertiesTraitsKV = {
|
|
42
|
+
...propertiesTraitsKV,
|
|
43
|
+
...{ ['uniqueRecipient']: uniqRecip }
|
|
44
|
+
};
|
|
45
|
+
propertiesTraitsKV = {
|
|
46
|
+
...propertiesTraitsKV,
|
|
47
|
+
...{ ['eventSource']: get_1.default(payload, 'type', 'Null') + ' Event' }
|
|
48
|
+
};
|
|
49
|
+
propertiesTraitsKV = {
|
|
50
|
+
...propertiesTraitsKV,
|
|
51
|
+
...{ ['timestamp']: get_1.default(payload, 'timestamp', 'Null') }
|
|
52
|
+
};
|
|
46
53
|
if (payload.key_value_pairs)
|
|
47
54
|
propertiesTraitsKV = {
|
|
48
55
|
...propertiesTraitsKV,
|
|
@@ -68,10 +75,9 @@ function addUpdateEvents(payload, email) {
|
|
|
68
75
|
...propertiesTraitsKV,
|
|
69
76
|
...parseSections(payload.context, 0)
|
|
70
77
|
};
|
|
71
|
-
let ak = '';
|
|
72
|
-
let av = '';
|
|
73
78
|
const getValue = (o, part) => Object.entries(o).find(([k, _v]) => k.includes(part))?.[1];
|
|
74
79
|
const getKey = (o, part) => Object.entries(o).find(([k, _v]) => k.includes(part))?.[0];
|
|
80
|
+
let ak, av;
|
|
75
81
|
if (getValue(propertiesTraitsKV, 'computation_class')?.toLowerCase() === 'audience') {
|
|
76
82
|
ak = getValue(propertiesTraitsKV, 'computation_key');
|
|
77
83
|
av = getValue(propertiesTraitsKV, `${ak}`);
|
|
@@ -88,23 +94,18 @@ function addUpdateEvents(payload, email) {
|
|
|
88
94
|
delete propertiesTraitsKV[`${x}`];
|
|
89
95
|
delete propertiesTraitsKV[`${ak}`];
|
|
90
96
|
}
|
|
91
|
-
if (av !==
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
csvRows += `${email}, ${eventSource}, ${eventName}, ${eventValue}, ${timestamp}\n`;
|
|
101
|
-
}
|
|
102
|
-
for (const e in propertiesTraitsKV) {
|
|
103
|
-
const eventName = e;
|
|
104
|
-
const eventValue = propertiesTraitsKV[e];
|
|
105
|
-
csvRows += `${email}, ${eventSource}, ${eventName}, ${eventValue}, ${timestamp}\n`;
|
|
97
|
+
if (av !== null) {
|
|
98
|
+
if (av)
|
|
99
|
+
av = 'Audience Entered';
|
|
100
|
+
if (!av)
|
|
101
|
+
av = 'Audience Exited';
|
|
102
|
+
propertiesTraitsKV = {
|
|
103
|
+
...propertiesTraitsKV,
|
|
104
|
+
...{ [`${ak}`]: av }
|
|
105
|
+
};
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
const l = propertiesTraitsKV.length;
|
|
108
|
+
return { propertiesTraitsKV, l };
|
|
108
109
|
}
|
|
109
110
|
exports.addUpdateEvents = addUpdateEvents;
|
|
110
111
|
//# sourceMappingURL=eventprocessing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventprocessing.js","sourceRoot":"","sources":["../../../../src/destinations/acoustic-s3tc/receiveEvents/eventprocessing.ts"],"names":[],"mappings":";;;;;;AACA,wDAAwD;AAExD,qDAA4B;AAE5B,SAAgB,aAAa,CAAC,OAAkC,EAAE,SAAiB;IACjF,MAAM,YAAY,GAA8B,EAAE,CAAA;IAElD,IAAI,SAAS,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"eventprocessing.js","sourceRoot":"","sources":["../../../../src/destinations/acoustic-s3tc/receiveEvents/eventprocessing.ts"],"names":[],"mappings":";;;;;;AACA,wDAAwD;AAExD,qDAA4B;AAE5B,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A;QACpD,OAAO,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACjC,OAAO,kBAAkB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;KACnC;IAED,IAAI,EAAE,KAAK,IAAI,EAAE;QACf,IAAI,EAAE;YAAE,EAAE,GAAG,kBAAkB,CAAA;QAC/B,IAAI,CAAC,EAAE;YAAE,EAAE,GAAG,iBAAiB,CAAA;QAE/B,kBAAkB,GAAG;YACnB,GAAG,kBAAkB;YACrB,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE;SACrB,CAAA;KACF;IAED,MAAM,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAA;IAEnC,OAAO,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAA;AAClC,CAAC;AAzFD,0CAyFC"}
|
|
@@ -39,11 +39,11 @@ const action = {
|
|
|
39
39
|
description: 'If the data is present in a Traits section, use this to map the attributes of a Traits Section (optional) ',
|
|
40
40
|
type: 'object'
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
label: '
|
|
44
|
-
description: '
|
|
42
|
+
uniqueRecipientId: {
|
|
43
|
+
label: 'UniqueRecipientId',
|
|
44
|
+
description: 'The field to be used to uniquely identify the Recipient in Acoustic. This field is required with Email preferred but not required.',
|
|
45
45
|
type: 'string',
|
|
46
|
-
format: '
|
|
46
|
+
format: 'text',
|
|
47
47
|
required: true,
|
|
48
48
|
default: {
|
|
49
49
|
'@if': {
|
|
@@ -73,17 +73,19 @@ const action = {
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
perform: async (request, { settings, payload }) => {
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
78
|
-
throw new actions_core_1.IntegrationError('
|
|
76
|
+
const uniqRecip = get_1.default(payload, 'uniqueRecipientId', '');
|
|
77
|
+
if (!uniqRecip) {
|
|
78
|
+
throw new actions_core_1.IntegrationError('Unique Recipient Id Not Found, invalid Event received.', 'INVALID_EVENT_HAS_NO_UNIQUERECIPIENTID', 400);
|
|
79
79
|
}
|
|
80
80
|
if (!payload.context && !payload.traits && !payload.properties)
|
|
81
81
|
throw new actions_core_1.IntegrationError('No mapped data provided, must use at least one of the mapping fields to define the data to be sent to Acoustic.', 'INVALID_NO_DATA_MAPPED', 400);
|
|
82
82
|
preCheck_1.validateSettings(settings);
|
|
83
|
-
const
|
|
84
|
-
|
|
83
|
+
const parsed = eventprocessing_1.addUpdateEvents(payload, uniqRecip);
|
|
84
|
+
let jsonData = '';
|
|
85
|
+
jsonData = JSON.stringify(parsed.propertiesTraitsKV);
|
|
86
|
+
const fileName = settings.fileNamePrefix + `${new Date().toISOString().replace(/(\.|-|:)/g, '_')}` + '.json';
|
|
85
87
|
const method = 'PUT';
|
|
86
|
-
const opts = await s3_1.default(settings.s3_bucket_accesspoint_alias, settings.s3_region, fileName, method,
|
|
88
|
+
const opts = await s3_1.default(settings.s3_bucket_accesspoint_alias, settings.s3_region, fileName, method, jsonData, settings.s3_access_key, settings.s3_secret);
|
|
87
89
|
if (!opts.headers || !opts.method || !opts.host || !opts.path) {
|
|
88
90
|
throw new actions_core_1.InvalidAuthenticationError('Unable to generate correct signature header for AWS S3 Put request.');
|
|
89
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/acoustic-s3tc/receiveEvents/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsG;AAGtG,qDAA4B;AAC5B,uDAAmD;AACnD,6DAA0D;AAC1D,yCAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,0LAA0L;IAC5L,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,2GAA2G;YAC7G,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,oBAAoB,EAAE,IAAI;SAC3B;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EACT,6GAA6G;YAC/G,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,oHAAoH;YACtH,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,4GAA4G;YAC9G,IAAI,EAAE,QAAQ;SACf;QACD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/acoustic-s3tc/receiveEvents/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsG;AAGtG,qDAA4B;AAC5B,uDAAmD;AACnD,6DAA0D;AAC1D,yCAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,0LAA0L;IAC5L,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,2GAA2G;YAC7G,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,oBAAoB,EAAE,IAAI;SAC3B;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EACT,6GAA6G;YAC/G,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,oHAAoH;YACtH,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,4GAA4G;YAC9G,IAAI,EAAE,QAAQ;SACf;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,mBAAmB;YAC1B,WA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AA;QAEjB,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAA;QAGpD,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,CAAA;QAE5G,MAAM,MAAM,GAAG,KAAK,CAAA;QACpB,MAAM,IAAI,GAAG,MAAM,YAAwB,CACzC,QAAQ,CAAC,2BAA2B,EACpC,QAAQ,CAAC,SAAS,EAClB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,CAAC,aAAa,EACtB,QAAQ,CAAC,SAAS,CACnB,CAAA;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAC7D,MAAM,IAAI,yCAA0B,CAAC,qEAAqE,CAAC,CAAA;SAC5G;QAED,OAAO,MAAM,OAAO,CAAC,WAAW,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE;YACxD,OAAO,EAAE,IAAI,CAAC,OAAiC;YAC/C,MAAM;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AACD,kBAAe,MAAM,CAAA"}
|
|
@@ -14,8 +14,8 @@ const destination = {
|
|
|
14
14
|
scheme: 'custom',
|
|
15
15
|
fields: {
|
|
16
16
|
apiKey: {
|
|
17
|
-
label: 'API Key',
|
|
18
|
-
description: 'Avo Inspector API Key',
|
|
17
|
+
label: 'Avo Inspector API Key',
|
|
18
|
+
description: 'Avo Inspector API Key can be found in the Inspector setup page on your source in Avo.',
|
|
19
19
|
type: 'string',
|
|
20
20
|
required: true
|
|
21
21
|
},
|
|
@@ -28,8 +28,8 @@ const destination = {
|
|
|
28
28
|
required: true
|
|
29
29
|
},
|
|
30
30
|
appVersionPropertyName: {
|
|
31
|
-
label: 'App Version
|
|
32
|
-
description: '
|
|
31
|
+
label: 'App Version Property',
|
|
32
|
+
description: 'If you send a custom event property on all events that contains the app version, please enter the name of that property here (e.g. “app_version”). If you do not have a custom event property for the app version, please leave this field empty.',
|
|
33
33
|
type: 'string',
|
|
34
34
|
required: false
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/avo/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA4E;AAE5E,oFAAsD;AACtD,iEAA+D;AAE/D,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/avo/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA4E;AAE5E,oFAAsD;AACtD,iEAA+D;AAE/D,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,uFAAuF;gBACpG,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,GAAG,EAAE;gBACH,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,uBAAW,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;gBACtG,OAAO,EAAE,uBAAW,CAAC,IAAI;gBACzB,QAAQ,EAAE,IAAI;aACf;YACD,sBAAsB,EAAE;gBACtB,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EACT,mPAAmP;gBACrP,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAE5C,MAAM,IAAI,GAAG,OAAO,CAAC,6CAA6C,EAAE;gBAClE,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,MAAM,EAAE,QAAQ,CAAC,MAAM;iBACxB,CAAC;aACH,CAAC,CAAA;YAEF,OAAO,IAAI,CAAA;QACb,CAAC;KACF;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,yBAAyB;YAC/B,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,uBAAuB;YACtC,OAAO,EAAE,4BAAa,CAAC,+BAAgB,CAAC,MAAM,CAAC;YAC/C,IAAI,EAAE,WAAW;SAClB;KACF;IACD,OAAO,EAAE;QACP,qBAAqB,EAAE,+BAAgB;KACxC;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
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 test_data_1 = require("../../../../lib/test-data");
|
|
8
|
+
const index_1 = __importDefault(require("../../index"));
|
|
9
|
+
const nock_1 = __importDefault(require("nock"));
|
|
10
|
+
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
11
|
+
const actionSlug = 'updateUserProfile';
|
|
12
|
+
const destinationSlug = 'Braze';
|
|
13
|
+
const seedName = `${destinationSlug}#${actionSlug}`;
|
|
14
|
+
const receivedAt = '2021-08-03T17:40:04.055Z';
|
|
15
|
+
const settings = {
|
|
16
|
+
app_id: 'my-app-id',
|
|
17
|
+
api_key: 'my-api-key',
|
|
18
|
+
endpoint: 'https://rest.iad-01.braze.com'
|
|
19
|
+
};
|
|
20
|
+
describe(`Testing snapshot for ${destinationSlug}'s ${actionSlug} destination action:`, () => {
|
|
21
|
+
it('required fields', async () => {
|
|
22
|
+
const action = index_1.default.actions[actionSlug];
|
|
23
|
+
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, true);
|
|
24
|
+
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
25
|
+
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
26
|
+
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
27
|
+
const event = actions_core_1.createTestEvent({
|
|
28
|
+
properties: eventData
|
|
29
|
+
});
|
|
30
|
+
const responses = await testDestination.testAction(actionSlug, {
|
|
31
|
+
event: event,
|
|
32
|
+
mapping: event.properties,
|
|
33
|
+
settings: settingsData,
|
|
34
|
+
auth: undefined
|
|
35
|
+
});
|
|
36
|
+
const request = responses[0].request;
|
|
37
|
+
const rawBody = await request.text();
|
|
38
|
+
try {
|
|
39
|
+
const json = JSON.parse(rawBody);
|
|
40
|
+
expect(json).toMatchSnapshot();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
expect(rawBody).toMatchSnapshot();
|
|
45
|
+
}
|
|
46
|
+
expect(request.headers).toMatchSnapshot();
|
|
47
|
+
});
|
|
48
|
+
it('all fields', async () => {
|
|
49
|
+
const action = index_1.default.actions[actionSlug];
|
|
50
|
+
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, false);
|
|
51
|
+
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
52
|
+
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
53
|
+
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
54
|
+
const event = actions_core_1.createTestEvent({
|
|
55
|
+
properties: eventData
|
|
56
|
+
});
|
|
57
|
+
const responses = await testDestination.testAction(actionSlug, {
|
|
58
|
+
event: event,
|
|
59
|
+
mapping: event.properties,
|
|
60
|
+
settings: settingsData,
|
|
61
|
+
auth: undefined
|
|
62
|
+
});
|
|
63
|
+
const request = responses[0].request;
|
|
64
|
+
const rawBody = await request.text();
|
|
65
|
+
try {
|
|
66
|
+
const json = JSON.parse(rawBody);
|
|
67
|
+
expect(json).toMatchSnapshot();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
expect(rawBody).toMatchSnapshot();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
it('it should work with batched events', async () => {
|
|
75
|
+
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
76
|
+
const events = [
|
|
77
|
+
actions_core_1.createTestEvent({
|
|
78
|
+
event: 'Test Event 1',
|
|
79
|
+
type: 'track',
|
|
80
|
+
receivedAt,
|
|
81
|
+
properties: {}
|
|
82
|
+
}),
|
|
83
|
+
actions_core_1.createTestEvent({
|
|
84
|
+
event: 'Test Event 2',
|
|
85
|
+
type: 'track',
|
|
86
|
+
receivedAt,
|
|
87
|
+
properties: {}
|
|
88
|
+
})
|
|
89
|
+
];
|
|
90
|
+
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
91
|
+
events,
|
|
92
|
+
useDefaultMappings: true,
|
|
93
|
+
mapping: {
|
|
94
|
+
external_id: {
|
|
95
|
+
'@path': '$.userId'
|
|
96
|
+
},
|
|
97
|
+
user_alias: {},
|
|
98
|
+
braze_id: {
|
|
99
|
+
'@path': '$.properties.braze_id'
|
|
100
|
+
},
|
|
101
|
+
name: {
|
|
102
|
+
'@path': '$.event'
|
|
103
|
+
},
|
|
104
|
+
time: {
|
|
105
|
+
'@path': '$.receivedAt'
|
|
106
|
+
},
|
|
107
|
+
properties: {
|
|
108
|
+
'@path': '$.properties'
|
|
109
|
+
},
|
|
110
|
+
products: {
|
|
111
|
+
'@path': '$.properties.products'
|
|
112
|
+
},
|
|
113
|
+
enable_batching: true,
|
|
114
|
+
_update_existing_only: true
|
|
115
|
+
},
|
|
116
|
+
settings: {
|
|
117
|
+
...settings
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
expect(responses.length).toBe(1);
|
|
121
|
+
expect(responses[0].status).toBe(200);
|
|
122
|
+
expect(responses[0].options.headers).toMatchSnapshot();
|
|
123
|
+
expect(responses[0].options.json).toMatchSnapshot();
|
|
124
|
+
});
|
|
125
|
+
it('it should work with a single batched events', async () => {
|
|
126
|
+
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
127
|
+
const events = [
|
|
128
|
+
actions_core_1.createTestEvent({
|
|
129
|
+
event: 'Test Event 1',
|
|
130
|
+
type: 'track',
|
|
131
|
+
receivedAt,
|
|
132
|
+
properties: {
|
|
133
|
+
products: [
|
|
134
|
+
{
|
|
135
|
+
quantity: 1,
|
|
136
|
+
product_id: 'Bowflex Treadmill 10',
|
|
137
|
+
price: 100
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
quantity: 2,
|
|
141
|
+
product_id: 'Bowflex Treadmill 20',
|
|
142
|
+
price: 200
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
];
|
|
148
|
+
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
149
|
+
events,
|
|
150
|
+
useDefaultMappings: true,
|
|
151
|
+
mapping: {
|
|
152
|
+
external_id: {
|
|
153
|
+
'@path': '$.userId'
|
|
154
|
+
},
|
|
155
|
+
user_alias: {},
|
|
156
|
+
braze_id: {
|
|
157
|
+
'@path': '$.properties.braze_id'
|
|
158
|
+
},
|
|
159
|
+
name: {
|
|
160
|
+
'@path': '$.event'
|
|
161
|
+
},
|
|
162
|
+
time: {
|
|
163
|
+
'@path': '$.receivedAt'
|
|
164
|
+
},
|
|
165
|
+
properties: {
|
|
166
|
+
'@path': '$.properties'
|
|
167
|
+
},
|
|
168
|
+
products: {
|
|
169
|
+
'@path': '$.properties.products'
|
|
170
|
+
},
|
|
171
|
+
enable_batching: true,
|
|
172
|
+
_update_existing_only: true
|
|
173
|
+
},
|
|
174
|
+
settings: {
|
|
175
|
+
...settings
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
expect(responses.length).toBe(1);
|
|
179
|
+
expect(responses[0].status).toBe(200);
|
|
180
|
+
expect(responses[0].options.headers).toMatchSnapshot();
|
|
181
|
+
expect(responses[0].options.json).toMatchSnapshot();
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
//# sourceMappingURL=snapshot.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.test.js","sourceRoot":"","sources":["../../../../../src/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4F;AAC5F,yDAA4D;AAC5D,wDAAqC;AACrC,gDAAuB;AAEvB,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW,CAAC,CAAA;AAC1D,MAAM,UAAU,GAAG,mBAAmB,CAAA;AACtC,MAAM,eAAe,GAAG,OAAO,CAAA;AAC/B,MAAM,QAAQ,GAAG,GAAG,eAAe,IAAI,UAAU,EAAE,CAAA;AACnD,MAAM,UAAU,GAAG,0BAA0B,CAAA;AAC7C,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,+BAAwC;CACnD,CAAA;AAED,QAAQ,CAAC,wBAAwB,eAAe,MA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E,uBAAuB;iBACjC;gBACD,eAAe,EAAE,IAAI;gBACrB,qBAAqB,EAAE,IAAI;aAC5B;YACD,QAAQ,EAAE;gBACR,GAAG,QAAQ;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAChC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACrC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAA;QACtD,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const utils_1 = require("../utils");
|
|
4
4
|
const action = {
|
|
5
5
|
title: 'Create or Update Device',
|
|
6
|
-
description: `
|
|
6
|
+
description: `Create or update a person's device.`,
|
|
7
7
|
defaultSubscription: 'type = "track" and event = "Application Installed"',
|
|
8
8
|
fields: {
|
|
9
9
|
person_id: {
|
|
@@ -49,6 +49,14 @@ const action = {
|
|
|
49
49
|
'@path': '$.timestamp'
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
+
attributes: {
|
|
53
|
+
label: 'Event Attributes',
|
|
54
|
+
description: `Optional data that you can reference to segment your audience, like a person's attributes, but specific to a device.`,
|
|
55
|
+
type: 'object',
|
|
56
|
+
default: {
|
|
57
|
+
'@path': '$.properties'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
52
60
|
convert_timestamp: {
|
|
53
61
|
label: 'Convert Timestamps',
|
|
54
62
|
description: 'Convert dates to Unix timestamps (seconds since Epoch).',
|
|
@@ -56,23 +64,27 @@ const action = {
|
|
|
56
64
|
default: true
|
|
57
65
|
}
|
|
58
66
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
return request(`${utils_1.trackApiEndpoint(settings.accountRegion)}/api/v1/customers/${payload.person_id}/devices`, {
|
|
65
|
-
method: 'put',
|
|
66
|
-
json: {
|
|
67
|
-
device: {
|
|
68
|
-
id: payload.device_id,
|
|
69
|
-
platform: payload.platform,
|
|
70
|
-
last_used: lastUsed,
|
|
71
|
-
...(payload.app_version ? { attributes: { app_version: payload.app_version } } : {})
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
67
|
+
performBatch: (request, { payload: payloads, settings }) => {
|
|
68
|
+
return utils_1.sendBatch(request, payloads.map((payload) => ({ action: 'add_device', payload: mapPayload(payload), settings, type: 'person' })));
|
|
69
|
+
},
|
|
70
|
+
perform: (request, { payload, settings }) => {
|
|
71
|
+
return utils_1.sendSingle(request, { action: 'add_device', payload: mapPayload(payload), settings, type: 'person' });
|
|
75
72
|
}
|
|
76
73
|
};
|
|
74
|
+
function mapPayload(payload) {
|
|
75
|
+
const { app_version, device_id, platform, last_used, attributes, ...rest } = payload;
|
|
76
|
+
return {
|
|
77
|
+
...rest,
|
|
78
|
+
device: {
|
|
79
|
+
token: device_id,
|
|
80
|
+
platform,
|
|
81
|
+
last_used,
|
|
82
|
+
attributes: {
|
|
83
|
+
...attributes,
|
|
84
|
+
...(payload.app_version ? { app_version: payload.app_version } : {})
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
77
89
|
exports.default = action;
|
|
78
90
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/createUpdateDevice/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/createUp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