@segment/action-destinations 3.134.0 → 3.134.1-staging.1
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/actable-predictive/index.js +1 -1
- package/dist/destinations/actable-predictive/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendCustomEvent/index.js +13 -13
- package/dist/destinations/actable-predictive/sendCustomEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendEmailEvent/index.js +20 -20
- package/dist/destinations/actable-predictive/sendEmailEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendTransactionEvent/index.js +28 -28
- package/dist/destinations/actable-predictive/sendTransactionEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendWebEvent/index.js +25 -25
- package/dist/destinations/actable-predictive/sendWebEvent/index.js.map +1 -1
- package/dist/destinations/actions-bingads/functions.d.ts +0 -0
- package/dist/destinations/actions-bingads/functions.js +2 -0
- package/dist/destinations/actions-bingads/functions.js.map +1 -0
- package/dist/destinations/actions-bingads/generated-types.d.ts +10 -0
- package/dist/destinations/actions-bingads/generated-types.js +3 -0
- package/dist/destinations/actions-bingads/generated-types.js.map +1 -0
- package/dist/destinations/actions-bingads/index.d.ts +4 -0
- package/dist/destinations/actions-bingads/index.js +77 -0
- package/dist/destinations/actions-bingads/index.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.d.ts +8 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.js +33 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.d.ts +7 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.js +3 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.d.ts +5 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.js +131 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.js.map +1 -0
- package/dist/destinations/braze/trackEvent/generated-types.d.ts +0 -1
- package/dist/destinations/braze/trackEvent/index.js +35 -11
- package/dist/destinations/braze/trackEvent/index.js.map +1 -1
- package/dist/destinations/braze/trackPurchase/index.js +43 -2
- package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
- package/dist/destinations/braze-cohorts/cohortChanges.d.ts +10 -0
- package/dist/destinations/braze-cohorts/cohortChanges.js +3 -0
- package/dist/destinations/braze-cohorts/cohortChanges.js.map +1 -0
- package/dist/destinations/clevertap/userDelete/index.js +4 -4
- package/dist/destinations/clevertap/userDelete/index.js.map +1 -1
- package/dist/destinations/cordial/addContactToList/index.js.map +1 -1
- package/dist/destinations/cordial/addProductToCart/index.js +1 -1
- package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
- package/dist/destinations/cordial/cordial-client.js +2 -2
- package/dist/destinations/cordial/createContactactivity/index.js.map +1 -1
- package/dist/destinations/cordial/identities-fields.d.ts +1 -1
- package/dist/destinations/cordial/identities-fields.js +1 -1
- package/dist/destinations/cordial/identities-fields.js.map +1 -1
- package/dist/destinations/cordial/index.js +1 -1
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/mergeContacts/index.js.map +1 -1
- package/dist/destinations/cordial/removeContactFromList/index.js.map +1 -1
- package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
- package/dist/destinations/cordial/upsertOrder/index.js +8 -8
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +1 -1
- package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +1 -3
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +6 -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 +6 -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 +6 -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 +6 -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 +6 -10
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.d.ts +0 -7
- package/dist/destinations/google-analytics-4/ga4-functions.js +1 -38
- 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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +6 -10
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/google-sheets-dev/index.js +10 -3
- package/dist/destinations/google-sheets-dev/index.js.map +1 -1
- package/dist/destinations/google-sheets-partner/constants.d.ts +3 -0
- package/dist/destinations/google-sheets-partner/constants.js +7 -0
- package/dist/destinations/google-sheets-partner/constants.js.map +1 -0
- package/dist/destinations/google-sheets-partner/generated-types.d.ts +2 -0
- package/dist/destinations/google-sheets-partner/generated-types.js +3 -0
- package/dist/destinations/google-sheets-partner/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.d.ts +17 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.js +34 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/index.d.ts +4 -0
- package/dist/destinations/google-sheets-partner/index.js +43 -0
- package/dist/destinations/google-sheets-partner/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.d.ts +11 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.js +3 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.d.ts +5 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.js +79 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.d.ts +10 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.js +96 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.js.map +1 -0
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/mixpanel/index.js +1 -1
- package/dist/destinations/mixpanel/mixpanel-properties.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/trackPurchase/index.js.map +1 -1
- package/dist/destinations/salesforce/sf-properties.d.ts +1 -0
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- package/dist/destinations/segment/segment-properties.js +1 -2
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -1
- package/dist/destinations/tiktok-audiences/addUser/generated-types.d.ts +12 -0
- package/dist/destinations/tiktok-audiences/addUser/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/addUser/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/addUser/index.d.ts +5 -0
- package/dist/destinations/tiktok-audiences/addUser/index.js +47 -0
- package/dist/destinations/tiktok-audiences/addUser/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/api/api.test.d.ts +1 -0
- package/dist/destinations/tiktok-audiences/api/api.test.js +118 -0
- package/dist/destinations/tiktok-audiences/api/api.test.js.map +1 -0
- package/dist/destinations/tiktok-audiences/api/index.d.ts +13 -0
- package/dist/destinations/tiktok-audiences/api/index.js +93 -0
- package/dist/destinations/tiktok-audiences/api/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/constants.d.ts +2 -0
- package/dist/destinations/tiktok-audiences/constants.js +6 -0
- package/dist/destinations/tiktok-audiences/constants.js.map +1 -0
- package/dist/destinations/tiktok-audiences/functions.d.ts +14 -0
- package/dist/destinations/tiktok-audiences/functions.js +116 -0
- package/dist/destinations/tiktok-audiences/functions.js.map +1 -0
- package/dist/destinations/tiktok-audiences/generated-types.d.ts +3 -0
- package/dist/destinations/tiktok-audiences/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/index.d.ts +4 -0
- package/dist/destinations/tiktok-audiences/index.js +38 -0
- package/dist/destinations/tiktok-audiences/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/properties.d.ts +11 -0
- package/dist/destinations/tiktok-audiences/properties.js +80 -0
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -0
- package/dist/destinations/tiktok-audiences/removeUser/generated-types.d.ts +12 -0
- package/dist/destinations/tiktok-audiences/removeUser/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/removeUser/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/removeUser/index.d.ts +5 -0
- package/dist/destinations/tiktok-audiences/removeUser/index.js +47 -0
- package/dist/destinations/tiktok-audiences/removeUser/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/types.d.ts +33 -0
- package/dist/destinations/tiktok-audiences/types.js +3 -0
- package/dist/destinations/tiktok-audiences/types.js.map +1 -0
- package/package.json +2 -3
- package/dist/destinations/braze/utils.d.ts +0 -6
- package/dist/destinations/braze/utils.js +0 -81
- package/dist/destinations/braze/utils.js.map +0 -1
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
-
const ga4_types_1 = require("../ga4-types");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'Select Promotion',
|
|
9
8
|
description: 'Send event when a user selects a promotion',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Promotion Clicked"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -45,11 +42,7 @@ const action = {
|
|
|
45
42
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
46
43
|
params: ga4_properties_1.params
|
|
47
44
|
},
|
|
48
|
-
perform: (request, { payload, features
|
|
49
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
50
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
51
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
52
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
45
|
+
perform: (request, { payload, features }) => {
|
|
53
46
|
let googleItems = [];
|
|
54
47
|
if (payload.items) {
|
|
55
48
|
googleItems = payload.items.map((product) => {
|
|
@@ -67,7 +60,7 @@ const action = {
|
|
|
67
60
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
68
61
|
}
|
|
69
62
|
const request_object = {
|
|
70
|
-
|
|
63
|
+
client_id: payload.client_id,
|
|
71
64
|
user_id: payload.user_id,
|
|
72
65
|
events: [
|
|
73
66
|
{
|
|
@@ -89,7 +82,10 @@ const action = {
|
|
|
89
82
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
90
83
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
91
84
|
}
|
|
92
|
-
return
|
|
85
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
86
|
+
method: 'POST',
|
|
87
|
+
json: request_object
|
|
88
|
+
});
|
|
93
89
|
}
|
|
94
90
|
};
|
|
95
91
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E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A;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ga4_functions_1 = require("../ga4-functions");
|
|
4
4
|
const ga4_properties_1 = require("../ga4-properties");
|
|
5
|
-
const ga4_types_1 = require("../ga4-types");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Sign Up',
|
|
8
7
|
description: 'Send event when a user signs up to measure the popularity of each sign-up method',
|
|
9
8
|
defaultSubscription: 'type = "track" and event = "Signed Up"',
|
|
10
9
|
fields: {
|
|
11
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
12
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
13
10
|
client_id: { ...ga4_properties_1.client_id },
|
|
14
11
|
user_id: { ...ga4_properties_1.user_id },
|
|
15
12
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -25,17 +22,13 @@ const action = {
|
|
|
25
22
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
26
23
|
params: ga4_properties_1.params
|
|
27
24
|
},
|
|
28
|
-
perform: (request, { payload, features
|
|
29
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
30
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
31
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
32
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
25
|
+
perform: (request, { payload, features }) => {
|
|
33
26
|
if (features && features['actions-google-analytics-4-verify-params-feature']) {
|
|
34
27
|
ga4_functions_1.verifyParams(payload.params);
|
|
35
28
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
36
29
|
}
|
|
37
30
|
const request_object = {
|
|
38
|
-
|
|
31
|
+
client_id: payload.client_id,
|
|
39
32
|
user_id: payload.user_id,
|
|
40
33
|
events: [
|
|
41
34
|
{
|
|
@@ -52,7 +45,10 @@ const action = {
|
|
|
52
45
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
53
46
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
54
47
|
}
|
|
55
|
-
return
|
|
48
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
json: request_object
|
|
51
|
+
});
|
|
56
52
|
}
|
|
57
53
|
};
|
|
58
54
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/signUp/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/signUp/index.ts"],"names":[],"mappings":";;AAGA,oDAAkF;AAClF,sDAQ0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,kFAAkF;IAC/F,mBAAmB,EAAE,wCAAwC;IAC7D,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB;aAC7B;SACF;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,QAAQ,IAAI,QAAQ,CAAC,kDAAkD,CAAC,EAAE;YAC5E,4BAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAC5B,+BAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;SACzC;QACD,MAAM,cAAc,GAA2B;YAC7C,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,SAAS;oBACf,MAAM,EAAE;wBACN,MAAM,EAAE,OAAO,CAAC,MAAM;wBACtB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
-
const ga4_types_1 = require("../ga4-types");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'View Cart',
|
|
9
8
|
description: 'Send event when a user views their cart',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Cart Viewed"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -24,11 +21,7 @@ const action = {
|
|
|
24
21
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
25
22
|
params: ga4_properties_1.params
|
|
26
23
|
},
|
|
27
|
-
perform: (request, { payload, features
|
|
28
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
29
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
30
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
31
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
24
|
+
perform: (request, { payload, features }) => {
|
|
32
25
|
if (payload.currency) {
|
|
33
26
|
ga4_functions_1.verifyCurrency(payload.currency);
|
|
34
27
|
}
|
|
@@ -55,7 +48,7 @@ const action = {
|
|
|
55
48
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
56
49
|
}
|
|
57
50
|
const request_object = {
|
|
58
|
-
|
|
51
|
+
client_id: payload.client_id,
|
|
59
52
|
user_id: payload.user_id,
|
|
60
53
|
events: [
|
|
61
54
|
{
|
|
@@ -74,7 +67,10 @@ const action = {
|
|
|
74
67
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
75
68
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
76
69
|
}
|
|
77
|
-
return
|
|
70
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
71
|
+
method: 'POST',
|
|
72
|
+
json: request_object
|
|
73
|
+
});
|
|
78
74
|
}
|
|
79
75
|
};
|
|
80
76
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAW0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,yCAAyC;IACtD,mBAAmB,EAAE,0CAA0C;IAC/D,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,KAAK,EAAE;YACL,GAAG,qCAAoB;YACvB,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,8BAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;SACjC;QAED,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;YACnD,MAAM,IAAI,+BAAgB,CAAC,uCAAuC,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;SACzG;QAGD,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI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AAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
-
const ga4_types_1 = require("../ga4-types");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'View Item',
|
|
9
8
|
description: 'Send event when a user views an item',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Product Viewed"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -24,11 +21,7 @@ const action = {
|
|
|
24
21
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
25
22
|
params: ga4_properties_1.params
|
|
26
23
|
},
|
|
27
|
-
perform: (request, { payload, features
|
|
28
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
29
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
30
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
31
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
24
|
+
perform: (request, { payload, features }) => {
|
|
32
25
|
if (payload.currency) {
|
|
33
26
|
ga4_functions_1.verifyCurrency(payload.currency);
|
|
34
27
|
}
|
|
@@ -49,7 +42,7 @@ const action = {
|
|
|
49
42
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
50
43
|
}
|
|
51
44
|
const request_object = {
|
|
52
|
-
|
|
45
|
+
client_id: payload.client_id,
|
|
53
46
|
user_id: payload.user_id,
|
|
54
47
|
events: [
|
|
55
48
|
{
|
|
@@ -68,7 +61,10 @@ const action = {
|
|
|
68
61
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
69
62
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
70
63
|
}
|
|
71
|
-
return
|
|
64
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
json: request_object
|
|
67
|
+
});
|
|
72
68
|
}
|
|
73
69
|
};
|
|
74
70
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAW0B;AAK1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,sCAAsC;IACnD,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EA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AK,EAAE,OAAO,CAAC,KAAK;wBACpB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
-
const ga4_types_1 = require("../ga4-types");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'View Item List',
|
|
9
8
|
description: 'Send event when a user views a list of items or offerings',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Product List Viewed"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -38,11 +35,7 @@ const action = {
|
|
|
38
35
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
39
36
|
params: ga4_properties_1.params
|
|
40
37
|
},
|
|
41
|
-
perform: (request, { payload, features
|
|
42
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
43
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
44
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
45
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
38
|
+
perform: (request, { payload, features }) => {
|
|
46
39
|
let googleItems = [];
|
|
47
40
|
if (payload.items) {
|
|
48
41
|
googleItems = payload.items.map((product) => {
|
|
@@ -60,7 +53,7 @@ const action = {
|
|
|
60
53
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
61
54
|
}
|
|
62
55
|
const request_object = {
|
|
63
|
-
|
|
56
|
+
client_id: payload.client_id,
|
|
64
57
|
user_id: payload.user_id,
|
|
65
58
|
events: [
|
|
66
59
|
{
|
|
@@ -79,7 +72,10 @@ const action = {
|
|
|
79
72
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
80
73
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
81
74
|
}
|
|
82
|
-
return
|
|
75
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
76
|
+
method: 'POST',
|
|
77
|
+
json: request_object
|
|
78
|
+
});
|
|
83
79
|
}
|
|
84
80
|
};
|
|
85
81
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAS0B;AAS1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,2DAA2D;IACxE,mBAAmB,EAAE,kDAAkD;IACvE,MAAM,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AAC,MAAM,CAAC,CAAA;YAC5B,+BAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;SACzC;QACD,MAAM,cAAc,GAA2B;YAC7C,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,gBAAgB;oBACtB,MAAM,EAAE;wBACN,YAAY,EAAE,OAAO,CAAC,YAAY;wBAClC,cAAc,EAAE,OAAO,CAAC,cAAc;wBACtC,KAAK,EAAE,WAAW;wBAClB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
-
const ga4_types_1 = require("../ga4-types");
|
|
7
6
|
const action = {
|
|
8
7
|
title: 'View Promotion',
|
|
9
8
|
description: 'Send event when a promotion is shown to a user',
|
|
10
9
|
defaultSubscription: 'type = "track" and event = "Promotion Viewed"',
|
|
11
10
|
fields: {
|
|
12
|
-
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
-
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
14
11
|
client_id: { ...ga4_properties_1.client_id },
|
|
15
12
|
user_id: { ...ga4_properties_1.user_id },
|
|
16
13
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -49,11 +46,7 @@ const action = {
|
|
|
49
46
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
50
47
|
params: ga4_properties_1.params
|
|
51
48
|
},
|
|
52
|
-
perform: (request, { payload, features
|
|
53
|
-
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
54
|
-
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
55
|
-
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
56
|
-
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
49
|
+
perform: (request, { payload, features }) => {
|
|
57
50
|
let googleItems = [];
|
|
58
51
|
if (payload.items) {
|
|
59
52
|
googleItems = payload.items.map((product) => {
|
|
@@ -71,7 +64,7 @@ const action = {
|
|
|
71
64
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
72
65
|
}
|
|
73
66
|
const request_object = {
|
|
74
|
-
|
|
67
|
+
client_id: payload.client_id,
|
|
75
68
|
user_id: payload.user_id,
|
|
76
69
|
events: [
|
|
77
70
|
{
|
|
@@ -93,7 +86,10 @@ const action = {
|
|
|
93
86
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
94
87
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
95
88
|
}
|
|
96
|
-
return
|
|
89
|
+
return request('https://www.google-analytics.com/mp/collect', {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
json: request_object
|
|
92
|
+
});
|
|
97
93
|
}
|
|
98
94
|
};
|
|
99
95
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAClG,sDAc0B;AAS1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,gDAAgD;IAC7D,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE;QACnC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE;QAClF,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yBAAyB;YACtC,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,YAAY,EAAE,EAAE,GAAG,6BAAY,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE,EAAE;QACpF,cAAc,EAAE,EAAE,GAAG,+BAAc,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE;QAChF,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,GAAG,8BAAa,CAAC,UAAU;gBAC3B,aAAa,EAAE;oBACb,GAAG,8BAAa;iBACjB;gBACD,aAAa,EAAE;oBACb,GAAG,8BAAa;iBACjB;gBACD,cAAc,EAAE;oBACd,GAAG,+BAAc;iBAClB;gBACD,YAAY,EAAE;oBACZ,GAAG,6BAAY;iBAChB;aACF;S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wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAED,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,6 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const postSheet_1 = __importDefault(require("../google-sheets/postSheet"));
|
|
7
|
+
const origPerform = postSheet_1.default.performBatch || (() => { });
|
|
8
|
+
postSheet_1.default.performBatch = (request, obj) => {
|
|
9
|
+
const { features } = obj;
|
|
10
|
+
if (features && features['gameday-verticalized-integrations']) {
|
|
11
|
+
throw new Error('ECONNRESET: socket hang up');
|
|
12
|
+
}
|
|
13
|
+
else
|
|
14
|
+
origPerform(request, obj);
|
|
15
|
+
};
|
|
7
16
|
const destination = {
|
|
8
17
|
name: 'Google Sheets (dev only)',
|
|
9
18
|
slug: 'actions-google-sheets-dev',
|
|
@@ -12,9 +21,7 @@ const destination = {
|
|
|
12
21
|
scheme: 'oauth-managed',
|
|
13
22
|
fields: {},
|
|
14
23
|
refreshAccessToken: async (request, { auth }) => {
|
|
15
|
-
|
|
16
|
-
throw new Error('destination misconfigured: missing refresh token URL');
|
|
17
|
-
const res = await request(auth.refreshTokenUrl, {
|
|
24
|
+
const res = await request('https://www.googleapis.com/oauth2/v4/token', {
|
|
18
25
|
method: 'POST',
|
|
19
26
|
body: new URLSearchParams({
|
|
20
27
|
refresh_token: auth.refreshToken,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/google-sheets-dev/index.ts"],"names":[],"mappings":";;;;;AAGA,2EAAkD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/google-sheets-dev/index.ts"],"names":[],"mappings":";;;;;AAGA,2EAAkD;AASlD,MAAM,WAAW,GAAG,mBAAS,CAAC,YAAY,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;AACxD,mBAAS,CAAC,YAAY,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;IACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;IACxB,IAAI,QAAQ,IAAI,QAAQ,CAAC,mCAAmC,CAAC,EAAE;QAC7D,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;KAC9C;;QAAM,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAClC,CAAC,CAAA;AAED,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,EAAE;QAMV,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,4CAA4C,EAAE;gBAC5F,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,UAAU,EAAE,eAAe;iBAC5B,CAAC;aACH,CAAC,CAAA;YAEF,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAA;QAC/C,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;aAC7C;SACF,CAAA;IACH,CAAC;IAQD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/google-sheets-partner/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IAIvB,SAAS,EAAE,MAAM;CAClB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/google-sheets-partner/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ModifiedResponse, RequestClient } from '@segment/actions-core';
|
|
2
|
+
import type { MappingSettings } from '../postSheet/operations';
|
|
3
|
+
export declare type GetResponse = {
|
|
4
|
+
range: string;
|
|
5
|
+
majorDimension: string;
|
|
6
|
+
values: string[][];
|
|
7
|
+
};
|
|
8
|
+
export declare class GoogleSheets {
|
|
9
|
+
request: RequestClient;
|
|
10
|
+
constructor(request: RequestClient);
|
|
11
|
+
get: (mappingSettings: MappingSettings, range: string) => Promise<ModifiedResponse<GetResponse>>;
|
|
12
|
+
batchUpdate: (mappingSettings: MappingSettings, batchPayload: {
|
|
13
|
+
range: string;
|
|
14
|
+
values: string[][];
|
|
15
|
+
}[]) => Promise<ModifiedResponse<unknown>>;
|
|
16
|
+
append: (mappingSettings: MappingSettings, range: string, values: string[][]) => Promise<ModifiedResponse<unknown>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleSheets = void 0;
|
|
4
|
+
const API_VERSION = 'v4';
|
|
5
|
+
class GoogleSheets {
|
|
6
|
+
constructor(request) {
|
|
7
|
+
this.get = async (mappingSettings, range) => {
|
|
8
|
+
return this.request(`https://sheets.googleapis.com/${API_VERSION}/spreadsheets/${mappingSettings.spreadsheetId}/values/${mappingSettings.spreadsheetName}!${range}`, {
|
|
9
|
+
method: 'get',
|
|
10
|
+
skipResponseCloning: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
this.batchUpdate = async (mappingSettings, batchPayload) => {
|
|
14
|
+
return this.request(`https://sheets.googleapis.com/${API_VERSION}/spreadsheets/${mappingSettings.spreadsheetId}/values:batchUpdate`, {
|
|
15
|
+
method: 'post',
|
|
16
|
+
json: {
|
|
17
|
+
valueInputOption: mappingSettings.dataFormat,
|
|
18
|
+
data: batchPayload
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
this.append = async (mappingSettings, range, values) => {
|
|
23
|
+
return this.request(`https://sheets.googleapis.com/${API_VERSION}/spreadsheets/${mappingSettings.spreadsheetId}/values/${mappingSettings.spreadsheetName}!${range}:append?valueInputOption=${mappingSettings.dataFormat}&insertDataOption=INSERT_ROWS`, {
|
|
24
|
+
method: 'post',
|
|
25
|
+
json: {
|
|
26
|
+
values: values
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
this.request = request;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.GoogleSheets = GoogleSheets;
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-sheets-partner/googleapis/index.ts"],"names":[],"mappings":";;;AAGA,MAAM,WAAW,GAAG,IAAI,CAAA;AAOxB,MAAa,YAAY;IAGvB,YAAY,OAAsB;QAIlC,QAAG,GAAG,KAAK,EAAE,eAAgC,EAAE,KAAa,EAA0C,EAAE;YACtG,OAAO,IAAI,CAAC,OAAO,CACjB,iCAAiC,WAAW,iBAAiB,eAAe,CAAC,aAAa,WAAW,eAAe,CAAC,eAAe,IAAI,KAAK,EAAE,EAC/I;gBACE,MAAM,EAAE,KAAK;gBACb,mBAAmB,EAAE,IAAI;aAC1B,CACF,CAAA;QACH,CAAC,CAAA;QAED,gBAAW,GAAG,KAAK,EAAE,eAAgC,EAAE,YAAqD,EAAE,EAAE;YAC9G,OAAO,IAAI,CAAC,OAAO,CACjB,iCAAiC,WAAW,iBAAiB,eAAe,CAAC,aAAa,qBAAqB,EAC/G;gBACE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACJ,gBAAgB,EAAE,eAAe,CAAC,UAAU;oBAC5C,IAAI,EAAE,YAAY;iBACnB;aACF,CACF,CAAA;QACH,CAAC,CAAA;QAeD,WAAM,GAAG,KAAK,EAAE,eAAgC,EAAE,KAAa,EAAE,MAAkB,EAAE,EAAE;YACrF,OAAO,IAAI,CAAC,OAAO,CACjB,iCAAiC,WAAW,iBAAiB,eAAe,CAAC,aAAa,WAAW,eAAe,CAAC,eAAe,IAAI,KAAK,4BAA4B,eAAe,CAAC,UAAU,+BAA+B,EAClO;gBACE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACJ,MAAM,EAAE,MAAM;iBACf;aACF,CACF,CAAA;QACH,CAAC,CAAA;QAjDC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAiDF;AAtDD,oCAsDC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const postSheet_1 = __importDefault(require("./postSheet"));
|
|
7
|
+
const destination = {
|
|
8
|
+
name: 'Google Sheets (Partner Test)',
|
|
9
|
+
slug: 'actions-google-sheets-partner',
|
|
10
|
+
mode: 'cloud',
|
|
11
|
+
authentication: {
|
|
12
|
+
scheme: 'oauth-managed',
|
|
13
|
+
fields: {},
|
|
14
|
+
refreshAccessToken: async (request, { auth }) => {
|
|
15
|
+
if (!auth.refreshTokenUrl) {
|
|
16
|
+
console.log('Could not find refresh token Url');
|
|
17
|
+
auth.refreshTokenUrl = 'https://www.googleapis.com/oauth2/v4/token';
|
|
18
|
+
}
|
|
19
|
+
const res = await request(auth.refreshTokenUrl, {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
body: new URLSearchParams({
|
|
22
|
+
refresh_token: auth.refreshToken,
|
|
23
|
+
client_id: auth.clientId,
|
|
24
|
+
client_secret: auth.clientSecret,
|
|
25
|
+
grant_type: 'refresh_token'
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
return { accessToken: res.data.access_token };
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
extendRequest({ auth }) {
|
|
32
|
+
return {
|
|
33
|
+
headers: {
|
|
34
|
+
authorization: `Bearer ${auth?.accessToken}`
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
actions: {
|
|
39
|
+
postSheet: postSheet_1.default
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.default = destination;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/google-sheets-partner/index.ts"],"names":[],"mappings":";;;;;AAGA,4DAAmC;AAQnC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,EAAE;QAMV,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAA;gBAC/C,IAAI,CAAC,eAAe,GAAG,4CAA4C,CAAA;aACpE;YACD,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,IAAI,CAAC,eAAe,EAAE;gBACpE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,UAAU,EAAE,eAAe;iBAC5B,CAAC;aACH,CAAC,CAAA;YAEF,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAA;QAC/C,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;aAC7C;SACF,CAAA;IACH,CAAC;IAQD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|