@segment/action-destinations 3.131.1-ga4-cloud.12 → 3.131.1-gads-test.19
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/algolia-insights/algolia-insight-api.d.ts +26 -0
- package/dist/destinations/algolia-insights/algolia-insight-api.js +8 -0
- package/dist/destinations/algolia-insights/algolia-insight-api.js.map +1 -0
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.d.ts +9 -0
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.d.ts +6 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.js +83 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -0
- package/dist/destinations/algolia-insights/generated-types.d.ts +4 -0
- package/dist/destinations/algolia-insights/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/index.d.ts +5 -0
- package/dist/destinations/algolia-insights/index.js +54 -0
- package/dist/destinations/algolia-insights/index.js.map +1 -0
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.d.ts +8 -0
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/productClickedEvents/index.d.ts +6 -0
- package/dist/destinations/algolia-insights/productClickedEvents/index.js +91 -0
- package/dist/destinations/algolia-insights/productClickedEvents/index.js.map +1 -0
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.d.ts +7 -0
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/productViewedEvents/index.d.ts +6 -0
- package/dist/destinations/algolia-insights/productViewedEvents/index.js +81 -0
- package/dist/destinations/algolia-insights/productViewedEvents/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.d.ts +20 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.js +133 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.d.ts +2 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.js +6 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.d.ts +80 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.js +151 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.d.ts +35 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.js +3 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.d.ts +5 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js +619 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.d.ts +3 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.js +3 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.d.ts +4 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.js +53 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.d.ts +67 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.js +3 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +8 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js +44 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js.map +1 -0
- package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +3 -10
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/addToCart/index.js +3 -10
- package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/addToWishlist/index.js +3 -10
- package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/beginCheckout/index.js +3 -10
- package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/customEvent/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/customEvent/index.js +3 -10
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.d.ts +0 -3
- package/dist/destinations/google-analytics-4/ga4-functions.js +1 -31
- package/dist/destinations/google-analytics-4/ga4-functions.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-properties.d.ts +0 -2
- package/dist/destinations/google-analytics-4/ga4-properties.js +3 -17
- package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-types.d.ts +0 -14
- package/dist/destinations/google-analytics-4/ga4-types.js +0 -6
- package/dist/destinations/google-analytics-4/ga4-types.js.map +1 -1
- package/dist/destinations/google-analytics-4/generateLead/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/generateLead/index.js +3 -10
- package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/generated-types.d.ts +1 -2
- package/dist/destinations/google-analytics-4/index.js +10 -15
- package/dist/destinations/google-analytics-4/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/login/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/login/index.js +3 -10
- package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/pageView/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/pageView/index.js +3 -10
- package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/purchase/index.js +3 -10
- package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/refund/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/refund/index.js +3 -10
- package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/removeFromCart/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/removeFromCart/index.js +3 -10
- package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/search/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/search/index.js +3 -10
- package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/selectItem/index.js +3 -10
- package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/selectPromotion/index.js +3 -10
- package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/signUp/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/signUp/index.js +3 -10
- package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewCart/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/viewCart/index.js +3 -10
- package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/viewItem/index.js +3 -10
- package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItemList/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/viewItemList/index.js +3 -10
- package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/viewPromotion/index.js +3 -10
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/functions.d.ts +2 -1
- package/dist/destinations/google-enhanced-conversions/functions.js +2 -2
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/types.d.ts +2 -1
- package/dist/destinations/google-enhanced-conversions/types.js +8 -2
- package/dist/destinations/google-enhanced-conversions/types.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +3 -3
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +3 -3
- 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/heap/flat.d.ts +1 -2
- package/dist/destinations/heap/flat.js +11 -1
- package/dist/destinations/heap/flat.js.map +1 -1
- package/dist/destinations/heap/heapUtils.d.ts +8 -0
- package/dist/destinations/heap/heapUtils.js +41 -0
- package/dist/destinations/heap/heapUtils.js.map +1 -0
- package/dist/destinations/heap/trackEvent/generated-types.d.ts +0 -1
- package/dist/destinations/heap/trackEvent/index.js +18 -54
- package/dist/destinations/heap/trackEvent/index.js.map +1 -1
- package/dist/destinations/launchpad/generated-types.d.ts +5 -0
- package/dist/destinations/launchpad/generated-types.js +3 -0
- package/dist/destinations/launchpad/generated-types.js.map +1 -0
- package/dist/destinations/launchpad/groupIdentifyUser/generated-types.d.ts +9 -0
- package/dist/destinations/launchpad/groupIdentifyUser/generated-types.js +3 -0
- package/dist/destinations/launchpad/groupIdentifyUser/generated-types.js.map +1 -0
- package/dist/destinations/launchpad/groupIdentifyUser/index.d.ts +5 -0
- package/dist/destinations/launchpad/groupIdentifyUser/index.js +79 -0
- package/dist/destinations/launchpad/groupIdentifyUser/index.js.map +1 -0
- package/dist/destinations/launchpad/identifyUser/generated-types.d.ts +8 -0
- package/dist/destinations/launchpad/identifyUser/generated-types.js +3 -0
- package/dist/destinations/launchpad/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/launchpad/identifyUser/index.d.ts +5 -0
- package/dist/destinations/launchpad/identifyUser/index.js +79 -0
- package/dist/destinations/launchpad/identifyUser/index.js.map +1 -0
- package/dist/destinations/launchpad/index.d.ts +4 -0
- package/dist/destinations/launchpad/index.js +96 -0
- package/dist/destinations/launchpad/index.js.map +1 -0
- package/dist/destinations/launchpad/launchpad-types.d.ts +28 -0
- package/dist/destinations/launchpad/launchpad-types.js +3 -0
- package/dist/destinations/launchpad/launchpad-types.js.map +1 -0
- package/dist/destinations/launchpad/trackEvent/generated-types.d.ts +18 -0
- package/dist/destinations/launchpad/trackEvent/generated-types.js +3 -0
- package/dist/destinations/launchpad/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/launchpad/trackEvent/index.d.ts +5 -0
- package/dist/destinations/launchpad/trackEvent/index.js +62 -0
- package/dist/destinations/launchpad/trackEvent/index.js.map +1 -0
- package/dist/destinations/launchpad/trackEvent/launchpad-properties.d.ts +2 -0
- package/dist/destinations/launchpad/trackEvent/launchpad-properties.js +87 -0
- package/dist/destinations/launchpad/trackEvent/launchpad-properties.js.map +1 -0
- package/dist/destinations/launchpad/utils.d.ts +6 -0
- package/dist/destinations/launchpad/utils.js +20 -0
- package/dist/destinations/launchpad/utils.js.map +1 -0
- package/dist/destinations/livelike-cloud/generated-types.d.ts +4 -0
- package/dist/destinations/livelike-cloud/generated-types.js +3 -0
- package/dist/destinations/livelike-cloud/generated-types.js.map +1 -0
- package/dist/destinations/livelike-cloud/index.d.ts +4 -0
- package/dist/destinations/livelike-cloud/index.js +84 -0
- package/dist/destinations/livelike-cloud/index.js.map +1 -0
- package/dist/destinations/livelike-cloud/properties.d.ts +1 -0
- package/dist/destinations/livelike-cloud/properties.js +5 -0
- package/dist/destinations/livelike-cloud/properties.js.map +1 -0
- package/dist/destinations/livelike-cloud/trackEvent/generated-types.d.ts +11 -0
- package/dist/destinations/livelike-cloud/trackEvent/generated-types.js +3 -0
- package/dist/destinations/livelike-cloud/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/livelike-cloud/trackEvent/index.d.ts +5 -0
- package/dist/destinations/livelike-cloud/trackEvent/index.js +101 -0
- package/dist/destinations/livelike-cloud/trackEvent/index.js.map +1 -0
- package/dist/destinations/pinterest-conversions/generated-types.d.ts +4 -0
- package/dist/destinations/pinterest-conversions/generated-types.js +3 -0
- package/dist/destinations/pinterest-conversions/generated-types.js.map +1 -0
- package/dist/destinations/pinterest-conversions/index.d.ts +4 -0
- package/dist/destinations/pinterest-conversions/index.js +29 -0
- package/dist/destinations/pinterest-conversions/index.js.map +1 -0
- package/dist/destinations/twilio-studio/generated-types.d.ts +6 -0
- package/dist/destinations/twilio-studio/generated-types.js +3 -0
- package/dist/destinations/twilio-studio/generated-types.js.map +1 -0
- package/dist/destinations/twilio-studio/index.d.ts +4 -0
- package/dist/destinations/twilio-studio/index.js +55 -0
- package/dist/destinations/twilio-studio/index.js.map +1 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.d.ts +8 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.js +3 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.js.map +1 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.d.ts +5 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.js +84 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.js.map +1 -0
- package/dist/destinations/twilio-studio/utils.d.ts +29 -0
- package/dist/destinations/twilio-studio/utils.js +43 -0
- package/dist/destinations/twilio-studio/utils.js.map +1 -0
- package/dist/destinations/vwo/identifyUser/index.js +6 -6
- package/dist/destinations/vwo/identifyUser/index.js.map +1 -1
- package/dist/destinations/vwo/index.js +1 -1
- package/dist/destinations/vwo/index.js.map +1 -1
- package/dist/destinations/vwo/pageVisit/index.js +6 -6
- package/dist/destinations/vwo/pageVisit/index.js.map +1 -1
- package/dist/destinations/vwo/trackEvent/index.js +7 -7
- package/dist/destinations/vwo/trackEvent/index.js.map +1 -1
- package/dist/destinations/vwo/utility.js +2 -2
- package/package.json +4 -4
|
@@ -0,0 +1,96 @@
|
|
|
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 trackEvent_1 = __importDefault(require("./trackEvent"));
|
|
8
|
+
const identifyUser_1 = __importDefault(require("./identifyUser"));
|
|
9
|
+
const groupIdentifyUser_1 = __importDefault(require("./groupIdentifyUser"));
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
const presets = [
|
|
12
|
+
{
|
|
13
|
+
name: 'Track Calls',
|
|
14
|
+
subscribe: 'type = "track" and event != "Order Completed"',
|
|
15
|
+
partnerAction: 'trackEvent',
|
|
16
|
+
mapping: actions_core_1.defaultValues(trackEvent_1.default.fields)
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'Page Calls',
|
|
20
|
+
subscribe: 'type = "page"',
|
|
21
|
+
partnerAction: 'trackEvent',
|
|
22
|
+
mapping: {
|
|
23
|
+
...actions_core_1.defaultValues(trackEvent_1.default.fields),
|
|
24
|
+
event: {
|
|
25
|
+
'@template': 'Viewed {{name}}'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Screen Calls',
|
|
31
|
+
subscribe: 'type = "screen"',
|
|
32
|
+
partnerAction: 'trackEvent',
|
|
33
|
+
mapping: {
|
|
34
|
+
...actions_core_1.defaultValues(trackEvent_1.default.fields),
|
|
35
|
+
event: {
|
|
36
|
+
'@template': 'Viewed {{name}}'
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Identify Calls',
|
|
42
|
+
subscribe: 'type = "identify"',
|
|
43
|
+
partnerAction: 'identifyUser',
|
|
44
|
+
mapping: actions_core_1.defaultValues(identifyUser_1.default.fields)
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Group Calls',
|
|
48
|
+
subscribe: 'type = "group"',
|
|
49
|
+
partnerAction: 'groupIdentifyUser',
|
|
50
|
+
mapping: actions_core_1.defaultValues(groupIdentifyUser_1.default.fields)
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
const destination = {
|
|
54
|
+
name: 'Launchpad (Actions)',
|
|
55
|
+
slug: 'actions-launchpad',
|
|
56
|
+
mode: 'cloud',
|
|
57
|
+
authentication: {
|
|
58
|
+
scheme: 'custom',
|
|
59
|
+
fields: {
|
|
60
|
+
apiSecret: {
|
|
61
|
+
label: 'Secret Key',
|
|
62
|
+
description: 'Launchpad project secret. You can find that in the settings in your Launchpad.pm account.',
|
|
63
|
+
type: 'password',
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
apiRegion: {
|
|
67
|
+
label: 'Data Residency',
|
|
68
|
+
description: 'Learn about [EU data residency](https://help.launchpad.pm).',
|
|
69
|
+
type: 'string',
|
|
70
|
+
choices: Object.values(utils_1.ApiRegions).map((apiRegion) => ({ label: apiRegion, value: apiRegion })),
|
|
71
|
+
default: utils_1.ApiRegions.US
|
|
72
|
+
},
|
|
73
|
+
sourceName: {
|
|
74
|
+
label: 'Source Name',
|
|
75
|
+
description: "This value, if it's not blank, will be sent as segment_source_name to Launchpad for every event/page/screen call.",
|
|
76
|
+
type: 'string'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
testAuthentication: (request, { settings }) => {
|
|
80
|
+
return request(`https://backend.launchpad.pm/api/data/validate-project-credentials/`, {
|
|
81
|
+
method: 'post',
|
|
82
|
+
body: JSON.stringify({
|
|
83
|
+
api_secret: settings.apiSecret
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
presets,
|
|
89
|
+
actions: {
|
|
90
|
+
trackEvent: trackEvent_1.default,
|
|
91
|
+
identifyUser: identifyUser_1.default,
|
|
92
|
+
groupIdentifyUser: groupIdentifyUser_1.default
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.default = destination;
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/launchpad/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AAGrD,8DAAqC;AACrC,kEAAyC;AACzC,4EAAmD;AAEnD,mCAAoC;AAGpC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,+CAA+C;QAC1D,aAAa,EAAE,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AAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;gBAC/F,OAAO,EAAE,kBAAU,CAAC,EAAE;aACvB;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,aAAa;gBACpB,WAAW,EACT,mHAAmH;gBACrH,IAAI,EAAE,QAAQ;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5C,OAAO,OAAO,CAAC,qEAAqE,EAAE;gBACpF,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,UAAU,EAAE,QAAQ,CAAC,SAAS;iBAC/B,CAAC;aACH,CAAC,CAAA;QACJ,CAAC;KACF;IACD,OAAO;IACP,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;QACZ,iBAAiB,EAAjB,2BAAiB;KAClB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare type LaunchpadEventProperties = {
|
|
2
|
+
anonymous_id?: string;
|
|
3
|
+
browser_version?: string;
|
|
4
|
+
browser?: string;
|
|
5
|
+
current_url?: string;
|
|
6
|
+
device?: string;
|
|
7
|
+
group_id?: string;
|
|
8
|
+
identified_id?: string;
|
|
9
|
+
messageId?: string;
|
|
10
|
+
ip?: string | unknown;
|
|
11
|
+
os_version?: string;
|
|
12
|
+
os?: string;
|
|
13
|
+
referrer?: string;
|
|
14
|
+
user_id?: string;
|
|
15
|
+
source: string;
|
|
16
|
+
distinct_id: string | undefined;
|
|
17
|
+
id?: string | null;
|
|
18
|
+
segment_source_name?: string;
|
|
19
|
+
time?: string | number | undefined;
|
|
20
|
+
properties?: [k: string] | unknown;
|
|
21
|
+
traits?: [k: string] | unknown;
|
|
22
|
+
context?: [k: string] | unknown;
|
|
23
|
+
};
|
|
24
|
+
export declare type LaunchpadEvent = {
|
|
25
|
+
event?: string;
|
|
26
|
+
properties?: LaunchpadEventProperties;
|
|
27
|
+
api_key: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launchpad-types.js","sourceRoot":"","sources":["../../../src/destinations/launchpad/launchpad-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event: string;
|
|
3
|
+
userId?: string;
|
|
4
|
+
anonymousId?: string;
|
|
5
|
+
groupId?: string;
|
|
6
|
+
messageId: string;
|
|
7
|
+
timestamp: string | number;
|
|
8
|
+
properties?: {
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
traits?: {
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
context?: {
|
|
15
|
+
[k: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
enable_batching?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/launchpad/trackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const launchpad_properties_1 = require("./launchpad-properties");
|
|
5
|
+
function getEventProperties(payload, settings) {
|
|
6
|
+
const integration = payload.context?.integration;
|
|
7
|
+
return {
|
|
8
|
+
time: payload.timestamp,
|
|
9
|
+
ip: payload.context?.ip,
|
|
10
|
+
anonymous_id: payload.anonymousId,
|
|
11
|
+
distinct_id: payload.userId ? payload.userId : payload.anonymousId,
|
|
12
|
+
context: payload.context,
|
|
13
|
+
group_id: payload.groupId,
|
|
14
|
+
properties: payload.properties,
|
|
15
|
+
traits: payload.traits ? payload.traits : payload.context?.traits,
|
|
16
|
+
messageId: payload.messageId,
|
|
17
|
+
source: integration?.name != 'Segment' ? integration?.name : 'Segment',
|
|
18
|
+
user_id: payload.userId,
|
|
19
|
+
segment_source_name: settings.sourceName
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const getEventFromPayload = (payload, settings) => {
|
|
23
|
+
const event = {
|
|
24
|
+
event: payload.event,
|
|
25
|
+
properties: {
|
|
26
|
+
...getEventProperties(payload, settings)
|
|
27
|
+
},
|
|
28
|
+
api_key: settings.apiSecret
|
|
29
|
+
};
|
|
30
|
+
return event;
|
|
31
|
+
};
|
|
32
|
+
const processData = async (request, settings, payload) => {
|
|
33
|
+
const event = getEventFromPayload(payload, settings);
|
|
34
|
+
const urlAddendum = 'capture';
|
|
35
|
+
const requestURL = `${utils_1.getApiServerUrl(settings.apiRegion)}` + urlAddendum;
|
|
36
|
+
return request(requestURL, {
|
|
37
|
+
method: 'post',
|
|
38
|
+
json: event
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const trackEvent = {
|
|
42
|
+
title: 'Track Event',
|
|
43
|
+
description: 'Send an event to Launchpad. [Learn more about Events in Launchpad](https://help.launchpad.pm)',
|
|
44
|
+
defaultSubscription: 'type = "track"',
|
|
45
|
+
fields: {
|
|
46
|
+
event: {
|
|
47
|
+
label: 'Event Name',
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'The name of the action being performed.',
|
|
50
|
+
required: true,
|
|
51
|
+
default: {
|
|
52
|
+
'@path': '$.event'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
...launchpad_properties_1.eventProperties
|
|
56
|
+
},
|
|
57
|
+
perform: async (request, { settings, payload }) => {
|
|
58
|
+
return processData(request, settings, payload);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.default = trackEvent;
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sour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AK,EAAE,OAAsB,EAAE,QAAkB,EAAE,OAAgB,EAAE,EAAE;IACzF,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACpD,MAAM,WAAW,GAAG,SAAS,CAAA;IAE7B,MAAM,UAAU,GAAW,GAAG,uBAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,WAAW,CAAA;IAEjF,OAAO,OAAO,CAAC,UAAU,EAAE;QACzB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;KACZ,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,UAAU,GAAwC;IACtD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,+FAA+F;IAC5G,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,GAAG,sCAAe;KACnB;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;CACF,CAAA;AAED,kBAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.eventProperties = void 0;
|
|
4
|
+
exports.eventProperties = {
|
|
5
|
+
userId: {
|
|
6
|
+
label: 'User ID',
|
|
7
|
+
type: 'string',
|
|
8
|
+
description: 'A unique ID for a known user. This will be used as the Distinct ID. This field is required if the Anonymous ID field is empty',
|
|
9
|
+
default: {
|
|
10
|
+
'@path': '$.userId'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
anonymousId: {
|
|
14
|
+
label: 'Anonymous ID',
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'A unique ID for an anonymous user. This will be used as the Distinct ID if the User ID field is empty. This field is required if the User ID field is empty',
|
|
17
|
+
default: {
|
|
18
|
+
'@path': '$.anonymousId'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
groupId: {
|
|
22
|
+
label: 'Group ID',
|
|
23
|
+
type: 'string',
|
|
24
|
+
required: false,
|
|
25
|
+
description: 'The unique identifier of the group that performed this event.',
|
|
26
|
+
default: {
|
|
27
|
+
'@path': '$.context.groupId'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
messageId: {
|
|
31
|
+
label: 'Insert ID',
|
|
32
|
+
type: 'string',
|
|
33
|
+
required: true,
|
|
34
|
+
description: 'A random id that is unique to an event. Launchpad uses $insert_id to deduplicate events.',
|
|
35
|
+
default: {
|
|
36
|
+
'@path': '$.messageId'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
timestamp: {
|
|
40
|
+
label: 'Timestamp',
|
|
41
|
+
type: 'datetime',
|
|
42
|
+
required: true,
|
|
43
|
+
description: 'The timestamp of the event. Launchpad expects epoch timestamp in millisecond or second. Please note, Launchpad only accepts this field as the timestamp. If the field is empty, it will be set to the time Launchpad servers receive it.',
|
|
44
|
+
default: {
|
|
45
|
+
'@path': '$.timestamp'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
properties: {
|
|
49
|
+
required: false,
|
|
50
|
+
label: 'Event Properties',
|
|
51
|
+
type: 'object',
|
|
52
|
+
description: 'An object of key-value pairs that represent additional data to be sent along with the event.',
|
|
53
|
+
default: {
|
|
54
|
+
'@path': '$.properties'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
traits: {
|
|
58
|
+
required: false,
|
|
59
|
+
label: 'User Properties',
|
|
60
|
+
type: 'object',
|
|
61
|
+
description: 'An object of key-value pairs that represent additional data tied to the user. This is used for segmentation within the platform.',
|
|
62
|
+
default: {
|
|
63
|
+
'@if': {
|
|
64
|
+
exists: { '@path': '$.traits' },
|
|
65
|
+
then: { '@path': '$.traits' },
|
|
66
|
+
else: { '@path': '$.context.traits' }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
context: {
|
|
71
|
+
label: 'Event context',
|
|
72
|
+
required: false,
|
|
73
|
+
description: 'An object of key-value pairs that provides useful context about the event.',
|
|
74
|
+
type: 'object',
|
|
75
|
+
default: {
|
|
76
|
+
'@path': '$.context'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
enable_batching: {
|
|
80
|
+
required: false,
|
|
81
|
+
type: 'boolean',
|
|
82
|
+
label: 'Batch Data to Launchpad',
|
|
83
|
+
description: 'Set as true to ensure Segment sends data to Launchpad in batches.',
|
|
84
|
+
default: true
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=launchpad-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launchpad-properties.js","sourceRoot":"","sources":["../../../../src/destinations/launchpad/trackEvent/launchpad-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAA+B;IACzD,MAAM,EAAE;QACN,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,+HAA+H;QACjI,OAAO,EAAE;YACP,OAAO,EAAE,UAAU;SACpB;KACF;IACD,WAAW,EAAE;QACX,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,6JAA6J;QAC/J,OAAO,EAAE;YACP,OAAO,EAAE,eAAe;SACzB;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,+DAA+D;QAC5E,OAAO,EAAE;YACP,OAAO,EAAE,mBAAmB;SAC7B;KACF;IACD,SAAS,EAAE;QACT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+
EU = "EU \uD83C\uDDEA\uD83C\uDDFA"
|
|
4
|
+
}
|
|
5
|
+
export declare function getConcatenatedName(firstName: unknown, lastName: unknown, name: unknown): unknown;
|
|
6
|
+
export declare function getApiServerUrl(apiRegion: string | unknown): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getApiServerUrl = exports.getConcatenatedName = exports.ApiRegions = void 0;
|
|
4
|
+
var ApiRegions;
|
|
5
|
+
(function (ApiRegions) {
|
|
6
|
+
ApiRegions["US"] = "US \uD83C\uDDFA\uD83C\uDDF8";
|
|
7
|
+
ApiRegions["EU"] = "EU \uD83C\uDDEA\uD83C\uDDFA";
|
|
8
|
+
})(ApiRegions = exports.ApiRegions || (exports.ApiRegions = {}));
|
|
9
|
+
function getConcatenatedName(firstName, lastName, name) {
|
|
10
|
+
return name ?? (firstName && lastName ? `${firstName} ${lastName}` : undefined);
|
|
11
|
+
}
|
|
12
|
+
exports.getConcatenatedName = getConcatenatedName;
|
|
13
|
+
function getApiServerUrl(apiRegion) {
|
|
14
|
+
if (apiRegion == ApiRegions.EU) {
|
|
15
|
+
return 'https://data.launchpad.pm/';
|
|
16
|
+
}
|
|
17
|
+
return 'https://data.launchpad.pm/';
|
|
18
|
+
}
|
|
19
|
+
exports.getApiServerUrl = getApiServerUrl;
|
|
20
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/launchpad/utils.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,gDAAc,CAAA;IACd,gDAAc,CAAA;AAChB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAOD,SAAgB,mBAAmB,CAAC,SAAkB,EAAE,QAAiB,EAAE,IAAa;IACtF,OAAO,IAAI,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AACjF,CAAC;AAFD,kDAEC;AAED,SAAgB,eAAe,CAAC,SAA2B;IACzD,IAAI,SAAS,IAAI,UAAU,CAAC,EAAE,EAAE;QAC9B,OAAO,4BAA4B,CAAA;KACpC;IACD,OAAO,4BAA4B,CAAA;AACrC,CAAC;AALD,0CAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/livelike-cloud/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,84 @@
|
|
|
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 properties_1 = require("./properties");
|
|
8
|
+
const trackEvent_1 = __importDefault(require("./trackEvent"));
|
|
9
|
+
const presets = [
|
|
10
|
+
{
|
|
11
|
+
name: 'Track User Actions',
|
|
12
|
+
subscribe: 'type = "track"',
|
|
13
|
+
partnerAction: 'trackEvent',
|
|
14
|
+
mapping: actions_core_1.defaultValues(trackEvent_1.default.fields)
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'Page Calls',
|
|
18
|
+
subscribe: 'type = "page"',
|
|
19
|
+
partnerAction: 'trackEvent',
|
|
20
|
+
mapping: {
|
|
21
|
+
...actions_core_1.defaultValues(trackEvent_1.default.fields),
|
|
22
|
+
action_name: {
|
|
23
|
+
'@if': {
|
|
24
|
+
exists: { '@path': '$.properties.action_name' },
|
|
25
|
+
then: { '@path': '$.properties.action_name' },
|
|
26
|
+
else: { '@path': '$.properties.title' }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Screen Calls',
|
|
33
|
+
subscribe: 'type = "screen"',
|
|
34
|
+
partnerAction: 'trackEvent',
|
|
35
|
+
mapping: {
|
|
36
|
+
...actions_core_1.defaultValues(trackEvent_1.default.fields),
|
|
37
|
+
action_name: {
|
|
38
|
+
'@if': {
|
|
39
|
+
exists: { '@path': '$.properties.action_name' },
|
|
40
|
+
then: { '@path': '$.properties.action_name' },
|
|
41
|
+
else: { '@path': '$.properties.title' }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
const destination = {
|
|
48
|
+
name: 'LiveLike',
|
|
49
|
+
slug: 'actions-livelike-cloud',
|
|
50
|
+
mode: 'cloud',
|
|
51
|
+
authentication: {
|
|
52
|
+
scheme: 'custom',
|
|
53
|
+
fields: {
|
|
54
|
+
clientId: {
|
|
55
|
+
label: 'Client ID',
|
|
56
|
+
description: 'Your LiveLike Application Client ID.',
|
|
57
|
+
type: 'string',
|
|
58
|
+
required: true
|
|
59
|
+
},
|
|
60
|
+
producerToken: {
|
|
61
|
+
label: 'Producer Token',
|
|
62
|
+
description: 'Your LiveLike Producer token.',
|
|
63
|
+
type: 'password',
|
|
64
|
+
required: true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
testAuthentication: async (request, { settings }) => {
|
|
68
|
+
return request(`${properties_1.apiBaseUrl}/applications/${settings.clientId}/validate-app/`, {
|
|
69
|
+
method: 'get'
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
extendRequest: ({ settings }) => {
|
|
74
|
+
return {
|
|
75
|
+
headers: { Authorization: `Bearer ${settings.producerToken}` }
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
presets,
|
|
79
|
+
actions: {
|
|
80
|
+
trackEvent: trackEvent_1.default
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.default = destination;
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/livelike-cloud/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,6CAAyC;AAEzC,8DAAqC;AAErC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,oBAAoB;QAC1B,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;YACnC,WAAW,EAAE;gBACX,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC/C,IAAI,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;iBACxC;aACF;SACF;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,iBAAiB;QAC5B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;YACnC,WAAW,EAAE;gBACX,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC/C,IAAI,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;iBACxC;aACF;SACF;KACF;CACF,CAAA;AAED,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,sCAAsC;gBACnD,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,OAAO,OAAO,CAAC,GAAG,uBAAU,iBAAiB,QAAQ,CAAC,QAAQ,gBAAgB,EAAE;gBAC9E,MAAM,EAAE,KAAK;aACd,CAAC,CAAA;QACJ,CAAC;KACF;IACD,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,QAAQ,CAAC,aAAa,EAAE,EAAE;SAC/D,CAAA;IACH,CAAC;IACD,OAAO;IACP,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;KACX;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const apiBaseUrl = "https://cf-blast-iconic.livelikecdn.com/api/v1";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/livelike-cloud/properties.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,gDAAgD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/livelike-cloud/trackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const properties_1 = require("../properties");
|
|
5
|
+
const processData = async (request, settings, payloads) => {
|
|
6
|
+
const events = payloads.map((payload) => {
|
|
7
|
+
if (!payload.livelike_profile_id && !payload.user_id) {
|
|
8
|
+
throw new actions_core_1.IntegrationError('`livelike_profile_id` or `user_id` is required.', 'Missing required fields', 400);
|
|
9
|
+
}
|
|
10
|
+
return payload;
|
|
11
|
+
});
|
|
12
|
+
return request(`${properties_1.apiBaseUrl}/applications/${settings.clientId}/segment-events/`, {
|
|
13
|
+
method: 'post',
|
|
14
|
+
json: {
|
|
15
|
+
events
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const action = {
|
|
20
|
+
title: 'Track Event',
|
|
21
|
+
description: 'Send an event to LiveLike.',
|
|
22
|
+
defaultSubscription: 'type = "track"',
|
|
23
|
+
fields: {
|
|
24
|
+
action_key: {
|
|
25
|
+
label: 'Action Key',
|
|
26
|
+
description: 'The unique key of Action. LiveLike will uniquely identify any event by this key.',
|
|
27
|
+
type: 'string',
|
|
28
|
+
required: true,
|
|
29
|
+
default: {
|
|
30
|
+
'@path': '$.properties.action_key'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
action_name: {
|
|
34
|
+
label: 'Action Name',
|
|
35
|
+
description: 'The name of the action being performed.',
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: {
|
|
38
|
+
'@if': {
|
|
39
|
+
exists: { '@path': '$.properties.action_name' },
|
|
40
|
+
then: { '@path': '$.properties.action_name' },
|
|
41
|
+
else: { '@path': '$.event' }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
action_description: {
|
|
46
|
+
label: 'Action Description',
|
|
47
|
+
description: 'The description of the Action.',
|
|
48
|
+
type: 'string',
|
|
49
|
+
default: {
|
|
50
|
+
'@path': '$.properties.action_description'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
user_id: {
|
|
54
|
+
label: 'User ID',
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'A unique identifier for a user. At least one of `User ID` or `LiveLike User Profile ID` is mandatory.',
|
|
57
|
+
default: {
|
|
58
|
+
'@path': '$.userId'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
livelike_profile_id: {
|
|
62
|
+
label: 'LiveLike User Profile ID',
|
|
63
|
+
description: 'The unique LiveLike user identifier. Atleast one of `LiveLike User Profile ID` or `User ID` is mandatory.',
|
|
64
|
+
type: 'string',
|
|
65
|
+
default: {
|
|
66
|
+
'@path': '$.properties.livelike_profile_id'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
timestamp: {
|
|
70
|
+
label: 'Timestamp',
|
|
71
|
+
description: 'The timestamp of the event.',
|
|
72
|
+
type: 'datetime',
|
|
73
|
+
required: true,
|
|
74
|
+
default: {
|
|
75
|
+
'@path': '$.timestamp'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
properties: {
|
|
79
|
+
label: 'Event Properties',
|
|
80
|
+
description: 'Properties of the event.',
|
|
81
|
+
type: 'object',
|
|
82
|
+
default: {
|
|
83
|
+
'@path': '$.properties'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
perform: (request, { payload, settings }) => {
|
|
88
|
+
if (!settings.clientId || !settings.producerToken) {
|
|
89
|
+
throw new actions_core_1.IntegrationError('Missing client ID or producer token.');
|
|
90
|
+
}
|
|
91
|
+
return processData(request, settings, [payload]);
|
|
92
|
+
},
|
|
93
|
+
performBatch: async (request, { settings, payload }) => {
|
|
94
|
+
if (!settings.clientId || !settings.producerToken) {
|
|
95
|
+
throw new actions_core_1.IntegrationError('Missing client ID or producer token.');
|
|
96
|
+
}
|
|
97
|
+
return processData(request, settings, payload);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
exports.default = action;
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/livelike-cloud/trackEvent/index.ts"],"names":[],"mappings":";;AAAA,wDAAyF;AAEzF,8CAA0C;AAG1C,MAAM,WAAW,GAAG,KAAK,EAAE,OAAsB,EAAE,QAAkB,EAAE,QAAmB,EAAE,EAAE;IAC5F,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACtC,IAAI,CAAC,OAAO,CAAC,mBAAmB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpD,MAAM,IAAI,+BAAgB,CAAC,iDAAiD,EAAE,yBAAyB,EAAE,GAAG,CAAC,CAAA;SAC9G;QACD,OAAO,OAAO,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC,GAAG,uBAAU,iBAAiB,QAAQ,CAAC,QAAQ,kBAAkB,EAAE;QAChF,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,MAAM;SACP;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,4BAA4B;IACzC,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,kFAAkF;YAC/F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC/C,IAAI,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,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QAAQ,CAAC,aAAa,EAAE;YACjD,MAAM,IAAI,+BAAgB,CAAC,sCAAsC,CAAC,CAAA;SACnE;QACD,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/pinterest-conversions/generated-types.ts"],"names":[],"mappings":""}
|