@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
|
@@ -58,7 +58,7 @@ const action = {
|
|
|
58
58
|
defaultObjectUI: 'keyvalue:only'
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
perform: async (request, { auth, settings, payload }) => {
|
|
61
|
+
perform: async (request, { auth, settings, payload, features }) => {
|
|
62
62
|
if (!settings.customerId) {
|
|
63
63
|
throw new actions_core_1.IntegrationError('Customer ID is required for this action. Please set it in destination settings.', 'Missing required fields.', 400);
|
|
64
64
|
}
|
|
@@ -72,10 +72,10 @@ const action = {
|
|
|
72
72
|
currencyCode: payload.currency
|
|
73
73
|
};
|
|
74
74
|
if (payload.custom_variables) {
|
|
75
|
-
const customVariableIds = await functions_1.getCustomVariables(settings.customerId, auth, request);
|
|
75
|
+
const customVariableIds = await functions_1.getCustomVariables(settings.customerId, auth, request, features);
|
|
76
76
|
request_object.customVariables = functions_1.formatCustomVariables(payload.custom_variables, customVariableIds.data[0].results);
|
|
77
77
|
}
|
|
78
|
-
const response = await request(`${types_1.
|
|
78
|
+
const response = await request(`${types_1.getUrlByVersion(features)}/${settings.customerId}:uploadCallConversions`, {
|
|
79
79
|
method: 'post',
|
|
80
80
|
headers: {
|
|
81
81
|
'developer-token': `${process.env.ADWORDS_DEVELOPER_TOKEN}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadCallConversion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,4CAA8G;AAC9G,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadCallConversion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,4CAA8G;AAC9G,oCAAgE;AAGhE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,0DAA0D;IACvE,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,sUAAsU;YACxU,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,wIAAwI;YAC1I,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,0JAA0J;YAC5J,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,oBAAoB,EAAE;YACpB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,8LAA8L;YAChM,IAAI,EAAE,QAAQ;YACd,QAAQ,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AAC,gBAAgB,EAAE;YAC5B,MAAM,iBAAiB,GAAG,MAAM,8BAAkB,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;YAChG,cAAc,CAAC,eAAe,GAAG,iCAAqB,CACpD,OAAO,CAAC,gBAAgB,EACxB,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAClC,CAAA;SACF;QACD,MAAM,QAAQ,GAA2C,MAAM,OAAO,CACpE,GAAG,uBAAe,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,UAAU,wBAAwB,EAC3E;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,iBAAiB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;aAC5D;YACD,IAAI,EAAE;gBACJ,WAAW,EAAE,CAAC,cAAc,CAAC;gBAC7B,cAAc,EAAE,IAAI;aACrB;SACF,CACF,CAAA;QAED,8BAAkB,CAAC,QAAQ,CAAC,CAAA;QAC5B,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -167,7 +167,7 @@ const action = {
|
|
|
167
167
|
defaultObjectUI: 'keyvalue:only'
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
|
-
perform: async (request, { auth, settings, payload }) => {
|
|
170
|
+
perform: async (request, { auth, settings, payload, features }) => {
|
|
171
171
|
if (!settings.customerId) {
|
|
172
172
|
throw new actions_core_1.IntegrationError('Customer ID is required for this action. Please set it in destination settings.', 'Missing required fields.', 400);
|
|
173
173
|
}
|
|
@@ -202,7 +202,7 @@ const action = {
|
|
|
202
202
|
userIdentifiers: []
|
|
203
203
|
};
|
|
204
204
|
if (payload.custom_variables) {
|
|
205
|
-
const customVariableIds = await functions_1.getCustomVariables(settings.customerId, auth, request);
|
|
205
|
+
const customVariableIds = await functions_1.getCustomVariables(settings.customerId, auth, request, features);
|
|
206
206
|
request_object.customVariables = functions_1.formatCustomVariables(payload.custom_variables, customVariableIds.data[0].results);
|
|
207
207
|
}
|
|
208
208
|
if (payload.email_address) {
|
|
@@ -211,7 +211,7 @@ const action = {
|
|
|
211
211
|
if (payload.phone_number) {
|
|
212
212
|
request_object.userIdentifiers.push({ hashedPhoneNumber: functions_1.hash(payload.phone_number) });
|
|
213
213
|
}
|
|
214
|
-
const response = await request(`${types_1.
|
|
214
|
+
const response = await request(`${types_1.getUrlByVersion(features)}/${settings.customerId}:uploadClickConversions`, {
|
|
215
215
|
method: 'post',
|
|
216
216
|
headers: {
|
|
217
217
|
'developer-token': `${process.env.ADWORDS_DEVELOPER_TOKEN}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadClickConversion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadClickConversion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,oCAA0E;AAC1E,4CAAoH;AAGpH,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,2DAA2D;IACxE,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,sUAAsU;YACxU,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,8DAA8D;YAC3E,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,uHAAuH;YACzH,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,uHAAuH;YACzH,IAAI,EAAE,QAAQ;SACf;QACD,o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BAAe,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,UAAU,yBAAyB,EAC5E;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,iBAAiB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;aAC5D;YACD,IAAI,EAAE;gBACJ,WAAW,EAAE,CAAC,cAAc,CAAC;gBAC7B,cAAc,EAAE,IAAI;aACrB;SACF,CACF,CAAA;QAED,8BAAkB,CAAC,QAAQ,CAAC,CAAA;QAC5B,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -182,7 +182,7 @@ const action = {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
|
-
perform: async (request, { settings, payload }) => {
|
|
185
|
+
perform: async (request, { settings, payload, features }) => {
|
|
186
186
|
if (!settings.customerId) {
|
|
187
187
|
throw new actions_core_1.IntegrationError('Customer ID is required for this action. Please set it in destination settings.', 'Missing required fields.', 400);
|
|
188
188
|
}
|
|
@@ -234,7 +234,7 @@ const action = {
|
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
-
const response = await request(`${types_1.
|
|
237
|
+
const response = await request(`${types_1.getUrlByVersion(features)}/${settings.customerId}:uploadConversionAdjustments`, {
|
|
238
238
|
method: 'post',
|
|
239
239
|
headers: {
|
|
240
240
|
'developer-token': `${process.env.ADWORDS_DEVELOPER_TOKEN}`
|
package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,4CAAyE;AAGzE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.ts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AC;oBACjD,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;oBACpB,WAAW,EAAE,OAAO,CAAC,OAAO;oBAC5B,UAAU,EAAE,OAAO,CAAC,WAAW;iBAChC;aACF,CAAC,CAAA;SACH;QAED,MAAM,QAAQ,GAA2C,MAAM,OAAO,CACpE,GAAG,uBAAe,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,UAAU,8BAA8B,EACjF;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,iBAAiB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;aAC5D;YACD,IAAI,EAAE;gBACJ,qBAAqB,EAAE,CAAC,cAAc,CAAC;gBACvC,cAAc,EAAE,IAAI;aACrB;SACF,CACF,CAAA;QAED,8BAAkB,CAAC,QAAQ,CAAC,CAAA;QAC5B,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { JSONValue } from '@segment/actions-core';
|
|
2
1
|
export declare type Properties = {
|
|
3
2
|
[k: string]: unknown;
|
|
4
3
|
};
|
|
5
4
|
declare type FlattenProperties = object & {
|
|
6
|
-
[k: string]:
|
|
5
|
+
[k: string]: string;
|
|
7
6
|
};
|
|
8
7
|
export declare function flat(data: Properties, prefix?: string): FlattenProperties;
|
|
9
8
|
export {};
|
|
@@ -9,10 +9,20 @@ function flat(data, prefix = '') {
|
|
|
9
9
|
result = { ...result, ...flatten };
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
|
|
12
|
+
const stringifiedValue = stringify(data[key]);
|
|
13
|
+
result[(prefix + '.' + key).replace(/^\./, '')] = stringifiedValue;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
return result;
|
|
16
17
|
}
|
|
17
18
|
exports.flat = flat;
|
|
19
|
+
function stringify(value) {
|
|
20
|
+
if (typeof value === 'string') {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
24
|
+
return value.toString();
|
|
25
|
+
}
|
|
26
|
+
return JSON.stringify(value);
|
|
27
|
+
}
|
|
18
28
|
//# sourceMappingURL=flat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flat.js","sourceRoot":"","sources":["../../../src/destinations/heap/flat.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"flat.js","sourceRoot":"","sources":["../../../src/destinations/heap/flat.ts"],"names":[],"mappings":";;;AAQA,SAAgB,IAAI,CAAC,IAAgB,EAAE,MAAM,GAAG,EAAE;IAChD,IAAI,MAAM,GAAsB,EAAE,CAAA;IAClC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;YACtD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAe,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAA;YACjE,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,CAAA;SACnC;aAAM;YACL,MAAM,gBAAgB,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;YAC7C,MAAM,CAAC,CAAC,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,gBAAgB,CAAA;SACnE;KACF;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAZD,oBAYC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,KAAK,CAAA;KACb;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QAC3D,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;KACxB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Payload } from './trackEvent/generated-types';
|
|
2
|
+
export declare const getUserIdentifier: ({ identity, anonymous_id }: {
|
|
3
|
+
identity?: string | null | undefined;
|
|
4
|
+
anonymous_id?: string | null | undefined;
|
|
5
|
+
}) => {
|
|
6
|
+
[k: string]: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const getEventName: (payload: Payload) => string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEventName = exports.getUserIdentifier = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const getUserIdentifier = ({ identity, anonymous_id }) => {
|
|
6
|
+
if (identity) {
|
|
7
|
+
return {
|
|
8
|
+
identity
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
if (anonymous_id) {
|
|
12
|
+
return {
|
|
13
|
+
anonymous_id
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
throw new actions_core_1.IntegrationError('Either identity or anonymous id are required.');
|
|
17
|
+
};
|
|
18
|
+
exports.getUserIdentifier = getUserIdentifier;
|
|
19
|
+
const getEventName = (payload) => {
|
|
20
|
+
let eventName;
|
|
21
|
+
switch (payload.type) {
|
|
22
|
+
case 'track':
|
|
23
|
+
eventName = payload.event;
|
|
24
|
+
break;
|
|
25
|
+
case 'page':
|
|
26
|
+
eventName = payload.name ? `${payload.name} page viewed` : 'Page viewed';
|
|
27
|
+
break;
|
|
28
|
+
case 'screen':
|
|
29
|
+
eventName = payload.name ? `${payload.name} screen viewed` : 'Screen viewed';
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
eventName = 'track';
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
if (!eventName) {
|
|
36
|
+
return 'track';
|
|
37
|
+
}
|
|
38
|
+
return eventName;
|
|
39
|
+
};
|
|
40
|
+
exports.getEventName = getEventName;
|
|
41
|
+
//# sourceMappingURL=heapUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heapUtils.js","sourceRoot":"","sources":["../../../src/destinations/heap/heapUtils.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AAGjD,MAAM,iBAAiB,GAAG,CAAC,EAChC,QAAQ,EACR,YAAY,EAIb,EAA2B,EAAE;IAC5B,IAAI,QAAQ,EAAE;QACZ,OAAO;YACL,QAAQ;SACT,CAAA;KACF;IAED,IAAI,YAAY,EAAE;QAChB,OAAO;YACL,YAAY;SACb,CAAA;KACF;IACD,MAAM,IAAI,+BAAgB,CAAC,+CAA+C,CAAC,CAAA;AAC7E,CAAC,CAAA;AAnBY,QAAA,iBAAiB,qBAmB7B;AAEM,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC/C,IAAI,SAA6B,CAAA;IACjC,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,OAAO;YACV,SAAS,GAAG,OAAO,CAAC,KAAK,CAAA;YACzB,MAAK;QACP,KAAK,MAAM;YACT,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,aAAa,CAAA;YACxE,MAAK;QACP,KAAK,QAAQ;YACX,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,eAAe,CAAA;YAC5E,MAAK;QACP;YACE,SAAS,GAAG,OAAO,CAAA;YACnB,MAAK;KACR;IAED,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,OAAO,CAAA;KACf;IACD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AArBY,QAAA,YAAY,gBAqBxB"}
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const dayjs_1 = __importDefault(require("../../../lib/dayjs"));
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
|
-
const userIdHash_1 = require("../userIdHash");
|
|
9
8
|
const flat_1 = require("../flat");
|
|
9
|
+
const heapUtils_1 = require("../heapUtils");
|
|
10
10
|
const actions_core_1 = require("@segment/actions-core");
|
|
11
11
|
const action = {
|
|
12
12
|
title: 'Track Event',
|
|
@@ -26,10 +26,7 @@ const action = {
|
|
|
26
26
|
label: 'Identity',
|
|
27
27
|
type: 'string',
|
|
28
28
|
allowNull: true,
|
|
29
|
-
description: '
|
|
30
|
-
default: {
|
|
31
|
-
'@path': '$.userId'
|
|
32
|
-
}
|
|
29
|
+
description: 'A unique identity and maintain user histories across sessions and devices under a single profile. If no identity is provided we will add the anonymous_id to the event. More on identify: https://developers.heap.io/docs/using-identify'
|
|
33
30
|
},
|
|
34
31
|
anonymous_id: {
|
|
35
32
|
label: 'Anonymous ID',
|
|
@@ -64,14 +61,6 @@ const action = {
|
|
|
64
61
|
'@path': '$.timestamp'
|
|
65
62
|
}
|
|
66
63
|
},
|
|
67
|
-
session_id: {
|
|
68
|
-
label: 'Session ID',
|
|
69
|
-
type: 'string',
|
|
70
|
-
description: 'A Heap session ID. The session ID can be retrived by calling getSessionId() on the heap api. If a session ID is not provided one will be created.',
|
|
71
|
-
default: {
|
|
72
|
-
'@path': '$.session_id'
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
64
|
type: {
|
|
76
65
|
label: 'Type',
|
|
77
66
|
type: 'string',
|
|
@@ -94,55 +83,30 @@ const action = {
|
|
|
94
83
|
throw new actions_core_1.IntegrationError('Missing app ID');
|
|
95
84
|
}
|
|
96
85
|
if (!payload.anonymous_id && !payload.identity) {
|
|
97
|
-
throw new actions_core_1.IntegrationError('Either
|
|
86
|
+
throw new actions_core_1.IntegrationError('Either Anonymous id or Identity should be specified.');
|
|
98
87
|
}
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
properties: eventProperties,
|
|
88
|
+
const standardProperties = { segment_library: constants_1.HEAP_SEGMENT_CLOUD_LIBRARY_NAME };
|
|
89
|
+
const flattenedProperties = flat_1.flat(payload.properties || {});
|
|
90
|
+
const event = {
|
|
91
|
+
event: heapUtils_1.getEventName(payload),
|
|
92
|
+
custom_properties: flattenedProperties,
|
|
93
|
+
properties: standardProperties,
|
|
106
94
|
idempotency_key: payload.message_id
|
|
107
95
|
};
|
|
108
|
-
|
|
109
|
-
heapPayload.user_id = userIdHash_1.getHeapUserId(payload.anonymous_id);
|
|
110
|
-
}
|
|
111
|
-
if (payload.identity) {
|
|
112
|
-
heapPayload.identity = payload.identity;
|
|
113
|
-
}
|
|
96
|
+
event.user_identifier = heapUtils_1.getUserIdentifier({ identity: payload.identity, anonymous_id: payload.anonymous_id });
|
|
114
97
|
if (payload.timestamp && dayjs_1.default.utc(payload.timestamp).isValid()) {
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
if (payload.session_id) {
|
|
118
|
-
heapPayload.session_id = payload.session_id;
|
|
98
|
+
event.timestamp = dayjs_1.default.utc(payload.timestamp).toISOString();
|
|
119
99
|
}
|
|
120
|
-
|
|
100
|
+
const payLoad = {
|
|
101
|
+
app_id: settings.appId,
|
|
102
|
+
events: [event],
|
|
103
|
+
library: 'Segment'
|
|
104
|
+
};
|
|
105
|
+
return request('https://heapanalytics.com/api/integrations/track', {
|
|
121
106
|
method: 'post',
|
|
122
|
-
json:
|
|
107
|
+
json: payLoad
|
|
123
108
|
});
|
|
124
109
|
}
|
|
125
110
|
};
|
|
126
|
-
const getEventName = (payload) => {
|
|
127
|
-
let eventName;
|
|
128
|
-
switch (payload.type) {
|
|
129
|
-
case 'track':
|
|
130
|
-
eventName = payload.event;
|
|
131
|
-
break;
|
|
132
|
-
case 'page':
|
|
133
|
-
eventName = payload.name ? payload.name : 'Page Viewed';
|
|
134
|
-
break;
|
|
135
|
-
case 'screen':
|
|
136
|
-
eventName = payload.name ? payload.name : 'Screen Viewed';
|
|
137
|
-
break;
|
|
138
|
-
default:
|
|
139
|
-
eventName = 'track';
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
if (!eventName) {
|
|
143
|
-
return 'track';
|
|
144
|
-
}
|
|
145
|
-
return eventName;
|
|
146
|
-
};
|
|
147
111
|
exports.default = action;
|
|
148
112
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/heap/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,+DAAsC;AACtC,4CAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/heap/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,+DAAsC;AACtC,4CAA8D;AAC9D,kCAA8B;AAC9B,4CAA8D;AAC9D,wDAAwD;AAuBxD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,wBAAwB;IACrC,mBAAmB,EAAE,oDAAoD;IACzE,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EACT,0OAA0O;SAC7O;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,I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AC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAA;QAE1D,MAAM,KAAK,GAAc;YACvB,KAAK,EAAE,wBAAY,CAAC,OAAO,CAAC;YAC5B,iBAAiB,EAAE,mBAAmB;YACtC,UAAU,EAAE,kBAAkB;YAC9B,eAAe,EAAE,OAAO,CAAC,UAAU;SACpC,CAAA;QAED,KAAK,CAAC,eAAe,GAAG,6BAAiB,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;QAE7G,IAAI,OAAO,CAAC,SAAS,IAAI,eAAK,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE;YAC/D,KAAK,CAAC,SAAS,GAAG,eAAK,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAA;SAC7D;QAED,MAAM,OAAO,GAA6B;YACxC,MAAM,EAAE,QAAQ,CAAC,KAAK;YACtB,MAAM,EAAE,CAAC,KAAK,CAAC;YACf,OAAO,EAAE,SAAS;SACnB,CAAA;QAED,OAAO,OAAO,CAAC,kDAAkD,EAAE;YACjE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/launchpad/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/launchpad/groupIdentifyUser/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const groupIdentifyUser = {
|
|
5
|
+
title: 'Group Identify User',
|
|
6
|
+
description: 'Updates or adds properties to a group profile. The profile is created if it does not exist. [Learn more about Group Analytics.](https://help.Launchpad.pm)',
|
|
7
|
+
defaultSubscription: 'type = "group"',
|
|
8
|
+
fields: {
|
|
9
|
+
groupKey: {
|
|
10
|
+
label: 'Group Key',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: false,
|
|
13
|
+
description: 'The group key you specified in Launchpad under the company corresponding to the group. If this is not specified, it will be defaulted to "$group_id". This is helpful when you have a group of companies that should be joined together as in when you have a multinational.'
|
|
14
|
+
},
|
|
15
|
+
groupId: {
|
|
16
|
+
label: 'Group ID',
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'The unique identifier of the group. If there is a trait that matches the group key, it will override this value.',
|
|
19
|
+
required: true,
|
|
20
|
+
default: {
|
|
21
|
+
'@path': '$.groupId'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
traits: {
|
|
25
|
+
label: 'Group Properties',
|
|
26
|
+
type: 'object',
|
|
27
|
+
description: 'The properties to set on the group profile.',
|
|
28
|
+
required: false,
|
|
29
|
+
default: {
|
|
30
|
+
'@path': '$.traits'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
userId: {
|
|
34
|
+
label: 'User ID',
|
|
35
|
+
type: 'string',
|
|
36
|
+
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',
|
|
37
|
+
default: {
|
|
38
|
+
'@path': '$.userId'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
anonymousId: {
|
|
42
|
+
label: 'Anonymous ID',
|
|
43
|
+
type: 'string',
|
|
44
|
+
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',
|
|
45
|
+
default: {
|
|
46
|
+
'@path': '$.anonymousId'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
perform: async (request, { payload, settings }) => {
|
|
51
|
+
const groupId = payload.groupId;
|
|
52
|
+
const apiServerUrl = utils_1.getApiServerUrl(settings.apiRegion);
|
|
53
|
+
let transformed_traits;
|
|
54
|
+
if (payload.traits) {
|
|
55
|
+
transformed_traits = {
|
|
56
|
+
...Object.fromEntries(Object.entries(payload.traits).map(([k, v]) => [`group_${k}`, v]))
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const groupIdentifyEvent = {
|
|
60
|
+
event: '$identify',
|
|
61
|
+
type: 'screen',
|
|
62
|
+
$set: {
|
|
63
|
+
group_id: groupId,
|
|
64
|
+
...transformed_traits
|
|
65
|
+
},
|
|
66
|
+
distinct_id: payload.userId ? payload.userId : payload.anonymousId,
|
|
67
|
+
user_id: payload.userId,
|
|
68
|
+
anonymoud_id: payload.anonymousId,
|
|
69
|
+
api_key: settings.apiSecret
|
|
70
|
+
};
|
|
71
|
+
const groupIdentifyResponse = await request(`${apiServerUrl}capture`, {
|
|
72
|
+
method: 'post',
|
|
73
|
+
json: groupIdentifyEvent
|
|
74
|
+
});
|
|
75
|
+
return groupIdentifyResponse;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.default = groupIdentifyUser;
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/launchpad/groupIdentifyUser/index.ts"],"names":[],"mappings":";;AAEA,oCAA0C;AAG1C,MAAM,iBAAiB,GAAwC;IAC7D,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,4JAA4J;IAC9J,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EACT,8QAA8Q;SACjR;QACD,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ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AW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW;YAClE,OAAO,EAAE,OAAO,CAAC,MAAM;YACvB,YAAY,EAAE,OAAO,CAAC,WAAW;YACjC,OAAO,EAAE,QAAQ,CAAC,SAAS;SAC5B,CAAA;QACD,MAAM,qBAAqB,GAAG,MAAM,OAAO,CAAC,GAAG,YAAY,SAAS,EAAE;YACpE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB;SACzB,CAAC,CAAA;QAEF,OAAO,qBAAqB,CAAA;IAC9B,CAAC;CACF,CAAA;AAED,kBAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/launchpad/identifyUser/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const identifyUser = {
|
|
6
|
+
title: 'Identify User',
|
|
7
|
+
description: '“Creates or updates a user profile, and adds or updates trait values on the user profile that you can use for segmentation within the Launchpad platform.',
|
|
8
|
+
defaultSubscription: 'type = "identify"',
|
|
9
|
+
fields: {
|
|
10
|
+
ip: {
|
|
11
|
+
label: 'IP Address',
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: "The IP address of the user. This is only used for geolocation and won't be stored.",
|
|
14
|
+
default: {
|
|
15
|
+
'@path': '$.context.ip'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
userId: {
|
|
19
|
+
label: 'User ID',
|
|
20
|
+
type: 'string',
|
|
21
|
+
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',
|
|
22
|
+
default: {
|
|
23
|
+
'@path': '$.userId'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
anonymousId: {
|
|
27
|
+
label: 'Anonymous ID',
|
|
28
|
+
type: 'string',
|
|
29
|
+
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',
|
|
30
|
+
default: {
|
|
31
|
+
'@path': '$.anonymousId'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
traits: {
|
|
35
|
+
label: 'User Properties',
|
|
36
|
+
type: 'object',
|
|
37
|
+
required: true,
|
|
38
|
+
description: 'Properties that you want to set on the user profile and you would want to segment by later.',
|
|
39
|
+
default: {
|
|
40
|
+
'@path': '$.traits'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
perform: async (request, { payload, settings }) => {
|
|
45
|
+
const apiServerUrl = utils_1.getApiServerUrl(settings.apiRegion);
|
|
46
|
+
let traits;
|
|
47
|
+
if (payload.traits && Object.keys(payload.traits).length > 0) {
|
|
48
|
+
const concatenatedName = utils_1.getConcatenatedName(payload.traits.firstName, payload.traits.lastName, payload.traits.name);
|
|
49
|
+
traits = {
|
|
50
|
+
...actions_core_1.omit(payload.traits, ['created', 'email', 'firstName', 'lastName', 'name', 'username', 'phone']),
|
|
51
|
+
$created: payload.traits.created,
|
|
52
|
+
$email: payload.traits.email,
|
|
53
|
+
$first_name: payload.traits.firstName,
|
|
54
|
+
$last_name: payload.traits.lastName,
|
|
55
|
+
$name: concatenatedName,
|
|
56
|
+
$username: payload.traits.username,
|
|
57
|
+
$phone: payload.traits.phone,
|
|
58
|
+
...payload.traits
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const data = {
|
|
62
|
+
distinct_id: payload.userId ? payload.userId : payload.anonymousId,
|
|
63
|
+
user_id: payload.userId,
|
|
64
|
+
anonymous_id: payload.anonymousId,
|
|
65
|
+
$ip: payload.ip,
|
|
66
|
+
$set: traits ? traits : {},
|
|
67
|
+
event: '$identify',
|
|
68
|
+
type: 'screen',
|
|
69
|
+
api_key: settings.apiSecret
|
|
70
|
+
};
|
|
71
|
+
const identifyResponse = request(`${apiServerUrl}capture`, {
|
|
72
|
+
method: 'post',
|
|
73
|
+
json: data
|
|
74
|
+
});
|
|
75
|
+
return identifyResponse;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.default = identifyUser;
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/launchpad/identifyUser/index.ts"],"names":[],"mappings":";;AAAA,wDAA8D;AAI9D,oCAA+D;AAE/D,MAAM,YAAY,GAAwC;IACxD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,2JAA2J;IAC7J,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oFAAoF;YACjG,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,+HAA+H;YACjI,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,6JAA6J;YAC/J,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,6FAA6F;YAC1G,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;KACF;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,MAAM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