@segment/action-destinations 3.65.1-alpha.0 → 3.65.1-alpha.11

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.
Files changed (25) hide show
  1. package/dist/destinations/amplitude/index.js +2 -10
  2. package/dist/destinations/amplitude/index.js.map +1 -1
  3. package/dist/destinations/amplitude/logEvent/generated-types.d.ts +8 -0
  4. package/dist/destinations/amplitude/logEvent/index.d.ts +0 -3
  5. package/dist/destinations/amplitude/logEvent/index.js +170 -113
  6. package/dist/destinations/amplitude/logEvent/index.js.map +1 -1
  7. package/dist/destinations/index.js +1 -0
  8. package/dist/destinations/index.js.map +1 -1
  9. package/dist/destinations/snap-conversions-api/generated-types.d.ts +5 -0
  10. package/dist/destinations/{amplitude/logPurchase → snap-conversions-api}/generated-types.js +0 -0
  11. package/dist/destinations/snap-conversions-api/generated-types.js.map +1 -0
  12. package/dist/destinations/snap-conversions-api/index.d.ts +4 -0
  13. package/dist/destinations/snap-conversions-api/index.js +36 -0
  14. package/dist/destinations/snap-conversions-api/index.js.map +1 -0
  15. package/dist/destinations/snap-conversions-api/reportConversionEvent/generated-types.d.ts +2 -0
  16. package/dist/destinations/snap-conversions-api/reportConversionEvent/generated-types.js +3 -0
  17. package/dist/destinations/snap-conversions-api/reportConversionEvent/generated-types.js.map +1 -0
  18. package/dist/destinations/{amplitude/logPurchase → snap-conversions-api/reportConversionEvent}/index.d.ts +0 -0
  19. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +12 -0
  20. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -0
  21. package/package.json +2 -2
  22. package/dist/destinations/amplitude/logPurchase/generated-types.d.ts +0 -64
  23. package/dist/destinations/amplitude/logPurchase/generated-types.js.map +0 -1
  24. package/dist/destinations/amplitude/logPurchase/index.js +0 -93
  25. package/dist/destinations/amplitude/logPurchase/index.js.map +0 -1
@@ -6,23 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const actions_core_1 = require("@segment/actions-core");
7
7
  const identifyUser_1 = __importDefault(require("./identifyUser"));
8
8
  const logEvent_1 = __importDefault(require("./logEvent"));
9
- const logPurchase_1 = __importDefault(require("./logPurchase"));
10
9
  const mapUser_1 = __importDefault(require("./mapUser"));
11
10
  const groupIdentifyUser_1 = __importDefault(require("./groupIdentifyUser"));
12
11
  const regional_endpoints_1 = require("./regional-endpoints");
