@segment/action-destinations 3.246.0-snap-connector → 3.248.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/algolia-insights/algolia-insight-api.d.ts +10 -0
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.d.ts +7 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.js +76 -10
- package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productAddedEvents/index.js +3 -3
- package/dist/destinations/algolia-insights/productAddedEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productClickedEvents/index.js +3 -3
- package/dist/destinations/algolia-insights/productClickedEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.js +3 -3
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productViewedEvents/index.js +3 -3
- package/dist/destinations/algolia-insights/productViewedEvents/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/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/sendEmail/SendEmailPerformer.js +10 -2
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +11 -3
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -1
- package/dist/destinations/engage/utils/Profile.d.ts +1 -1
- package/dist/destinations/engage/utils/track.d.ts +17 -17
- 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/functions.d.ts +2 -2
- package/dist/destinations/google-enhanced-conversions/functions.js +5 -4
- package/dist/destinations/google-enhanced-conversions/functions.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 +33 -2
- 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 +33 -2
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +2 -2
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/kafka/generated-types.d.ts +8 -0
- package/dist/destinations/{trackey/group.types.js → kafka/generated-types.js} +1 -1
- package/dist/destinations/kafka/generated-types.js.map +1 -0
- package/dist/destinations/kafka/index.d.ts +4 -0
- package/dist/destinations/kafka/index.js +70 -0
- package/dist/destinations/kafka/index.js.map +1 -0
- package/dist/destinations/kafka/send/generated-types.d.ts +12 -0
- package/dist/destinations/{engage/sendgrid/Profile.js → kafka/send/generated-types.js} +1 -1
- package/dist/destinations/kafka/send/generated-types.js.map +1 -0
- package/dist/destinations/kafka/send/index.d.ts +5 -0
- package/dist/destinations/kafka/send/index.js +58 -0
- package/dist/destinations/kafka/send/index.js.map +1 -0
- package/dist/destinations/kafka/utils.d.ts +7 -0
- package/dist/destinations/kafka/utils.js +62 -0
- package/dist/destinations/kafka/utils.js.map +1 -0
- package/dist/destinations/klaviyo/orderCompleted/index.js +29 -12
- package/dist/destinations/klaviyo/orderCompleted/index.js.map +1 -1
- 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 +43 -7
- 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/optimizely-data-platform/customEvent/index.js +1 -1
- package/dist/destinations/optimizely-data-platform/customEvent/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/fields.d.ts +1 -0
- package/dist/destinations/optimizely-data-platform/fields.js +10 -1
- package/dist/destinations/optimizely-data-platform/fields.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/index.js +2 -0
- package/dist/destinations/optimizely-data-platform/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/nonEcommCustomEvent/generated-types.d.ts +13 -0
- package/dist/destinations/{trackey/identify.types.js → optimizely-data-platform/nonEcommCustomEvent/generated-types.js} +1 -1
- package/dist/destinations/optimizely-data-platform/nonEcommCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/nonEcommCustomEvent/index.d.ts +5 -0
- package/dist/destinations/optimizely-data-platform/nonEcommCustomEvent/index.js +29 -0
- package/dist/destinations/optimizely-data-platform/nonEcommCustomEvent/index.js.map +1 -0
- package/dist/destinations/salesforce/sf-properties.d.ts +1 -1
- package/dist/destinations/salesforce/sf-properties.js +52 -4
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- 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/snap-conversions-api/_tests_/capiV3tests.js +8 -4
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js +9 -6
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js.map +1 -1
- package/dist/destinations/tiktok-audiences/addUser/index.js +1 -1
- package/dist/destinations/tiktok-audiences/addUser/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/createAudience/index.js +2 -2
- package/dist/destinations/tiktok-audiences/createAudience/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/index.js +3 -3
- package/dist/destinations/tiktok-audiences/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/removeUser/index.js +1 -1
- package/dist/destinations/tiktok-audiences/removeUser/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions-sandbox/common_fields.js +1 -1
- package/dist/destinations/tiktok-conversions-sandbox/common_fields.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/common_fields.js +183 -24
- package/dist/destinations/tiktok-offline-conversions/common_fields.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/formatter.d.ts +1 -0
- package/dist/destinations/tiktok-offline-conversions/formatter.js +11 -1
- package/dist/destinations/tiktok-offline-conversions/formatter.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/index.js +169 -15
- package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +1 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.d.ts +25 -2
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js +4 -29
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.d.ts +18 -5
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js +5 -126
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/utils.js +10 -9
- package/dist/destinations/tiktok-offline-conversions/utils.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions-sandbox/common_fields.js +1 -1
- package/dist/destinations/tiktok-offline-conversions-sandbox/common_fields.js.map +1 -1
- package/package.json +5 -4
- package/dist/destinations/engage/sendgrid/Profile.d.ts +0 -6
- package/dist/destinations/engage/sendgrid/Profile.js.map +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +0 -18
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +0 -94
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +0 -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.d.ts +0 -3
- package/dist/destinations/tiktok-conversions/formatter.js +0 -43
- 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/trackey/group.types.d.ts +0 -11
- package/dist/destinations/trackey/group.types.js.map +0 -1
- package/dist/destinations/trackey/identify.types.d.ts +0 -11
- package/dist/destinations/trackey/identify.types.js.map +0 -1
- package/dist/destinations/trackey/track.types.d.ts +0 -12
- package/dist/destinations/trackey/track.types.js +0 -3
- package/dist/destinations/trackey/track.types.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/kafka/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 send_1 = __importDefault(require("./send"));
|
|
7
|
+
const destination = {
|
|
8
|
+
name: 'Kafka',
|
|
9
|
+
slug: 'actions-kafka',
|
|
10
|
+
mode: 'cloud',
|
|
11
|
+
description: 'Send data to a Kafka topic',
|
|
12
|
+
authentication: {
|
|
13
|
+
scheme: 'custom',
|
|
14
|
+
fields: {
|
|
15
|
+
brokers: {
|
|
16
|
+
label: 'Brokers',
|
|
17
|
+
description: 'The brokers for your Kafka instance, in the format of `host:port`. Accepts a comma delimited string.',
|
|
18
|
+
type: 'string',
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
mechanism: {
|
|
22
|
+
label: 'SASL Authentication Mechanism',
|
|
23
|
+
description: 'The SASL Authentication Mechanism for your Kafka instance.',
|
|
24
|
+
type: 'string',
|
|
25
|
+
required: true,
|
|
26
|
+
choices: [
|
|
27
|
+
{ label: 'Plain', value: 'plain' },
|
|
28
|
+
{ label: 'SCRAM/SHA-256', value: 'scram-sha-256' },
|
|
29
|
+
{ label: 'SCRAM/SHA-512', value: 'scram-sha-512' }
|
|
30
|
+
],
|
|
31
|
+
default: 'plain'
|
|
32
|
+
},
|
|
33
|
+
clientId: {
|
|
34
|
+
label: 'Client ID',
|
|
35
|
+
description: 'The client ID for your Kafka instance. Defaults to "segment-actions-kafka-producer".',
|
|
36
|
+
type: 'string',
|
|
37
|
+
required: true,
|
|
38
|
+
default: 'segment-actions-kafka-producer'
|
|
39
|
+
},
|
|
40
|
+
username: {
|
|
41
|
+
label: 'Username',
|
|
42
|
+
description: 'The username for your Kafka instance.',
|
|
43
|
+
type: 'string',
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
password: {
|
|
47
|
+
label: 'Password',
|
|
48
|
+
description: 'The password for your Kafka instance.',
|
|
49
|
+
type: 'password',
|
|
50
|
+
required: true
|
|
51
|
+
},
|
|
52
|
+
partitionerType: {
|
|
53
|
+
label: 'Partitioner Type',
|
|
54
|
+
description: 'The partitioner type for your Kafka instance. Defaults to "Default Partitioner".',
|
|
55
|
+
type: 'string',
|
|
56
|
+
required: true,
|
|
57
|
+
choices: [
|
|
58
|
+
{ label: 'Default Partitioner', value: 'DefaultPartitioner' },
|
|
59
|
+
{ label: 'Legacy Partitioner', value: 'LegacyPartitioner' }
|
|
60
|
+
],
|
|
61
|
+
default: 'DefaultPartitioner'
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
actions: {
|
|
66
|
+
send: send_1.default
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.default = destination;
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/kafka/index.ts"],"names":[],"mappings":";;;;;AAGA,kDAAyB;AAEzB,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,4BAA4B;IACzC,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,WAAW,EACT,sGAAsG;gBACxG,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,+BAA+B;gBACtC,WAAW,EAAE,4DAA4D;gBACzE,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBAClC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;oBAClD,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;iBACnD;gBACD,OAAO,EAAE,OAAO;aACjB;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,sFAAsF;gBACnG,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,gCAAgC;aAC1C;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,uCAAuC;gBACpD,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,uCAAuC;gBACpD,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,eAAe,EAAE;gBACf,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EAAE,kFAAkF;gBAC/F,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,oBAAoB,EAAE;oBAC7D,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,mBAAmB,EAAE;iBAC5D;gBACD,OAAO,EAAE,oBAAoB;aAC9B;SACF;KACF;IACD,OAAO,EAAE;QACP,IAAI,EAAJ,cAAI;KACL;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/kafka/send/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Send',
|
|
6
|
+
description: 'Send data to a Kafka topic',
|
|
7
|
+
defaultSubscription: 'type = "track" or type = "identify" or type = "page" or type = "screen" or type = "group"',
|
|
8
|
+
fields: {
|
|
9
|
+
topic: {
|
|
10
|
+
label: 'Topic',
|
|
11
|
+
description: 'The Kafka topic to send messages to. This field auto-populates from your Kafka instance.',
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true,
|
|
14
|
+
dynamic: true
|
|
15
|
+
},
|
|
16
|
+
payload: {
|
|
17
|
+
label: 'Payload',
|
|
18
|
+
description: 'The data to send to Kafka',
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: true,
|
|
21
|
+
default: { '@path': '$.' }
|
|
22
|
+
},
|
|
23
|
+
headers: {
|
|
24
|
+
label: 'Headers',
|
|
25
|
+
description: 'Header data to send to Kafka. Format is Header key, Header value (optional).',
|
|
26
|
+
type: 'object',
|
|
27
|
+
defaultObjectUI: 'keyvalue:only'
|
|
28
|
+
},
|
|
29
|
+
partition: {
|
|
30
|
+
label: 'Partition',
|
|
31
|
+
description: 'The partition to send the message to (optional)',
|
|
32
|
+
type: 'integer'
|
|
33
|
+
},
|
|
34
|
+
default_partition: {
|
|
35
|
+
label: 'Default Partition',
|
|
36
|
+
description: 'The default partition to send the message to (optional)',
|
|
37
|
+
type: 'integer'
|
|
38
|
+
},
|
|
39
|
+
key: {
|
|
40
|
+
label: 'Message Key',
|
|
41
|
+
description: 'The key for the message (optional)',
|
|
42
|
+
type: 'string'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
dynamicFields: {
|
|
46
|
+
topic: async (_, { settings }) => {
|
|
47
|
+
return utils_1.getTopics(settings);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
perform: async (_request, { settings, payload }) => {
|
|
51
|
+
await utils_1.sendData(settings, [payload]);
|
|
52
|
+
},
|
|
53
|
+
performBatch: async (_request, { settings, payload }) => {
|
|
54
|
+
await utils_1.sendData(settings, payload);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.default = action;
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kafka/send/index.ts"],"names":[],"mappings":";;AAGA,oCAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,4BAA4B;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,CAAC,CAAA;IACnC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DynamicFieldResponse } from '@segment/actions-core';
|
|
2
|
+
import type { Settings } from './generated-types';
|
|
3
|
+
import type { Payload } from './send/generated-types';
|
|
4
|
+
export declare const DEFAULT_PARTITIONER = "DefaultPartitioner";
|
|
5
|
+
export declare const LEGACY_PARTITIONER = "LegacyPartitioner";
|
|
6
|
+
export declare const getTopics: (settings: Settings) => Promise<DynamicFieldResponse>;
|
|
7
|
+
export declare const sendData: (settings: Settings, payload: Payload[]) => Promise<void>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendData = exports.getTopics = exports.LEGACY_PARTITIONER = exports.DEFAULT_PARTITIONER = void 0;
|
|
4
|
+
const kafkajs_1 = require("kafkajs");
|
|
5
|
+
exports.DEFAULT_PARTITIONER = 'DefaultPartitioner';
|
|
6
|
+
exports.LEGACY_PARTITIONER = 'LegacyPartitioner';
|
|
7
|
+
const getTopics = async (settings) => {
|
|
8
|
+
const kafka = getKafka(settings);
|
|
9
|
+
const admin = kafka.admin();
|
|
10
|
+
await admin.connect();
|
|
11
|
+
const topics = await admin.listTopics();
|
|
12
|
+
await admin.disconnect();
|
|
13
|
+
return { choices: topics.map((topic) => ({ label: topic, value: topic })) };
|
|
14
|
+
};
|
|
15
|
+
exports.getTopics = getTopics;
|
|
16
|
+
const getKafka = (settings) => {
|
|
17
|
+
return new kafkajs_1.Kafka({
|
|
18
|
+
clientId: settings.clientId,
|
|
19
|
+
brokers: settings.brokers.trim().split(',').map(broker => broker.trim()),
|
|
20
|
+
ssl: true,
|
|
21
|
+
sasl: {
|
|
22
|
+
mechanism: settings.mechanism,
|
|
23
|
+
username: settings.username,
|
|
24
|
+
password: settings.password
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const getProducer = (settings) => {
|
|
29
|
+
return getKafka(settings).producer({
|
|
30
|
+
createPartitioner: settings.partitionerType === exports.LEGACY_PARTITIONER
|
|
31
|
+
? kafkajs_1.Partitioners.LegacyPartitioner
|
|
32
|
+
: kafkajs_1.Partitioners.DefaultPartitioner
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const sendData = async (settings, payload) => {
|
|
36
|
+
const groupedPayloads = {};
|
|
37
|
+
payload.forEach((p) => {
|
|
38
|
+
const { topic } = p;
|
|
39
|
+
if (!groupedPayloads[topic]) {
|
|
40
|
+
groupedPayloads[topic] = [];
|
|
41
|
+
}
|
|
42
|
+
groupedPayloads[topic].push(p);
|
|
43
|
+
});
|
|
44
|
+
const topicMessages = Object.keys(groupedPayloads).map((topic) => ({
|
|
45
|
+
topic,
|
|
46
|
+
messages: groupedPayloads[topic].map((payload) => ({
|
|
47
|
+
value: JSON.stringify(payload.payload),
|
|
48
|
+
key: payload.key,
|
|
49
|
+
headers: payload?.headers ?? undefined,
|
|
50
|
+
partition: payload?.partition ?? payload?.default_partition ?? undefined,
|
|
51
|
+
partitionerType: settings.partitionerType
|
|
52
|
+
}))
|
|
53
|
+
}));
|
|
54
|
+
const producer = getProducer(settings);
|
|
55
|
+
await producer.connect();
|
|
56
|
+
for (const data of topicMessages) {
|
|
57
|
+
await producer.send(data);
|
|
58
|
+
}
|
|
59
|
+
await producer.disconnect();
|
|
60
|
+
};
|
|
61
|
+
exports.sendData = sendData;
|
|
62
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/kafka/utils.ts"],"names":[],"mappings":";;;AAAA,qCAA0E;AAK7D,QAAA,mBAAmB,GAAG,oBAAoB,CAAA;AAC1C,QAAA,kBAAkB,GAAG,mBAAmB,CAAA;AAc9C,MAAM,SAAS,GAAG,KAAK,EAAE,QAAkB,EAAiC,EAAE;I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,19 +28,36 @@ const createEventData = (payload) => ({
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
const sendProductRequests = async (payload,
|
|
32
|
-
if (payload.products
|
|
33
|
-
|
|
34
|
-
eventData.data.attributes.properties = product.properties;
|
|
35
|
-
eventData.data.attributes.value = product.value;
|
|
36
|
-
eventData.data.attributes.metric.data.attributes.name = 'Ordered Product';
|
|
37
|
-
return request(`${config_1.API_URL}/events/`, {
|
|
38
|
-
method: 'POST',
|
|
39
|
-
json: eventData
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
await Promise.all(productPromises);
|
|
31
|
+
const sendProductRequests = async (payload, orderEventData, request) => {
|
|
32
|
+
if (!payload.products || !Array.isArray(payload.products)) {
|
|
33
|
+
return;
|
|
43
34
|
}
|
|
35
|
+
const productPromises = payload.products.map((product) => {
|
|
36
|
+
const productEventData = {
|
|
37
|
+
data: {
|
|
38
|
+
type: 'event',
|
|
39
|
+
attributes: {
|
|
40
|
+
properties: { ...product.properties, ...orderEventData.data.attributes.properties },
|
|
41
|
+
value: product.value,
|
|
42
|
+
metric: {
|
|
43
|
+
data: {
|
|
44
|
+
type: 'metric',
|
|
45
|
+
attributes: {
|
|
46
|
+
name: 'Ordered Product'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
time: orderEventData.data.attributes.time,
|
|
51
|
+
profile: orderEventData.data.attributes.profile
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return request(`${config_1.API_URL}/events/`, {
|
|
56
|
+
method: 'POST',
|
|
57
|
+
json: productEventData
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
await Promise.all(productPromises);
|
|
44
61
|
};
|
|
45
62
|
const action = {
|
|
46
63
|
title: 'Order Completed',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/orderCompleted/index.ts"],"names":[],"mappings":";;AAGA,wDAA6E;AAC7E,sCAAmC;AAGnC,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,UAAU,EAAE;YACV,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE;YACrC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,iBAAiB;qBACxB;iBACF;aACF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE;oBACJ,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE;wBACV,GAAG,OAAO,CAAC,OAAO;qBACnB;iBACF;aACF;SACF;KACF;CACF,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,KAAK,EAAE,OAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/orderCompleted/index.ts"],"names":[],"mappings":";;AAGA,wDAA6E;AAC7E,sCAAmC;AAGnC,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,UAAU,EAAE;YACV,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE;YACrC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,iBAAiB;qBACxB;iBACF;aACF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE;oBACJ,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE;wBACV,GAAG,OAAO,CAAC,OAAO;qBAC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KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,OAAO,CAAA;QAE/C,IAAI,CAAC,KAAK,IAAI,CAAC,YAAY,EAAE;YAC3B,MAAM,IAAI,qCAAsB,CAAC,2CAA2C,CAAC,CAAA;SAC9E;QAED,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;QAE1C,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,gBAAO,UAAU,EAAE;YAChD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,SAAS;SAChB,CAAC,CAAA;QAEF,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC1D,MAAM,mBAAmB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;SACvD;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -9,6 +9,126 @@ const api_1 = require("../api");
|
|
|
9
9
|
const constants_1 = require("../constants");
|
|
10
10
|
const requestClient = create_request_client_1.default();
|
|
11
11
|
describe('LinkedIn Conversions', () => {
|
|
12
|
+
describe('conversionRule methods', () => {
|
|
13
|
+
const linkedIn = new api_1.LinkedInConversions(requestClient);
|
|
14
|
+
const adAccountId = 'urn:li:sponsoredAccount:123456';
|
|
15
|
+
const hookInputs = {
|
|
16
|
+
name: 'A different name that should trigger an update',
|
|
17
|
+
conversionType: 'PURCHASE',
|
|
18
|
+
attribution_type: 'LAST_TOUCH_BY_CAMPAIGN'
|
|
19
|
+
};
|
|
20
|
+
const hookOutputs = {
|
|
21
|
+
id: '56789',
|
|
22
|
+
name: 'The original name',
|
|
23
|
+
conversionType: 'LEAD',
|
|
24
|
+
attribution_type: 'LAST_TOUCH_BY_CONVERSION'
|
|
25
|
+
};
|
|
26
|
+
it('should update a conversion rule', async () => {
|
|
27
|
+
nock_1.default(`${constants_1.BASE_URL}`)
|
|
28
|
+
.post(`/conversions/${hookOutputs.id}`, {
|
|
29
|
+
patch: {
|
|
30
|
+
$set: {
|
|
31
|
+
name: hookInputs.name,
|
|
32
|
+
type: hookInputs.conversionType,
|
|
33
|
+
attributionType: hookInputs.attribution_type
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
.query({
|
|
38
|
+
account: adAccountId
|
|
39
|
+
})
|
|
40
|
+
.reply(204);
|
|
41
|
+
const updateResult = await linkedIn.updateConversionRule(adAccountId, hookInputs, hookOutputs);
|
|
42
|
+
expect(updateResult).toEqual({
|
|
43
|
+
successMessage: `Conversion rule ${hookOutputs.id} updated successfully!`,
|
|
44
|
+
savedData: {
|
|
45
|
+
id: hookOutputs.id,
|
|
46
|
+
name: hookInputs.name,
|
|
47
|
+
conversionType: hookInputs.conversionType,
|
|
48
|
+
attribution_type: hookInputs.attribution_type
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
it('should create a conversion rule', async () => {
|
|
53
|
+
const mockReturnedId = '12345';
|
|
54
|
+
nock_1.default(`${constants_1.BASE_URL}`)
|
|
55
|
+
.post(`/conversions`, {
|
|
56
|
+
name: hookInputs.name,
|
|
57
|
+
account: adAccountId,
|
|
58
|
+
conversionMethod: 'CONVERSIONS_API',
|
|
59
|
+
postClickAttributionWindowSize: 30,
|
|
60
|
+
viewThroughAttributionWindowSize: 7,
|
|
61
|
+
attributionType: hookInputs.attribution_type,
|
|
62
|
+
type: hookInputs.conversionType
|
|
63
|
+
})
|
|
64
|
+
.reply(201, {
|
|
65
|
+
id: mockReturnedId,
|
|
66
|
+
name: hookInputs.name,
|
|
67
|
+
type: hookInputs.conversionType
|
|
68
|
+
});
|
|
69
|
+
const createResult = await linkedIn.createConversionRule(adAccountId, hookInputs);
|
|
70
|
+
expect(createResult).toEqual({
|
|
71
|
+
successMessage: `Conversion rule ${mockReturnedId} created successfully!`,
|
|
72
|
+
savedData: {
|
|
73
|
+
id: mockReturnedId,
|
|
74
|
+
name: hookInputs.name,
|
|
75
|
+
conversionType: hookInputs.conversionType,
|
|
76
|
+
attribution_type: hookInputs.attribution_type
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
it('should use the existing conversionRuleId if passed in and not update anything', async () => {
|
|
81
|
+
const existingRule = {
|
|
82
|
+
id: '5678',
|
|
83
|
+
name: 'Exists already',
|
|
84
|
+
type: 'PURCHASE',
|
|
85
|
+
attributionType: 'LAST_TOUCH_BY_CAMPAIGN'
|
|
86
|
+
};
|
|
87
|
+
nock_1.default(`${constants_1.BASE_URL}`)
|
|
88
|
+
.get(`/conversions/${existingRule.id}`)
|
|
89
|
+
.query({ account: adAccountId })
|
|
90
|
+
.reply(200, existingRule);
|
|
91
|
+
const updateResult = await linkedIn.updateConversionRule(adAccountId, { ...hookInputs, conversionRuleId: existingRule.id }, hookOutputs);
|
|
92
|
+
expect(updateResult).toEqual({
|
|
93
|
+
successMessage: `Using existing Conversion Rule: ${existingRule.id} `,
|
|
94
|
+
savedData: {
|
|
95
|
+
id: existingRule.id,
|
|
96
|
+
name: existingRule.name,
|
|
97
|
+
conversionType: existingRule.type,
|
|
98
|
+
attribution_type: existingRule.attributionType
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
it('should pass back an error and the existing savedData if the update request fails', async () => {
|
|
103
|
+
nock_1.default(`${constants_1.BASE_URL}`)
|
|
104
|
+
.post(`/conversions/${hookOutputs.id}`, {
|
|
105
|
+
patch: {
|
|
106
|
+
$set: {
|
|
107
|
+
name: hookInputs.name,
|
|
108
|
+
type: hookInputs.conversionType,
|
|
109
|
+
attributionType: hookInputs.attribution_type
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
.query({
|
|
114
|
+
account: adAccountId
|
|
115
|
+
})
|
|
116
|
+
.reply(500);
|
|
117
|
+
const updateResult = await linkedIn.updateConversionRule(adAccountId, hookInputs, hookOutputs);
|
|
118
|
+
expect(updateResult).toEqual({
|
|
119
|
+
error: {
|
|
120
|
+
message: `Failed to update conversion rule: Internal Server Error`,
|
|
121
|
+
code: 'CONVERSION_RULE_UPDATE_FAILURE'
|
|
122
|
+
},
|
|
123
|
+
savedData: {
|
|
124
|
+
id: hookOutputs.id,
|
|
125
|
+
name: hookOutputs.name,
|
|
126
|
+
conversionType: hookOutputs.conversionType,
|
|
127
|
+
attribution_type: hookOutputs.attribution_type
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
12
132
|
describe('dynamicFields', () => {
|
|
13
133
|
const linkedIn = new api_1.LinkedInConversions(requestClient);
|
|
14
134
|
it('should fetch a list of ad accounts, with their names', async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.test.js","sourceRoot":"","sources":["../../../../src/destinations/linkedin-conversions/api/api.test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,0GAA+E;AAC/E,gCAA4C;AAC5C,4CAAuC;
|
|
1
|
+
{"version":3,"file":"api.test.js","sourceRoot":"","sources":["../../../../src/destinations/linkedin-conversions/api/api.test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,0GAA+E;AAC/E,gCAA4C;AAC5C,4CAAuC;AAGvC,MAAM,aAAa,GAAG,+BAAmB,EAAE,CAAA;AAE3C,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,MAAM,QAAQ,GAAwB,IAAI,yBAAmB,CAAC,aAAa,CAAC,CAAA;QAC5E,MAAM,WAAW,GAAG,gCAAgC,CAAA;QACpD,MAAM,UAAU,GAA0C;YACxD,IAAI,EAAE,gDAAgD;YACtD,cAAc,EAAE,UAAU;YAC1B,gBAAgB,EAAE,wBAAwB;SAC3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;YAEJ,MAAM,mBAAmB,GAAG,MAAM,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;YAChF,MAAM,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC;gBAClC,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,SAAS;qBACjB;iBACF;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -6,11 +6,14 @@ export declare class LinkedInConversions {
|
|
|
6
6
|
conversionRuleId?: string;
|
|
7
7
|
constructor(request: RequestClient, conversionRuleId?: string);
|
|
8
8
|
getProfile(): Promise<ModifiedResponse<ProfileAPIResponse>>;
|
|
9
|
-
|
|
9
|
+
getConversionRule: (adAccount: string, conversionRuleId: string) => Promise<ActionHookResponse<HookBundle['onMappingSave']['outputs']>>;
|
|
10
|
+
createConversionRule: (adAccount: string, hookInputs: HookBundle['onMappingSave']['inputs']) => Promise<ActionHookResponse<HookBundle['onMappingSave']['outputs']>>;
|
|
11
|
+
updateConversionRule: (adAccount: string, hookInputs: HookBundle['onMappingSave']['inputs'], hookOutputs: HookBundle['onMappingSave']['outputs']) => Promise<ActionHookResponse<HookBundle['onMappingSave']['outputs']>>;
|
|
10
12
|
getAdAccounts: () => Promise<DynamicFieldResponse>;
|
|
11
13
|
getConversionRulesList: (adAccountId: string) => Promise<DynamicFieldResponse>;
|
|
12
14
|
getCampaignsList: (adAccountUrn: string) => Promise<DynamicFieldResponse>;
|
|
13
15
|
streamConversionEvent(payload: Payload, conversionTime: number): Promise<ModifiedResponse>;
|
|
14
16
|
bulkAssociateCampaignToConversion(campaignIds: string[]): Promise<ModifiedResponse>;
|
|
15
17
|
associateCampignToConversion(campaignId: string): Promise<ModifiedResponse>;
|
|
18
|
+
private conversionRuleValuesUpdated;
|
|
16
19
|
}
|