@segment/action-destinations 3.141.0 → 3.142.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/acoustic/Utility/eventprocessing.d.ts +10 -0
- package/dist/destinations/acoustic/Utility/eventprocessing.js +106 -0
- package/dist/destinations/acoustic/Utility/eventprocessing.js.map +1 -0
- package/dist/destinations/acoustic/Utility/tablemaintutilities.d.ts +9 -0
- package/dist/destinations/acoustic/Utility/tablemaintutilities.js +153 -0
- package/dist/destinations/acoustic/Utility/tablemaintutilities.js.map +1 -0
- package/dist/destinations/acoustic/generated-types.d.ts +6 -0
- package/dist/destinations/acoustic/generated-types.js +3 -0
- package/dist/destinations/acoustic/generated-types.js.map +1 -0
- package/dist/destinations/acoustic/index.d.ts +10 -0
- package/dist/destinations/acoustic/index.js +119 -0
- package/dist/destinations/acoustic/index.js.map +1 -0
- package/dist/destinations/acoustic/receiveEvents/generated-types.d.ts +14 -0
- package/dist/destinations/acoustic/receiveEvents/generated-types.js +3 -0
- package/dist/destinations/acoustic/receiveEvents/generated-types.js.map +1 -0
- package/dist/destinations/acoustic/receiveEvents/index.d.ts +5 -0
- package/dist/destinations/acoustic/receiveEvents/index.js +72 -0
- package/dist/destinations/acoustic/receiveEvents/index.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.js +1 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.js.map +1 -1
- package/dist/destinations/heap/heapUtils.js +1 -1
- package/dist/destinations/heap/heapUtils.js.map +1 -1
- package/dist/destinations/heap/trackEvent/index.js +1 -1
- package/dist/destinations/heap/trackEvent/index.js.map +1 -1
- package/dist/destinations/index.js +3 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/june/generated-types.d.ts +3 -0
- package/dist/destinations/june/generated-types.js +3 -0
- package/dist/destinations/june/generated-types.js.map +1 -0
- package/dist/destinations/june/group/generated-types.d.ts +10 -0
- package/dist/destinations/june/group/generated-types.js +3 -0
- package/dist/destinations/june/group/generated-types.js.map +1 -0
- package/dist/destinations/june/group/index.d.ts +5 -0
- package/dist/destinations/june/group/index.js +64 -0
- package/dist/destinations/june/group/index.js.map +1 -0
- package/dist/destinations/june/identify/generated-types.d.ts +9 -0
- package/dist/destinations/june/identify/generated-types.js +3 -0
- package/dist/destinations/june/identify/generated-types.js.map +1 -0
- package/dist/destinations/june/identify/index.d.ts +5 -0
- package/dist/destinations/june/identify/index.js +57 -0
- package/dist/destinations/june/identify/index.js.map +1 -0
- package/dist/destinations/june/index.d.ts +4 -0
- package/dist/destinations/june/index.js +64 -0
- package/dist/destinations/june/index.js.map +1 -0
- package/dist/destinations/june/page/generated-types.d.ts +13 -0
- package/dist/destinations/june/page/generated-types.js +3 -0
- package/dist/destinations/june/page/generated-types.js.map +1 -0
- package/dist/destinations/june/page/index.d.ts +5 -0
- package/dist/destinations/june/page/index.js +72 -0
- package/dist/destinations/june/page/index.js.map +1 -0
- package/dist/destinations/june/track/generated-types.d.ts +13 -0
- package/dist/destinations/june/track/generated-types.js +3 -0
- package/dist/destinations/june/track/generated-types.js.map +1 -0
- package/dist/destinations/june/track/index.d.ts +5 -0
- package/dist/destinations/june/track/index.js +75 -0
- package/dist/destinations/june/track/index.js.map +1 -0
- package/dist/destinations/revend/addPaymentInfo/generated-types.d.ts +37 -0
- package/dist/destinations/revend/addPaymentInfo/generated-types.js +3 -0
- package/dist/destinations/revend/addPaymentInfo/generated-types.js.map +1 -0
- package/dist/destinations/revend/addPaymentInfo/index.d.ts +5 -0
- package/dist/destinations/revend/addPaymentInfo/index.js +84 -0
- package/dist/destinations/revend/addPaymentInfo/index.js.map +1 -0
- package/dist/destinations/revend/addToCart/generated-types.d.ts +35 -0
- package/dist/destinations/revend/addToCart/generated-types.js +3 -0
- package/dist/destinations/revend/addToCart/generated-types.js.map +1 -0
- package/dist/destinations/revend/addToCart/index.d.ts +5 -0
- package/dist/destinations/revend/addToCart/index.js +71 -0
- package/dist/destinations/revend/addToCart/index.js.map +1 -0
- package/dist/destinations/revend/addToWishlist/generated-types.d.ts +35 -0
- package/dist/destinations/revend/addToWishlist/generated-types.js +3 -0
- package/dist/destinations/revend/addToWishlist/generated-types.js.map +1 -0
- package/dist/destinations/revend/addToWishlist/index.d.ts +5 -0
- package/dist/destinations/revend/addToWishlist/index.js +77 -0
- package/dist/destinations/revend/addToWishlist/index.js.map +1 -0
- package/dist/destinations/revend/beginCheckout/generated-types.d.ts +36 -0
- package/dist/destinations/revend/beginCheckout/generated-types.js +3 -0
- package/dist/destinations/revend/beginCheckout/generated-types.js.map +1 -0
- package/dist/destinations/revend/beginCheckout/index.d.ts +5 -0
- package/dist/destinations/revend/beginCheckout/index.js +73 -0
- package/dist/destinations/revend/beginCheckout/index.js.map +1 -0
- package/dist/destinations/revend/constants.d.ts +1 -0
- package/dist/destinations/revend/constants.js +185 -0
- package/dist/destinations/revend/constants.js.map +1 -0
- package/dist/destinations/revend/customEvent/generated-types.d.ts +14 -0
- package/dist/destinations/revend/customEvent/generated-types.js +3 -0
- package/dist/destinations/revend/customEvent/generated-types.js.map +1 -0
- package/dist/destinations/revend/customEvent/index.d.ts +5 -0
- package/dist/destinations/revend/customEvent/index.js +70 -0
- package/dist/destinations/revend/customEvent/index.js.map +1 -0
- package/dist/destinations/revend/ga4-functions.d.ts +4 -0
- package/dist/destinations/revend/ga4-functions.js +53 -0
- package/dist/destinations/revend/ga4-functions.js.map +1 -0
- package/dist/destinations/revend/ga4-properties.d.ts +23 -0
- package/dist/destinations/revend/ga4-properties.js +320 -0
- package/dist/destinations/revend/ga4-properties.js.map +1 -0
- package/dist/destinations/revend/ga4-types.d.ts +27 -0
- package/dist/destinations/revend/ga4-types.js +3 -0
- package/dist/destinations/revend/ga4-types.js.map +1 -0
- package/dist/destinations/revend/generateLead/generated-types.d.ts +14 -0
- package/dist/destinations/revend/generateLead/generated-types.js +3 -0
- package/dist/destinations/revend/generateLead/generated-types.js.map +1 -0
- package/dist/destinations/revend/generateLead/index.d.ts +5 -0
- package/dist/destinations/revend/generateLead/index.js +57 -0
- package/dist/destinations/revend/generateLead/index.js.map +1 -0
- package/dist/destinations/revend/generated-types.d.ts +3 -0
- package/dist/destinations/revend/generated-types.js +3 -0
- package/dist/destinations/revend/generated-types.js.map +1 -0
- package/dist/destinations/revend/index.d.ts +4 -0
- package/dist/destinations/revend/index.js +70 -0
- package/dist/destinations/revend/index.js.map +1 -0
- package/dist/destinations/revend/login/generated-types.d.ts +13 -0
- package/dist/destinations/revend/login/generated-types.js +3 -0
- package/dist/destinations/revend/login/generated-types.js.map +1 -0
- package/dist/destinations/revend/login/index.d.ts +5 -0
- package/dist/destinations/revend/login/index.js +52 -0
- package/dist/destinations/revend/login/index.js.map +1 -0
- package/dist/destinations/revend/pageView/generated-types.d.ts +15 -0
- package/dist/destinations/revend/pageView/generated-types.js +3 -0
- package/dist/destinations/revend/pageView/generated-types.js.map +1 -0
- package/dist/destinations/revend/pageView/index.d.ts +5 -0
- package/dist/destinations/revend/pageView/index.js +73 -0
- package/dist/destinations/revend/pageView/index.js.map +1 -0
- package/dist/destinations/revend/purchase/generated-types.d.ts +40 -0
- package/dist/destinations/revend/purchase/generated-types.js +3 -0
- package/dist/destinations/revend/purchase/generated-types.js.map +1 -0
- package/dist/destinations/revend/purchase/index.d.ts +5 -0
- package/dist/destinations/revend/purchase/index.js +79 -0
- package/dist/destinations/revend/purchase/index.js.map +1 -0
- package/dist/destinations/revend/refund/generated-types.d.ts +40 -0
- package/dist/destinations/revend/refund/generated-types.js +3 -0
- package/dist/destinations/revend/refund/generated-types.js.map +1 -0
- package/dist/destinations/revend/refund/index.d.ts +5 -0
- package/dist/destinations/revend/refund/index.js +90 -0
- package/dist/destinations/revend/refund/index.js.map +1 -0
- package/dist/destinations/revend/removeFromCart/generated-types.d.ts +35 -0
- package/dist/destinations/revend/removeFromCart/generated-types.js +3 -0
- package/dist/destinations/revend/removeFromCart/generated-types.js.map +1 -0
- package/dist/destinations/revend/removeFromCart/index.d.ts +5 -0
- package/dist/destinations/revend/removeFromCart/index.js +77 -0
- package/dist/destinations/revend/removeFromCart/index.js.map +1 -0
- package/dist/destinations/revend/search/generated-types.d.ts +13 -0
- package/dist/destinations/revend/search/generated-types.js +3 -0
- package/dist/destinations/revend/search/generated-types.js.map +1 -0
- package/dist/destinations/revend/search/index.d.ts +5 -0
- package/dist/destinations/revend/search/index.js +56 -0
- package/dist/destinations/revend/search/index.js.map +1 -0
- package/dist/destinations/revend/selectItem/generated-types.d.ts +35 -0
- package/dist/destinations/revend/selectItem/generated-types.js +3 -0
- package/dist/destinations/revend/selectItem/generated-types.js.map +1 -0
- package/dist/destinations/revend/selectItem/index.d.ts +5 -0
- package/dist/destinations/revend/selectItem/index.js +76 -0
- package/dist/destinations/revend/selectItem/index.js.map +1 -0
- package/dist/destinations/revend/selectPromotion/generated-types.d.ts +42 -0
- package/dist/destinations/revend/selectPromotion/generated-types.js +3 -0
- package/dist/destinations/revend/selectPromotion/generated-types.js.map +1 -0
- package/dist/destinations/revend/selectPromotion/index.d.ts +5 -0
- package/dist/destinations/revend/selectPromotion/index.js +92 -0
- package/dist/destinations/revend/selectPromotion/index.js.map +1 -0
- package/dist/destinations/revend/signUp/generated-types.d.ts +13 -0
- package/dist/destinations/revend/signUp/generated-types.js +3 -0
- package/dist/destinations/revend/signUp/generated-types.js.map +1 -0
- package/dist/destinations/revend/signUp/index.d.ts +5 -0
- package/dist/destinations/revend/signUp/index.js +55 -0
- package/dist/destinations/revend/signUp/index.js.map +1 -0
- package/dist/destinations/revend/viewCart/generated-types.d.ts +35 -0
- package/dist/destinations/revend/viewCart/generated-types.js +3 -0
- package/dist/destinations/revend/viewCart/generated-types.js.map +1 -0
- package/dist/destinations/revend/viewCart/index.d.ts +5 -0
- package/dist/destinations/revend/viewCart/index.js +77 -0
- package/dist/destinations/revend/viewCart/index.js.map +1 -0
- package/dist/destinations/revend/viewItem/generated-types.d.ts +35 -0
- package/dist/destinations/revend/viewItem/generated-types.js +3 -0
- package/dist/destinations/revend/viewItem/generated-types.js.map +1 -0
- package/dist/destinations/revend/viewItem/index.d.ts +5 -0
- package/dist/destinations/revend/viewItem/index.js +71 -0
- package/dist/destinations/revend/viewItem/index.js.map +1 -0
- package/dist/destinations/revend/viewItemList/generated-types.d.ts +35 -0
- package/dist/destinations/revend/viewItemList/generated-types.js +3 -0
- package/dist/destinations/revend/viewItemList/generated-types.js.map +1 -0
- package/dist/destinations/revend/viewItemList/index.d.ts +5 -0
- package/dist/destinations/revend/viewItemList/index.js +82 -0
- package/dist/destinations/revend/viewItemList/index.js.map +1 -0
- package/dist/destinations/revend/viewPromotion/generated-types.d.ts +42 -0
- package/dist/destinations/revend/viewPromotion/generated-types.js +3 -0
- package/dist/destinations/revend/viewPromotion/generated-types.js.map +1 -0
- package/dist/destinations/revend/viewPromotion/index.d.ts +5 -0
- package/dist/destinations/revend/viewPromotion/index.js +96 -0
- package/dist/destinations/revend/viewPromotion/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.timestamp_micros = exports.engagement_time_msec = exports.items_multi_products = exports.items_single_products = exports.minimal_items = exports.payment_type = exports.coupon = exports.value = exports.currency = exports.client_id = exports.affiliation = exports.transaction_id = exports.shipping = exports.tax = exports.creative_name = exports.creative_slot = exports.promotion_name = exports.promotion_id = exports.user_id = exports.params = exports.user_properties = exports.formatUserProperties = void 0;
|
|
4
|
+
const formatUserProperties = (userProperties) => {
|
|
5
|
+
if (!userProperties) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
let properties = {};
|
|
9
|
+
Object.entries(userProperties).forEach(([key, value]) => {
|
|
10
|
+
properties = { ...properties, ...{ [key]: { value: value } } };
|
|
11
|
+
});
|
|
12
|
+
return { user_properties: properties };
|
|
13
|
+
};
|
|
14
|
+
exports.formatUserProperties = formatUserProperties;
|
|
15
|
+
exports.user_properties = {
|
|
16
|
+
label: 'User Properties',
|
|
17
|
+
description: 'The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s [Custom user properties](https://support.google.com/analytics/answer/9269570) to learn how to set and register user properties. ',
|
|
18
|
+
type: 'object',
|
|
19
|
+
additionalProperties: true,
|
|
20
|
+
defaultObjectUI: 'keyvalue'
|
|
21
|
+
};
|
|
22
|
+
exports.params = {
|
|
23
|
+
label: 'Event Parameters',
|
|
24
|
+
description: 'The event parameters to send to Google Analytics 4.',
|
|
25
|
+
type: 'object',
|
|
26
|
+
additionalProperties: true,
|
|
27
|
+
defaultObjectUI: 'keyvalue'
|
|
28
|
+
};
|
|
29
|
+
exports.user_id = {
|
|
30
|
+
label: 'User ID',
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: "A unique identifier for a user. See Google's [User-ID for cross-platform analysis](https://support.google.com/analytics/answer/9213390) and [Reporting: deduplicate user counts](https://support.google.com/analytics/answer/9355949?hl=en) documentation for more information on this identifier."
|
|
33
|
+
};
|
|
34
|
+
exports.promotion_id = {
|
|
35
|
+
label: 'Promotion ID',
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'The ID of the promotion associated with the event.'
|
|
38
|
+
};
|
|
39
|
+
exports.promotion_name = {
|
|
40
|
+
label: 'Promotion Name',
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'The name of the promotion associated with the event.'
|
|
43
|
+
};
|
|
44
|
+
exports.creative_slot = {
|
|
45
|
+
label: 'Creative Slot',
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'The name of the promotional creative slot associated with the event.'
|
|
48
|
+
};
|
|
49
|
+
exports.creative_name = {
|
|
50
|
+
label: 'Creative Name',
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The name of the promotional creative.'
|
|
53
|
+
};
|
|
54
|
+
exports.tax = {
|
|
55
|
+
label: 'Tax',
|
|
56
|
+
type: 'number',
|
|
57
|
+
description: 'Total tax associated with the transaction.',
|
|
58
|
+
default: {
|
|
59
|
+
'@path': '$.properties.tax'
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.shipping = {
|
|
63
|
+
label: 'Shipping',
|
|
64
|
+
type: 'number',
|
|
65
|
+
description: 'Shipping cost associated with the transaction.',
|
|
66
|
+
default: {
|
|
67
|
+
'@path': '$.properties.shipping'
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.transaction_id = {
|
|
71
|
+
label: 'Order Id',
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'The unique identifier of a transaction.',
|
|
74
|
+
default: {
|
|
75
|
+
'@path': '$.properties.order_id'
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.affiliation = {
|
|
79
|
+
label: 'Affiliation',
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'Store or affiliation from which this transaction occurred (e.g. Google Store).',
|
|
82
|
+
default: {
|
|
83
|
+
'@path': '$.properties.affiliation'
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports.client_id = {
|
|
87
|
+
label: 'Client ID',
|
|
88
|
+
description: 'Uniquely identifies a user instance of a web client.',
|
|
89
|
+
type: 'string',
|
|
90
|
+
required: true,
|
|
91
|
+
default: {
|
|
92
|
+
'@if': {
|
|
93
|
+
exists: { '@path': '$.userId' },
|
|
94
|
+
then: { '@path': '$.userId' },
|
|
95
|
+
else: { '@path': '$.anonymousId' }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
exports.currency = {
|
|
100
|
+
label: 'Currency',
|
|
101
|
+
type: 'string',
|
|
102
|
+
description: 'Currency of the items associated with the event, in 3-letter ISO 4217 format.',
|
|
103
|
+
default: { '@path': '$.properties.currency' }
|
|
104
|
+
};
|
|
105
|
+
exports.value = {
|
|
106
|
+
label: 'Value',
|
|
107
|
+
type: 'number',
|
|
108
|
+
description: 'The monetary value of the event.',
|
|
109
|
+
default: {
|
|
110
|
+
'@path': '$.properties.value'
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
exports.coupon = {
|
|
114
|
+
label: 'Coupon',
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'Coupon code used for a purchase.'
|
|
117
|
+
};
|
|
118
|
+
exports.payment_type = {
|
|
119
|
+
label: 'Payment Type',
|
|
120
|
+
type: 'string',
|
|
121
|
+
description: 'The chosen method of payment.',
|
|
122
|
+
default: {
|
|
123
|
+
'@path': '$.properties.payment_method'
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
exports.minimal_items = {
|
|
127
|
+
label: 'Products',
|
|
128
|
+
description: 'The list of products purchased.',
|
|
129
|
+
type: 'object',
|
|
130
|
+
multiple: true,
|
|
131
|
+
properties: {
|
|
132
|
+
item_id: {
|
|
133
|
+
label: 'Product ID',
|
|
134
|
+
type: 'string',
|
|
135
|
+
description: 'Identifier for the product being purchased.'
|
|
136
|
+
},
|
|
137
|
+
item_name: {
|
|
138
|
+
label: 'Name',
|
|
139
|
+
type: 'string',
|
|
140
|
+
description: 'Name of the product being purchased.'
|
|
141
|
+
},
|
|
142
|
+
affiliation: {
|
|
143
|
+
label: 'Affiliation',
|
|
144
|
+
type: 'string',
|
|
145
|
+
description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
|
|
146
|
+
},
|
|
147
|
+
coupon: {
|
|
148
|
+
label: 'Coupon',
|
|
149
|
+
type: 'string',
|
|
150
|
+
description: 'Coupon code used for a purchase.'
|
|
151
|
+
},
|
|
152
|
+
currency: {
|
|
153
|
+
label: 'Currency',
|
|
154
|
+
type: 'string',
|
|
155
|
+
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
156
|
+
},
|
|
157
|
+
discount: {
|
|
158
|
+
label: 'Discount',
|
|
159
|
+
type: 'number',
|
|
160
|
+
description: 'Monetary value of discount associated with a purchase.'
|
|
161
|
+
},
|
|
162
|
+
index: {
|
|
163
|
+
label: 'Index',
|
|
164
|
+
type: 'number',
|
|
165
|
+
description: 'The index/position of the item in a list.'
|
|
166
|
+
},
|
|
167
|
+
item_brand: {
|
|
168
|
+
label: 'Brand',
|
|
169
|
+
type: 'string',
|
|
170
|
+
description: 'Brand associated with the product.'
|
|
171
|
+
},
|
|
172
|
+
item_category: {
|
|
173
|
+
label: 'Category',
|
|
174
|
+
type: 'string',
|
|
175
|
+
description: 'Product category.'
|
|
176
|
+
},
|
|
177
|
+
item_category2: {
|
|
178
|
+
label: 'Category 2',
|
|
179
|
+
type: 'string',
|
|
180
|
+
description: 'Product category 2.'
|
|
181
|
+
},
|
|
182
|
+
item_category3: {
|
|
183
|
+
label: 'Category 3',
|
|
184
|
+
type: 'string',
|
|
185
|
+
description: 'Product category 3.'
|
|
186
|
+
},
|
|
187
|
+
item_category4: {
|
|
188
|
+
label: 'Category 4',
|
|
189
|
+
type: 'string',
|
|
190
|
+
description: 'Product category 4.'
|
|
191
|
+
},
|
|
192
|
+
item_category5: {
|
|
193
|
+
label: 'Category 5',
|
|
194
|
+
type: 'string',
|
|
195
|
+
description: 'Product category 5.'
|
|
196
|
+
},
|
|
197
|
+
item_list_id: {
|
|
198
|
+
label: 'Item List ID',
|
|
199
|
+
type: 'string',
|
|
200
|
+
description: 'The ID of the list in which the item was presented to the user.'
|
|
201
|
+
},
|
|
202
|
+
item_list_name: {
|
|
203
|
+
label: 'Item List Name',
|
|
204
|
+
type: 'string',
|
|
205
|
+
description: 'The name of the list in which the item was presented to the user.'
|
|
206
|
+
},
|
|
207
|
+
item_variant: {
|
|
208
|
+
label: 'Variant',
|
|
209
|
+
type: 'string',
|
|
210
|
+
description: 'Variant of the product (e.g. Black).'
|
|
211
|
+
},
|
|
212
|
+
location_id: {
|
|
213
|
+
label: 'Location ID',
|
|
214
|
+
type: 'string',
|
|
215
|
+
description: 'The location associated with the item.'
|
|
216
|
+
},
|
|
217
|
+
price: {
|
|
218
|
+
label: 'Price',
|
|
219
|
+
type: 'number',
|
|
220
|
+
description: 'Price of the product being purchased, in units of the specified currency parameter.'
|
|
221
|
+
},
|
|
222
|
+
quantity: {
|
|
223
|
+
label: 'Quantity',
|
|
224
|
+
type: 'integer',
|
|
225
|
+
description: 'Item quantity.'
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
exports.items_single_products = {
|
|
230
|
+
...exports.minimal_items,
|
|
231
|
+
default: {
|
|
232
|
+
'@arrayPath': [
|
|
233
|
+
'$.properties',
|
|
234
|
+
{
|
|
235
|
+
item_id: {
|
|
236
|
+
'@path': '$.product_id'
|
|
237
|
+
},
|
|
238
|
+
item_name: {
|
|
239
|
+
'@path': '$.name'
|
|
240
|
+
},
|
|
241
|
+
affiliation: {
|
|
242
|
+
'@path': '$.affiliation'
|
|
243
|
+
},
|
|
244
|
+
coupon: {
|
|
245
|
+
'@path': '$.coupon'
|
|
246
|
+
},
|
|
247
|
+
item_brand: {
|
|
248
|
+
'@path': '$.brand'
|
|
249
|
+
},
|
|
250
|
+
item_category: {
|
|
251
|
+
'@path': '$.category'
|
|
252
|
+
},
|
|
253
|
+
item_variant: {
|
|
254
|
+
'@path': '$.variant'
|
|
255
|
+
},
|
|
256
|
+
price: {
|
|
257
|
+
'@path': '$.price'
|
|
258
|
+
},
|
|
259
|
+
quantity: {
|
|
260
|
+
'@path': '$.quantity'
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
exports.items_multi_products = {
|
|
267
|
+
...exports.minimal_items,
|
|
268
|
+
default: {
|
|
269
|
+
'@arrayPath': [
|
|
270
|
+
'$.properties.products',
|
|
271
|
+
{
|
|
272
|
+
item_id: {
|
|
273
|
+
'@path': '$.product_id'
|
|
274
|
+
},
|
|
275
|
+
item_name: {
|
|
276
|
+
'@path': '$.name'
|
|
277
|
+
},
|
|
278
|
+
affiliation: {
|
|
279
|
+
'@path': '$.affiliation'
|
|
280
|
+
},
|
|
281
|
+
coupon: {
|
|
282
|
+
'@path': '$.coupon'
|
|
283
|
+
},
|
|
284
|
+
index: {
|
|
285
|
+
'@path': '$.position'
|
|
286
|
+
},
|
|
287
|
+
item_brand: {
|
|
288
|
+
'@path': '$.brand'
|
|
289
|
+
},
|
|
290
|
+
item_category: {
|
|
291
|
+
'@path': '$.category'
|
|
292
|
+
},
|
|
293
|
+
item_variant: {
|
|
294
|
+
'@path': '$.variant'
|
|
295
|
+
},
|
|
296
|
+
price: {
|
|
297
|
+
'@path': '$.price'
|
|
298
|
+
},
|
|
299
|
+
quantity: {
|
|
300
|
+
'@path': '$.quantity'
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
exports.engagement_time_msec = {
|
|
307
|
+
label: 'Engagement Time in Milliseconds',
|
|
308
|
+
type: 'number',
|
|
309
|
+
description: 'The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.',
|
|
310
|
+
default: 1
|
|
311
|
+
};
|
|
312
|
+
exports.timestamp_micros = {
|
|
313
|
+
label: 'Event Timestamp',
|
|
314
|
+
type: 'string',
|
|
315
|
+
description: "A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.",
|
|
316
|
+
default: {
|
|
317
|
+
'@path': '$.timestamp'
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
//# sourceMappingURL=ga4-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ga4-properties.js","sourceRoot":"","sources":["../../../src/destinations/revend/ga4-properties.ts"],"names":[],"mappings":";;;AAEO,MAAM,oBAAoB,GAAG,CAAC,cAAkC,EAAsB,EAAE;IAC7F,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,SAAS,CAAA;KACjB;IAED,IAAI,UAAU,GAAG,EAAE,CAAA;IAEnB,MAAM,CAAC,OAAO,CAAC,cAAc,CA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,QAAQ;IACd,WAAW,EACT,qNAAqN;IACvN,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ProductItem {
|
|
2
|
+
item_id?: string;
|
|
3
|
+
item_name?: string;
|
|
4
|
+
affiliation?: string;
|
|
5
|
+
coupon?: string;
|
|
6
|
+
currency?: string;
|
|
7
|
+
discount?: number;
|
|
8
|
+
index?: number;
|
|
9
|
+
item_brand?: string;
|
|
10
|
+
item_category?: string;
|
|
11
|
+
item_category2?: string;
|
|
12
|
+
item_category3?: string;
|
|
13
|
+
item_category4?: string;
|
|
14
|
+
item_category5?: string;
|
|
15
|
+
item_list_id?: string;
|
|
16
|
+
item_list_name?: string;
|
|
17
|
+
item_variant?: string;
|
|
18
|
+
location_id?: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
quantity?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface PromotionProductItem extends ProductItem {
|
|
23
|
+
creative_name?: string;
|
|
24
|
+
creative_slot?: string;
|
|
25
|
+
promotion_id?: string;
|
|
26
|
+
promotion_name?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ga4-types.js","sourceRoot":"","sources":["../../../src/destinations/revend/ga4-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
client_id: string;
|
|
3
|
+
user_id?: string;
|
|
4
|
+
timestamp_micros?: string;
|
|
5
|
+
currency?: string;
|
|
6
|
+
value?: number;
|
|
7
|
+
user_properties?: {
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
engagement_time_msec?: number;
|
|
11
|
+
params?: {
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/revend/generateLead/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
|
+
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
+
const action = {
|
|
7
|
+
title: 'Generate Lead',
|
|
8
|
+
description: 'Send event when a user submits a form or request for information',
|
|
9
|
+
defaultSubscription: 'type = "track"',
|
|
10
|
+
fields: {
|
|
11
|
+
client_id: { ...ga4_properties_1.client_id },
|
|
12
|
+
user_id: { ...ga4_properties_1.user_id },
|
|
13
|
+
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
14
|
+
currency: { ...ga4_properties_1.currency },
|
|
15
|
+
value: { ...ga4_properties_1.value },
|
|
16
|
+
user_properties: ga4_properties_1.user_properties,
|
|
17
|
+
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
18
|
+
params: ga4_properties_1.params
|
|
19
|
+
},
|
|
20
|
+
perform: (request, { payload, features }) => {
|
|
21
|
+
if (payload.currency) {
|
|
22
|
+
ga4_functions_1.verifyCurrency(payload.currency);
|
|
23
|
+
}
|
|
24
|
+
if (payload.value && payload.currency === undefined) {
|
|
25
|
+
throw new actions_core_1.IntegrationError('Currency is required if value is set.', 'Misconfigured required field', 400);
|
|
26
|
+
}
|
|
27
|
+
if (features && features['actions-google-analytics-4-verify-params-feature']) {
|
|
28
|
+
ga4_functions_1.verifyParams(payload.params);
|
|
29
|
+
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
30
|
+
}
|
|
31
|
+
const request_object = {
|
|
32
|
+
client_id: payload.client_id,
|
|
33
|
+
user_id: payload.user_id,
|
|
34
|
+
events: [
|
|
35
|
+
{
|
|
36
|
+
name: 'generate_lead',
|
|
37
|
+
params: {
|
|
38
|
+
currency: payload.currency,
|
|
39
|
+
value: payload.value,
|
|
40
|
+
engagement_time_msec: payload.engagement_time_msec,
|
|
41
|
+
...payload.params
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
...ga4_properties_1.formatUserProperties(payload.user_properties)
|
|
46
|
+
};
|
|
47
|
+
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
48
|
+
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
49
|
+
}
|
|
50
|
+
return request('https://gtmadapter-node-cbjg5cz5hq-ew.a.run.app/v2/consolidated-data', {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
json: request_object
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.default = action;
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/revend/generateLead/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAAkG;AAGlG,sDAU0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kEAAkE;IAC/E,mBAAmB,EAAE,gBAAgB;IACrC,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,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;QAGD,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;YACnD,MAAM,IAAI,+BAAgB,CAAC,uCAAuC,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;SACzG;QAED,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;QAED,MAAM,cAAc,GAA2B;YAC7C,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,eAAe;oBACrB,MAAM,EAAE;wBACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,KAAK,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,sEAAsE,EAAE;YACrF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/revend/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const purchase_1 = __importDefault(require("./purchase"));
|
|
7
|
+
const addToCart_1 = __importDefault(require("./addToCart"));
|
|
8
|
+
const pageView_1 = __importDefault(require("./pageView"));
|
|
9
|
+
const customEvent_1 = __importDefault(require("./customEvent"));
|
|
10
|
+
const selectItem_1 = __importDefault(require("./selectItem"));
|
|
11
|
+
const beginCheckout_1 = __importDefault(require("./beginCheckout"));
|
|
12
|
+
const selectPromotion_1 = __importDefault(require("./selectPromotion"));
|
|
13
|
+
const viewItem_1 = __importDefault(require("./viewItem"));
|
|
14
|
+
const search_1 = __importDefault(require("./search"));
|
|
15
|
+
const viewItemList_1 = __importDefault(require("./viewItemList"));
|
|
16
|
+
const signUp_1 = __importDefault(require("./signUp"));
|
|
17
|
+
const viewPromotion_1 = __importDefault(require("./viewPromotion"));
|
|
18
|
+
const viewCart_1 = __importDefault(require("./viewCart"));
|
|
19
|
+
const login_1 = __importDefault(require("./login"));
|
|
20
|
+
const generateLead_1 = __importDefault(require("./generateLead"));
|
|
21
|
+
const addToWishlist_1 = __importDefault(require("./addToWishlist"));
|
|
22
|
+
const addPaymentInfo_1 = __importDefault(require("./addPaymentInfo"));
|
|
23
|
+
const refund_1 = __importDefault(require("./refund"));
|
|
24
|
+
const removeFromCart_1 = __importDefault(require("./removeFromCart"));
|
|
25
|
+
const destination = {
|
|
26
|
+
name: 'Revend Actions',
|
|
27
|
+
slug: 'revend-actions',
|
|
28
|
+
mode: 'cloud',
|
|
29
|
+
authentication: {
|
|
30
|
+
scheme: 'custom',
|
|
31
|
+
fields: {
|
|
32
|
+
apiSecret: {
|
|
33
|
+
label: 'API Secret',
|
|
34
|
+
description: 'An API SECRET generated for endpoint usage',
|
|
35
|
+
type: 'string',
|
|
36
|
+
required: true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
extendRequest({ settings }) {
|
|
41
|
+
return {
|
|
42
|
+
headers: {
|
|
43
|
+
token: settings.apiSecret
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
actions: {
|
|
48
|
+
purchase: purchase_1.default,
|
|
49
|
+
addToCart: addToCart_1.default,
|
|
50
|
+
pageView: pageView_1.default,
|
|
51
|
+
customEvent: customEvent_1.default,
|
|
52
|
+
selectItem: selectItem_1.default,
|
|
53
|
+
beginCheckout: beginCheckout_1.default,
|
|
54
|
+
selectPromotion: selectPromotion_1.default,
|
|
55
|
+
viewItem: viewItem_1.default,
|
|
56
|
+
removeFromCart: removeFromCart_1.default,
|
|
57
|
+
viewCart: viewCart_1.default,
|
|
58
|
+
search: search_1.default,
|
|
59
|
+
viewItemList: viewItemList_1.default,
|
|
60
|
+
signUp: signUp_1.default,
|
|
61
|
+
viewPromotion: viewPromotion_1.default,
|
|
62
|
+
addPaymentInfo: addPaymentInfo_1.default,
|
|
63
|
+
refund: refund_1.default,
|
|
64
|
+
login: login_1.default,
|
|
65
|
+
generateLead: generateLead_1.default,
|
|
66
|
+
addToWishlist: addToWishlist_1.default
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.default = destination;
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/revend/index.ts"],"names":[],"mappings":";;;;;AAEA,0DAAiC;AACjC,4DAAmC;AACnC,0DAAiC;AACjC,gEAAuC;AACvC,8DAAqC;AACrC,oEAA2C;AAC3C,wEAA+C;AAC/C,0DAAiC;AACjC,sDAA6B;AAC7B,kEAAyC;AACzC,sDAA6B;AAC7B,oEAA2C;AAC3C,0DAAiC;AACjC,oDAA2B;AAC3B,kEAAyC;AACzC,oEAA2C;AAC3C,sEAA6C;AAC7C,sDAA6B;AAC7B,sEAA6C;AAE7C,MAAM,WAAW,GAAoC;IAGnD,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,4CAA4C;gBACzD,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,KAAK,EAAE,QAAQ,CAAC,SAAS;aAC1B;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,QAAQ,EAAR,kBAAQ;QACR,SAAS,EAAT,mBAAS;QACT,QAAQ,EAAR,kBAAQ;QACR,WAAW,EAAX,qBAAW;QACX,UAAU,EAAV,oBAAU;QACV,aAAa,EAAb,uBAAa;QACb,eAAe,EAAf,yBAAe;QACf,QAAQ,EAAR,kBAAQ;QACR,cAAc,EAAd,wBAAc;QACd,QAAQ,EAAR,kBAAQ;QACR,MAAM,EAAN,gBAAM;QACN,YAAY,EAAZ,sBAAY;QACZ,MAAM,EAAN,gBAAM;QACN,aAAa,EAAb,uBAAa;QACb,cAAc,EAAd,wBAAc;QACd,MAAM,EAAN,gBAAM;QACN,KAAK,EAAL,eAAK;QACL,YAAY,EAAZ,sBAAY;QACZ,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/revend/login/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
4
|
+
const ga4_properties_1 = require("../ga4-properties");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Login',
|
|
7
|
+
description: 'Send event when a user logs in',
|
|
8
|
+
defaultSubscription: 'type = "track" and event = "Signed In"',
|
|
9
|
+
fields: {
|
|
10
|
+
client_id: { ...ga4_properties_1.client_id },
|
|
11
|
+
user_id: { ...ga4_properties_1.user_id },
|
|
12
|
+
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
13
|
+
method: {
|
|
14
|
+
label: 'Method',
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'The method used to login.'
|
|
17
|
+
},
|
|
18
|
+
user_properties: ga4_properties_1.user_properties,
|
|
19
|
+
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
20
|
+
params: ga4_properties_1.params
|
|
21
|
+
},
|
|
22
|
+
perform: (request, { payload, features }) => {
|
|
23
|
+
if (features && features['actions-google-analytics-4-verify-params-feature']) {
|
|
24
|
+
ga4_functions_1.verifyParams(payload.params);
|
|
25
|
+
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
26
|
+
}
|
|
27
|
+
const request_object = {
|
|
28
|
+
client_id: payload.client_id,
|
|
29
|
+
user_id: payload.user_id,
|
|
30
|
+
events: [
|
|
31
|
+
{
|
|
32
|
+
name: 'login',
|
|
33
|
+
params: {
|
|
34
|
+
method: payload.method,
|
|
35
|
+
engagement_time_msec: payload.engagement_time_msec,
|
|
36
|
+
...payload.params
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
...ga4_properties_1.formatUserProperties(payload.user_properties)
|
|
41
|
+
};
|
|
42
|
+
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
43
|
+
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
44
|
+
}
|
|
45
|
+
return request('https://gtmadapter-node-cbjg5cz5hq-ew.a.run.app/v2/consolidated-data', {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
json: request_object
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.default = action;
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/revend/login/index.ts"],"names":[],"mappings":";;AAGA,oDAAkF;AAClF,sDAQ0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,gCAAgC;IAC7C,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,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2BAA2B;SACzC;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IAED,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;QAED,MAAM,cAAc,GAA2B;YAC7C,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,OAAO;oBACb,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,sEAAsE,EAAE;YACrF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
clientId: string;
|
|
3
|
+
user_id?: string;
|
|
4
|
+
timestamp_micros?: string;
|
|
5
|
+
page_location?: string;
|
|
6
|
+
page_referrer?: string;
|
|
7
|
+
user_properties?: {
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
page_title?: string;
|
|
11
|
+
engagement_time_msec?: number;
|
|
12
|
+
params?: {
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
}
|