13
12
  const presets = [
14
13
  {
15
14
  name: 'Track Calls',
16
- subscribe: 'type = "track" and event != "Order Completed"',
15
+ subscribe: 'type = "track"',
17
16
  partnerAction: 'logEvent',
18
17
  mapping: actions_core_1.defaultValues(logEvent_1.default.fields)
19
18
  },
20
- {
21
- name: 'Order Completed Calls',
22
- subscribe: 'type = "track" and event = "Order Completed"',
23
- partnerAction: 'logPurchase',
24
- mapping: actions_core_1.defaultValues(logPurchase_1.default.fields)
25
- },
26
19
  {
27
20
  name: 'Page Calls',
28
21
  subscribe: 'type = "page"',
@@ -118,8 +111,7 @@ const destination = {
118
111
  logEvent: logEvent_1.default,
119
112
  identifyUser: identifyUser_1.default,
120
113
  mapUser: mapUser_1.default,
121
- groupIdentifyUser: groupIdentifyUser_1.default,
122
- logPurchase: logPurchase_1.default
114
+ groupIdentifyUser: groupIdentifyUser_1.default
123
115
  }
124
116
  };
125
117
  exports.default = destination;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/amplitude/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AACrD,kEAAyC;AACzC,0DAAiC;AACjC,gEAAuC;AACvC,wDAA+B;AAC/B,4EAAmD;AAEnD,6DAA0D;AAG1D,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,+CAA+C;QAC1D,aAAa,EAAE,UAAU;QACzB,OAAO,EAAE,4BAAa,CAAC,kBAAQ,CAAC,MAAM,CAAC;KACxC;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B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;QACZ,OAAO,EAAP,iBAAO;QACP,iBAAiB,EAAjB,2BAAiB;KAClB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export interface Payload {
2
+ trackRevenuePerProduct?: boolean;
2
3
  user_id?: string | null;
3
4
  device_id?: string;
4
5
  event_type: string;
@@ -41,6 +42,13 @@ export interface Payload {
41
42
  event_id?: number;
42
43
  insert_id?: string;
43
44
  library?: string;
45
+ products?: {
46
+ price?: number;
47
+ quantity?: number;
48
+ revenue?: number;
49
+ productId?: string;
50
+ revenueType?: string;
51
+ }[];
44
52
  use_batch_endpoint?: boolean;
45
53
  userAgent?: string;
46
54
  userAgentParsing?: boolean;
@@ -1,7 +1,6 @@
1
1
  import type { ActionDefinition } from '@segment/actions-core';
2
2
  import type { Settings } from '../generated-types';
3
3
  import type { Payload } from './generated-types';
4
- import { InputField } from '@segment/actions-core';
5
4
  export interface AmplitudeEvent extends Omit<Payload, 'products' | 'trackRevenuePerProduct' | 'time' | 'session_id'> {
6
5
  library?: string;
7
6
  time?: number;
@@ -10,7 +9,5 @@ export interface AmplitudeEvent extends Omit<Payload, 'products' | 'trackRevenue
10
9
  min_id_length: number;
11
10
  };
12
11
  }
13
- export declare function doPerform(request: Function, payload: Payload, settings: Settings, eventFunction: Function): any;
14
- export declare const fields: Record<string, InputField>;
15
12
  declare const action: ActionDefinition<Settings, Payload>;
16
13
  export default action;
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.fields = exports.doPerform = void 0;
7
6
  const actions_core_1 = require("@segment/actions-core");
8
7
  const dayjs_1 = __importDefault(require("../../../lib/dayjs"));
9
8
  const event_schema_1 = require("../event-schema");
@@ -13,128 +12,186 @@ const merge_user_properties_1 = require("../merge-user-properties");
13
12
  const user_agent_1 = require("../user-agent");
14
13
  const regional_endpoints_1 = require("../regional-endpoints");
15
14
  const revenueKeys = ['revenue', 'price', 'productId', 'quantity', 'revenueType'];
16
- function getEvents(payload, properties) {
17
- const events = [
18
- {
19
- ...(payload.userAgentParsing && user_agent_1.parseUserAgentProperties(payload.userAgent)),
20
- ...actions_core_1.removeUndefined(properties),
21
- library: 'segment'
22
- }
23
- ];
24
- return events;
25
- }
26
- function doPerform(request, payload, settings, eventFunction) {
27
- const { time, session_id, userAgent, userAgentParsing, utm_properties, referrer, min_id_length, library, ...rest } = actions_core_1.omit(payload, revenueKeys);
28
- const properties = rest;
29
- let options;
30
- if (properties.platform) {
31
- properties.platform = properties.platform.replace(/ios/i, 'iOS').replace(/android/i, 'Android');
32
- }
33
- if (library) {
34
- if (library === 'analytics.js')
35
- properties.platform = 'Web';
36
- }
37
- if (time && dayjs_1.default.utc(time).isValid()) {
38
- properties.time = dayjs_1.default.utc(time).valueOf();
39
- }
40
- if (session_id && dayjs_1.default.utc(session_id).isValid()) {
41
- properties.session_id = dayjs_1.default.utc(session_id).valueOf();
15
+ function getRevenueProperties(payload) {
16
+ if (typeof payload.revenue !== 'number') {
17
+ return {};
42
18
  }
43
- if (Object.keys(payload.utm_properties ?? {}).length || payload.referrer) {
44
- properties.user_properties = merge_user_properties_1.mergeUserProperties(utm_1.convertUTMProperties({ utm_properties }), referrer_1.convertReferrerProperty({ referrer }), actions_core_1.omit(properties.user_properties ?? {}, ['utm_properties', 'referrer']));
45
- }
46
- if (min_id_length && min_id_length > 0) {
47
- options = { min_id_length };
48
- }
49
- const events = eventFunction(payload, properties);
50
- const endpoint = regional_endpoints_1.getEndpointByRegion(payload.use_batch_endpoint ? 'batch' : 'httpapi', settings.endpoint);
51
- return request(endpoint, {
52
- method: 'post',
53
- json: {
54
- api_key: settings.apiKey,
55
- events,
56
- options
57
- }
58
- });
19
+ return {
20
+ revenue: payload.revenue,
21
+ revenueType: payload.revenueType ?? 'Purchase',
22
+ quantity: typeof payload.quantity === 'number' ? Math.round(payload.quantity) : undefined,
23
+ price: payload.price,
24
+ productId: payload.productId
25
+ };
59
26
  }
60
- exports.doPerform = doPerform;
61
- exports.fields = {
62
- ...event_schema_1.eventSchema,
63
- use_batch_endpoint: {
64
- label: 'Use Batch Endpoint',
65
- description: "If true, events are sent to Amplitude's `batch` endpoint rather than their `httpapi` events endpoint. Enabling this setting may help reduce 429s – or throttling errors – from Amplitude. More information about Amplitude's throttling is available in [their docs](https://developers.amplitude.com/docs/batch-event-upload-api#429s-in-depth).",
66
- type: 'boolean',
67
- default: false
68
- },
69
- userAgent: {
70
- label: 'User Agent',
71
- type: 'string',
72
- description: 'The user agent of the device sending the event.',
73
- default: {
74
- '@path': '$.context.userAgent'
75
- }
76
- },
77
- userAgentParsing: {
78
- label: 'User Agent Parsing',
79
- type: 'boolean',
80
- description: 'Enabling this setting will set the Device manufacturer, Device Model and OS Name properties based on the user agent string provided in the userAgent field',
81
- default: true
82
- },
83
- utm_properties: {
84
- label: 'UTM Properties',
85
- type: 'object',
86
- description: 'UTM Tracking Properties',
87
- properties: {
88
- utm_source: {
89
- label: 'UTM Source',
90
- type: 'string'
91
- },
92
- utm_medium: {
93
- label: 'UTM Medium',
94
- type: 'string'
95
- },
96
- utm_campaign: {
97
- label: 'UTM Campaign',
98
- type: 'string'
27
+ const action = {
28
+ title: 'Log Event',
29
+ description: 'Send an event to Amplitude.',
30
+ defaultSubscription: 'type = "track"',
31
+ fields: {
32
+ trackRevenuePerProduct: {
33
+ label: 'Track Revenue Per Product',
34
+ description: 'When enabled, track revenue with each product within the event. When disabled, track total revenue once for the event.',
35
+ type: 'boolean',
36
+ default: false
37
+ },
38
+ ...event_schema_1.eventSchema,
39
+ products: {
40
+ label: 'Products',
41
+ description: 'The list of products purchased.',
42
+ type: 'object',
43
+ multiple: true,
44
+ properties: {
45
+ price: {
46
+ label: 'Price',
47
+ type: 'number',
48
+ description: 'The price of the item purchased. Required for revenue data if the revenue field is not sent. You can use negative values to indicate refunds.'
49
+ },
50
+ quantity: {
51
+ label: 'Quantity',
52
+ type: 'integer',
53
+ description: 'The quantity of the item purchased. Defaults to 1 if not specified.'
54
+ },
55
+ revenue: {
56
+ label: 'Revenue',
57
+ type: 'number',
58
+ description: 'Revenue = price * quantity. If you send all 3 fields of price, quantity, and revenue, then (price * quantity) will be used as the revenue value. You can use negative values to indicate refunds.'
59
+ },
60
+ productId: {
61
+ label: 'Product ID',
62
+ type: 'string',
63
+ description: 'An identifier for the item purchased. You must send a price and quantity or revenue with this field.'
64
+ },
65
+ revenueType: {
66
+ label: 'Revenue Type',
67
+ type: 'string',
68
+ description: 'The type of revenue for the item purchased. You must send a price and quantity or revenue with this field.'
69
+ }
99
70
  },
100
- utm_term: {
101
- label: 'UTM Term',
102
- type: 'string'
71
+ default: {
72
+ '@path': '$.properties.products'
73
+ }
74
+ },
75
+ use_batch_endpoint: {
76
+ label: 'Use Batch Endpoint',
77
+ description: "If true, events are sent to Amplitude's `batch` endpoint rather than their `httpapi` events endpoint. Enabling this setting may help reduce 429s – or throttling errors – from Amplitude. More information about Amplitude's throttling is available in [their docs](https://developers.amplitude.com/docs/batch-event-upload-api#429s-in-depth).",
78
+ type: 'boolean',
79
+ default: false
80
+ },
81
+ userAgent: {
82
+ label: 'User Agent',
83
+ type: 'string',
84
+ description: 'The user agent of the device sending the event.',
85
+ default: {
86
+ '@path': '$.context.userAgent'
87
+ }
88
+ },
89
+ userAgentParsing: {
90
+ label: 'User Agent Parsing',
91
+ type: 'boolean',
92
+ description: 'Enabling this setting will set the Device manufacturer, Device Model and OS Name properties based on the user agent string provided in the userAgent field',
93
+ default: true
94
+ },
95
+ utm_properties: {
96
+ label: 'UTM Properties',
97
+ type: 'object',
98
+ description: 'UTM Tracking Properties',
99
+ properties: {
100
+ utm_source: {
101
+ label: 'UTM Source',
102
+ type: 'string'
103
+ },
104
+ utm_medium: {
105
+ label: 'UTM Medium',
106
+ type: 'string'
107
+ },
108
+ utm_campaign: {
109
+ label: 'UTM Campaign',
110
+ type: 'string'
111
+ },
112
+ utm_term: {
113
+ label: 'UTM Term',
114
+ type: 'string'
115
+ },
116
+ utm_content: {
117
+ label: 'UTM Content',
118
+ type: 'string'
119
+ }
103
120
  },
104
- utm_content: {
105
- label: 'UTM Content',
106
- type: 'string'
121
+ default: {
122
+ utm_source: { '@path': '$.context.campaign.source' },
123
+ utm_medium: { '@path': '$.context.campaign.medium' },
124
+ utm_campaign: { '@path': '$.context.campaign.name' },
125
+ utm_term: { '@path': '$.context.campaign.term' },
126
+ utm_content: { '@path': '$.context.campaign.content' }
127
+ }
128
+ },
129
+ referrer: {
130
+ label: 'Referrer',
131
+ type: 'string',
132
+ description: 'The referrer of the web request. Sent to Amplitude as both last touch “referrer” and first touch “initial_referrer”',
133
+ default: {
134
+ '@path': '$.context.page.referrer'
107
135
  }
108
136
  },
109
- default: {
110
- utm_source: { '@path': '$.context.campaign.source' },
111
- utm_medium: { '@path': '$.context.campaign.medium' },
112
- utm_campaign: { '@path': '$.context.campaign.name' },
113
- utm_term: { '@path': '$.context.campaign.term' },
114
- utm_content: { '@path': '$.context.campaign.content' }
137
+ min_id_length: {
138
+ label: 'Minimum ID Length',
139
+ description: 'Amplitude has a default minimum id lenght of 5 characters for user_id and device_id fields. This field allows the minimum to be overridden to allow shorter id lengths.',
140
+ allowNull: true,
141
+ type: 'integer'
115
142
  }
116
143
  },
117
- referrer: {
118
- label: 'Referrer',
119
- type: 'string',
120
- description: 'The referrer of the web request. Sent to Amplitude as both last touch “referrer” and first touch “initial_referrer”',
121
- default: {
122
- '@path': '$.context.page.referrer'
144
+ perform: (request, { payload, settings }) => {
145
+ const { products = [], trackRevenuePerProduct, time, session_id, userAgent, userAgentParsing, utm_properties, referrer, min_id_length, library, ...rest } = actions_core_1.omit(payload, revenueKeys);
146
+ const properties = rest;
147
+ let options;
148
+ if (properties.platform) {
149
+ properties.platform = properties.platform.replace(/ios/i, 'iOS').replace(/android/i, 'Android');
123
150
  }
124
- },
125
- min_id_length: {
126
- label: 'Minimum ID Length',
127
- description: 'Amplitude has a default minimum id lenght of 5 characters for user_id and device_id fields. This field allows the minimum to be overridden to allow shorter id lengths.',
128
- allowNull: true,
129
- type: 'integer'
151
+ if (library) {
152
+ if (library === 'analytics.js')
153
+ properties.platform = 'Web';
154
+ }
155
+ if (time && dayjs_1.default.utc(time).isValid()) {
156
+ properties.time = dayjs_1.default.utc(time).valueOf();
157
+ }
158
+ if (session_id && dayjs_1.default.utc(session_id).isValid()) {
159
+ properties.session_id = dayjs_1.default.utc(session_id).valueOf();
160
+ }
161
+ if (Object.keys(payload.utm_properties ?? {}).length || payload.referrer) {
162
+ properties.user_properties = merge_user_properties_1.mergeUserProperties(utm_1.convertUTMProperties({ utm_properties }), referrer_1.convertReferrerProperty({ referrer }), actions_core_1.omit(properties.user_properties ?? {}, ['utm_properties', 'referrer']));
163
+ }
164
+ if (min_id_length && min_id_length > 0) {
165
+ options = { min_id_length };
166
+ }
167
+ const events = [
168
+ {
169
+ ...(userAgentParsing && user_agent_1.parseUserAgentProperties(userAgent)),
170
+ ...actions_core_1.removeUndefined(properties),
171
+ ...(products.length && trackRevenuePerProduct ? {} : getRevenueProperties(payload)),
172
+ library: 'segment'
173
+ }
174
+ ];
175
+ for (const product of products) {
176
+ events.push({
177
+ ...properties,
178
+ ...(trackRevenuePerProduct ? getRevenueProperties(product) : {}),
179
+ event_properties: product,
180
+ event_type: 'Product Purchased',
181
+ insert_id: properties.insert_id ? `${properties.insert_id}-${events.length + 1}` : undefined,
182
+ library: 'segment'
183
+ });
184
+ }
185
+ const endpoint = regional_endpoints_1.getEndpointByRegion(payload.use_batch_endpoint ? 'batch' : 'httpapi', settings.endpoint);
186
+ return request(endpoint, {
187
+ method: 'post',
188
+ json: {
189
+ api_key: settings.apiKey,
190
+ events,
191
+ options
192
+ }
193
+ });
130
194
  }
131
195
  };
132
- const action = {
133
- title: 'Log Event',
134
- description: 'Send an event to Amplitude.',
135
- defaultSubscription: 'type = "track" and event != "Order Completed"',
136
- fields: exports.fields,
137
- perform: (request, { payload, settings }) => doPerform(request, payload, settings, getEvents)
138
- };
139
196
  exports.default = action;
140
197
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/amplitude/logEvent/index.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA6D;AAC7D,+DAAsC;AACtC,kDAA6C;AAI7C,gCAA6C;AAC7C,0CAAqD;AACrD,oEAA8D;AAC9D,8CAAwD;AACxD,8DAA2D;AAG3D,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CAAA;AAWhF,SAAS,SAAS,CAAC,OAAgB,EAAE,UAA0B;IAC7D,MAAM,MAAM,GAAqB;QAC/B;YAEE,GAAG,CAAC,OAAO,CAAC,gBAAgB,IAAI,qCAAwB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAE5E,GAAG,8BAAe,CAAC,UAAU,CAAC;YAC9B,OAAO,EAAE,SAAS;SACnB;KACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,SAAS,CAAC,OAAiB,EAAE,OAAgB,EAAE,QAAkB,EAAE,aAAuB;IACxG,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAChH,mBAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;IAC5B,MAAM,UAAU,GAAG,IAAsB,CAAA;IACzC,IAAI,OAAO,CAAA;IAEX,IAAI,UAAU,CAAC,QAAQ,EAAE;QACvB,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;KAChG;IAED,IAAI,OAAO,EAAE;QACX,IAAI,OA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CAAC,QAAQ,EAAE;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,OAAO,EAAE,QAAQ,CAAC,MAAM;gBACxB,MAAM;gBACN,OAAO;aACR;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -50,6 +50,7 @@ register('6116a41e2e8fc680d8daf821', './personas-messaging-twilio');
50
50
  register('5f7dd8191ad74f868ab1fc48', './pipedrive');
51
51
  register('61957755c4d820be968457de', './salesforce');
52
52
  register('5f7dd8e302173ff732db5cc4', './slack');
53
+ register('6261a8b6cb4caa70e19116e8', './snap-conversions-api');
53
54
  register('6234b137d3b6404a64f2a0f0', './talon-one');
54
55
  register('615cae349d109d6b7496a131', './tiktok-conversions');
55
56
  register('602efa1f249b9a5e2bf8a813', './twilio');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/destinations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAAmD;AACnD,gDAAuB;AAWV,QAAA,YAAY,GAA0C,EAAE,CAAA;AACxD,QAAA,QAAQ,GAAsC,EAAE,CAAA;AAU7D,QAAQ,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAA;AAChD,QAAQ,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAA;AACtD,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAAC,CAAA;AACjD,QAAQ,CAAC,0BAA0B,EAAE,oBAAoB,CAAC,CAAA;AAC1D,QAAQ,CAAC,0BAA0B,EAAE,cAAc,CAAC,CAAA;AACpD,QAAQ,CAAC,0BAA0B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AAA;KACZ;IAED,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,KAAK,UAAU,uBAAuB,CAAC,GAAW;IAChD,MAAM,WAAW,GAAG,oBAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAA;IAExE,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAA;KACZ;IAGD,OAAO,IAAI,0BAAW,CAAC,WAAyC,CAAC,CAAA;AACnE,CAAC;AAED,SAAgB,kBAAkB,CAAC,EAAU;IAC3C,MAAM,WAAW,GAAG,gBAAQ,CAAC,EAAE,CAAC,CAAA;IAEhC,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE;QAC5B,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,IAAI,0BAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;AAChD,CAAC;AARD,gDAQC;AAEM,KAAK,UAAU,uBAAuB,CAAC,WAAmB;IAC/D,OAAO,kBAAkB,CAAC,WAAW,CAAC,IAAI,uBAAuB,CAAC,WAAW,CAAC,CAAA;AAChF,CAAC;AAFD,0DAEC"}
@@ -0,0 +1,5 @@
1
+ export interface Settings {
2
+ pixelId?: string;
3
+ snapAppId?: string;
4
+ appId?: string;
5
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/snap-conversions-api/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,36 @@
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 reportConversionEvent_1 = __importDefault(require("./reportConversionEvent"));
7
+ const destination = {
8
+ name: 'Snap Conversions Api',
9
+ slug: 'actions-snap-conversions',
10
+ mode: 'cloud',
11
+ authentication: {
12
+ scheme: 'oauth2',
13
+ fields: {
14
+ pixelId: {
15
+ label: 'Pixel ID',
16
+ description: 'The Pixel ID for your Snapchat Ad Account. Required for web and offline events.',
17
+ type: 'string'
18
+ },
19
+ snapAppId: {
20
+ label: 'Snap App ID',
21
+ description: 'The Snap App ID associated with your app. This is a unique code generated in Snapchat Ads Manager and included in your MMP dashboard. Required for app events.',
22
+ type: 'string'
23
+ },
24
+ appId: {
25
+ label: 'App ID',
26
+ description: 'The unique ID assigned for a given application. It should be numeric for iOS, and the human interpretable string for Android. Required for app events.',
27
+ type: 'string'
28
+ }
29
+ }
30
+ },
31
+ actions: {
32
+ reportConversionEvent: reportConversionEvent_1.default
33
+ }
34
+ };
35
+ exports.default = destination;
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/snap-conversions-api/index.ts"],"names":[],"mappings":";;;;;AAGA,oFAA2D;AAE3D,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,iFAAiF;gBAC9F,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,aAAa;gBACpB,WAAW,EACT,gKAAgK;gBAClK,IAAI,EAAE,QAAQ;aACf;YACD,KAAK,EAAE;gBACL,KAAK,EAAE,QAAQ;gBACf,WAAW,EACT,wJAAwJ;gBAC1J,IAAI,EAAE,QAAQ;aACf;SACF;KAkCF;IACD,OAAO,EAAE;QACP,qBAAqB,EAArB,+BAAqB;KACtB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/snap-conversions-api/reportConversionEvent/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Report Conversion Event',
5
+ description: 'TODO',
6
+ fields: {},
7
+ perform: () => {
8
+ return;
9
+ }
10
+ };
11
+ exports.default = action;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/snap-conversions-api/reportConversionEvent/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,GAAG,EAAE;QAOZ,OAAM;IACR,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@segment/action-destinations",
3
3
  "description": "Destination Actions engine and definitions.",
4
- "version": "3.65.1-alpha.0",
4
+ "version": "3.65.1-alpha.11",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",
@@ -62,5 +62,5 @@
62
62
  "<rootDir>/test/setup-after-env.ts"
63
63
  ]
64
64
  },
65
- "gitHead": "1687674bdabf5d858ddeb70b7ef910e37369dec0"
65
+ "gitHead": "65770c5da966417d46d87c334fae97f6f5e839e5"
66
66
  }
@@ -1,64 +0,0 @@
1
- export interface Payload {
2
- user_id?: string | null;
3
- device_id?: string;
4
- event_type: string;
5
- session_id?: string | number;
6
- time?: string | number;
7
- event_properties?: {
8
- [k: string]: unknown;
9
- };
10
- user_properties?: {
11
- [k: string]: unknown;
12
- };
13
- groups?: {
14
- [k: string]: unknown;
15
- };
16
- app_version?: string;
17
- platform?: string;
18
- os_name?: string;
19
- os_version?: string;
20
- device_brand?: string;
21
- device_manufacturer?: string;
22
- device_model?: string;
23
- carrier?: string;
24
- country?: string;
25
- region?: string;
26
- city?: string;
27
- dma?: string;
28
- language?: string;
29
- price?: number;
30
- quantity?: number;
31
- revenue?: number;
32
- productId?: string;
33
- revenueType?: string;
34
- location_lat?: number;
35
- location_lng?: number;
36
- ip?: string;
37
- idfa?: string;
38
- idfv?: string;
39
- adid?: string;
40
- android_id?: string;
41
- event_id?: number;
42
- insert_id?: string;
43
- library?: string;
44
- use_batch_endpoint?: boolean;
45
- userAgent?: string;
46
- userAgentParsing?: boolean;
47
- utm_properties?: {
48
- utm_source?: string;
49
- utm_medium?: string;
50
- utm_campaign?: string;
51
- utm_term?: string;
52
- utm_content?: string;
53
- };
54
- referrer?: string;
55
- min_id_length?: number | null;
56
- trackRevenuePerProduct?: boolean;
57
- products?: {
58
- price?: number;
59
- quantity?: number;
60
- revenue?: number;
61
- productId?: string;
62
- revenueType?: string;
63
- }[];
64
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/amplitude/logPurchase/generated-types.ts"],"names":[],"mappings":""}
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const actions_core_1 = require("@segment/actions-core");
4
- const user_agent_1 = require("../user-agent");
5
- const logEvent_1 = require("../logEvent");
6
- const logEvent_2 = require("../logEvent");
7
- function getRevenueProperties(payload) {
8
- if (typeof payload.revenue !== 'number') {
9
- return {};
10
- }
11
- return {
12
- revenue: payload.revenue,
13
- revenueType: payload.revenueType ?? 'Purchase',
14
- quantity: typeof payload.quantity === 'number' ? Math.round(payload.quantity) : undefined,
15
- price: payload.price,
16
- productId: payload.productId
17
- };
18
- }
19
- function getEvents(payload, properties) {
20
- const { products = [], userAgent, userAgentParsing, trackRevenuePerProduct } = payload;
21
- const events = [
22
- {
23
- ...(userAgentParsing && user_agent_1.parseUserAgentProperties(userAgent)),
24
- ...actions_core_1.removeUndefined(properties),
25
- ...(products?.length && trackRevenuePerProduct ? {} : getRevenueProperties(payload)),
26
- library: 'segment'
27
- }
28
- ];
29
- for (const product of products) {
30
- events.push({
31
- ...properties,
32
- ...(trackRevenuePerProduct ? getRevenueProperties(product) : {}),
33
- event_properties: product,
34
- event_type: 'Product Purchased',
35
- insert_id: properties.insert_id ? `${properties.insert_id}-${events.length + 1}` : undefined,
36
- library: 'segment'
37
- });
38
- }
39
- return events;
40
- }
41
- const action = {
42
- title: 'Log Purchase',
43
- description: 'Send an event to Amplitude.',
44
- defaultSubscription: 'type = "track" and event = "Order Completed"',
45
- fields: {
46
- ...logEvent_2.fields,
47
- trackRevenuePerProduct: {
48
- label: 'Track Revenue Per Product',
49
- description: 'When enabled, track revenue with each product within the event. When disabled, track total revenue once for the event.',
50
- type: 'boolean',
51
- default: false
52
- },
53
- products: {
54
- label: 'Products',
55
- description: 'The list of products purchased.',
56
- type: 'object',
57
- multiple: true,
58
- properties: {
59
- price: {
60
- label: 'Price',
61
- type: 'number',
62
- description: 'The price of the item purchased. Required for revenue data if the revenue field is not sent. You can use negative values to indicate refunds.'
63
- },
64
- quantity: {
65
- label: 'Quantity',
66
- type: 'integer',
67
- description: 'The quantity of the item purchased. Defaults to 1 if not specified.'
68
- },
69
- revenue: {
70
- label: 'Revenue',
71
- type: 'number',
72
- description: 'Revenue = price * quantity. If you send all 3 fields of price, quantity, and revenue, then (price * quantity) will be used as the revenue value. You can use negative values to indicate refunds.'
73
- },
74
- productId: {
75
- label: 'Product ID',
76
- type: 'string',
77
- description: 'An identifier for the item purchased. You must send a price and quantity or revenue with this field.'
78
- },
79
- revenueType: {
80
- label: 'Revenue Type',
81
- type: 'string',
82
- description: 'The type of revenue for the item purchased. You must send a price and quantity or revenue with this field.'
83
- }
84
- },
85
- default: {
86
- '@path': '$.properties.products'
87
- }
88
- }
89
- },
90
- perform: (request, { payload, settings }) => logEvent_1.doPerform(request, payload, settings, getEvents)
91
- };
92
- exports.default = action;
93
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/amplitude/logPurchase/index.ts"],"names":[],"mappings":";;AAAA,wDAAuD;AAIvD,8CAAwD;AACxD,0CAAuD;AACvD,0CAAsD;AAUtD,SAAS,oBAAoB,CAAC,OAAqB;IACjD,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE;QACvC,OAAO,EAAE,CAAA;KACV;IAED,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,UAAU;QAC9C,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QACzF,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,OAAgB,EAAE,UAA0B;IAC7D,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAA;IAEtF,MAAM,MAAM,GAAqB;QAC/B;YAEE,GAAG,CAAC,gBAAgB,IAAI,qCAAwB,CAAC,SAAS,CAAC,CAAC;YAE5D,GAAG,8BAAe,CAAC,UAAU,CAAC;YAE9B,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YACpF,OAAO,EAAE,SAAS;SACnB;KACF,CAAA;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,E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