@segment/action-destinations 3.446.0 → 3.447.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.
@@ -3,7 +3,7 @@ import { ModifiedResponse, RequestClient, DynamicFieldResponse, Features, MultiS
3
3
  import { StatsContext } from '@segment/actions-core/destination-kit';
4
4
  import { HTTPError } from '@segment/actions-core';
5
5
  import type { Payload as UserListPayload } from './userList/generated-types';
6
- export declare const API_VERSION = "v19";
6
+ export declare const API_VERSION = "v21";
7
7
  export declare const CANARY_API_VERSION = "v21";
8
8
  export declare const FLAGON_NAME = "google-enhanced-canary-version";
9
9
  export declare const FLAGON_NAME_PHONE_VALIDATION_CHECK = "google-enhanced-phone-validation-check";
@@ -19,7 +19,7 @@ const formats_1 = require("ajv-formats/dist/formats");
19
19
  const actions_core_2 = require("@segment/actions-core");
20
20
  const constants_1 = require("./constants");
21
21
  const hashing_utils_1 = require("../../lib/hashing-utils");
22
- exports.API_VERSION = 'v19';
22
+ exports.API_VERSION = 'v21';
23
23
  exports.CANARY_API_VERSION = 'v21';
24
24
  exports.FLAGON_NAME = 'google-enhanced-canary-version';
25
25
  exports.FLAGON_NAME_PHONE_VALIDATION_CHECK = 'google-enhanced-phone-validation-check';
@@ -6,4 +6,31 @@ export interface Payload {
6
6
  additionalAttribution?: {
7
7
  [k: string]: unknown;
8
8
  };
9
+ externalVendorId?: string;
10
+ entity?: {
11
+ id: string;
12
+ type: string;
13
+ };
14
+ placement?: {
15
+ path: string;
16
+ position?: number;
17
+ page?: number;
18
+ pageSize?: number;
19
+ productId?: string;
20
+ categoryIds?: string[];
21
+ searchQuery?: string;
22
+ };
23
+ page?: {
24
+ type: string;
25
+ pageId: string;
26
+ value?: string;
27
+ };
28
+ object?: {
29
+ type: string;
30
+ assetId?: string;
31
+ clickType?: string;
32
+ };
33
+ externalCampaignId?: string;
34
+ deviceType?: string;
35
+ channel?: string;
9
36
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const client_1 = require("../client");
4
+ const functions_1 = require("../functions");
4
5
  const action = {
5
6
  title: 'Click',
6
7
  defaultSubscription: 'type = "track" and event = "Product Clicked"',
@@ -50,10 +51,214 @@ const action = {
50
51
  default: {
51
52
  '@path': '$.properties.additionalAttribution'
52
53
  }
54
+ },
55
+ externalVendorId: {
56
+ label: 'External Vendor ID',
57
+ description: 'Marketplace provided ID for a vendor.',
58
+ type: 'string',
59
+ required: false,
60
+ default: {
61
+ '@path': '$.properties.externalVendorId'
62
+ }
63
+ },
64
+ entity: {
65
+ label: 'Entity',
66
+ description: 'Entity is meant for reporting organic events, not sponsored or promoted products. It refers to the object involved in the organic interaction. If resolvedBidId has any value, entity will be disregarded.',
67
+ type: 'object',
68
+ required: false,
69
+ properties: {
70
+ id: {
71
+ label: 'Entity ID',
72
+ description: "The marketplace's ID of the entity associated with the interaction.",
73
+ type: 'string',
74
+ required: true
75
+ },
76
+ type: {
77
+ label: 'Entity Type',
78
+ description: 'The type of entity associated with the interaction.',
79
+ type: 'string',
80
+ required: true
81
+ }
82
+ },
83
+ default: {
84
+ '@path': '$.properties.entity'
85
+ }
86
+ },
87
+ placement: {
88
+ label: 'Placement',
89
+ description: 'Placement information for the impression.',
90
+ type: 'object',
91
+ required: false,
92
+ properties: {
93
+ path: {
94
+ label: 'Path',
95
+ description: 'URL path of the page triggering the event. For web apps, this can be obtained in JS using window.location.pathname.',
96
+ type: 'string',
97
+ required: true
98
+ },
99
+ position: {
100
+ label: 'Position',
101
+ description: 'Index of the item within a list (e.g., search results, similar products).',
102
+ type: 'integer',
103
+ required: false
104
+ },
105
+ page: {
106
+ label: 'Page Number',
107
+ description: 'For paginated pages, this indicates which page number triggered the event.',
108
+ type: 'integer',
109
+ required: false
110
+ },
111
+ pageSize: {
112
+ label: 'Page Size',
113
+ description: 'For paginated pages, this indicates how many items are in each result page.',
114
+ type: 'integer',
115
+ required: false
116
+ },
117
+ productId: {
118
+ label: 'Product ID',
119
+ description: 'The ID of the product associated to the page in which this event occurred. This ID must match the ID provided through the catalog service.',
120
+ type: 'string',
121
+ required: false
122
+ },
123
+ categoryIds: {
124
+ label: 'Category IDs',
125
+ description: 'An array of IDs of the categories associated to the page in which this event occurred. These IDs must match the IDs provided through the catalog service.',
126
+ type: 'string',
127
+ required: false,
128
+ multiple: true
129
+ },
130
+ searchQuery: {
131
+ label: 'Search Query',
132
+ description: 'The search string provided by the user. This must match the searchQuery field provided in the auction request.',
133
+ type: 'string',
134
+ required: false
135
+ }
136
+ },
137
+ default: {
138
+ '@if': {
139
+ exists: { '@path': '$.context.page.path' },
140
+ then: {
141
+ '@merge': {
142
+ objects: [
143
+ {
144
+ path: { '@path': '$.context.page.path' },
145
+ position: { '@path': '$.position' }
146
+ },
147
+ { '@path': '$.properties.placement' }
148
+ ],
149
+ direction: 'right'
150
+ }
151
+ },
152
+ else: { '@path': '$.properties.page' }
153
+ }
154
+ }
155
+ },
156
+ page: {
157
+ label: 'Page',
158
+ description: 'Page information for the impression.',
159
+ type: 'object',
160
+ required: false,
161
+ properties: {
162
+ type: {
163
+ label: 'Page Type',
164
+ description: 'Type of page.',
165
+ type: 'string',
166
+ required: true
167
+ },
168
+ pageId: {
169
+ label: 'Page ID',
170
+ description: 'Identifies the page.',
171
+ type: 'string',
172
+ required: true
173
+ },
174
+ value: {
175
+ label: 'Page Value',
176
+ description: 'Detail of the page, depending on the type.',
177
+ type: 'string',
178
+ required: false
179
+ }
180
+ },
181
+ default: {
182
+ '@if': {
183
+ exists: { '@path': '$.properties.page.type' },
184
+ then: {
185
+ '@merge': {
186
+ objects: [
187
+ {
188
+ value: { '@path': '$.context.page.title' }
189
+ },
190
+ { '@path': '$.properties.page' }
191
+ ],
192
+ direction: 'right'
193
+ }
194
+ },
195
+ else: { '@path': '$.properties.page' }
196
+ }
197
+ }
198
+ },
199
+ object: {
200
+ label: 'Object',
201
+ description: 'Information regarding an organic or non-sponsored event.',
202
+ type: 'object',
203
+ required: false,
204
+ properties: {
205
+ type: {
206
+ label: 'Object Type',
207
+ description: 'The type of object that is being reported on the interaction.',
208
+ type: 'string',
209
+ required: true,
210
+ defaultObjectUI: 'keyvalue'
211
+ },
212
+ assetId: {
213
+ label: 'Asset ID',
214
+ description: 'When type is banner, signals the ID of the asset of the banner.',
215
+ type: 'string',
216
+ required: false,
217
+ defaultObjectUI: 'keyvalue'
218
+ },
219
+ clickType: {
220
+ label: 'Click Type',
221
+ description: 'When type is listing, signals the specific interaction flavor with the listing.',
222
+ type: 'string',
223
+ required: false,
224
+ defaultObjectUI: 'keyvalue'
225
+ }
226
+ },
227
+ default: {
228
+ '@path': '$.properties.object'
229
+ }
230
+ },
231
+ externalCampaignId: {
232
+ label: 'External Campaign ID',
233
+ description: 'Marketplace provided ID for a campaign.',
234
+ type: 'string',
235
+ required: false,
236
+ default: {
237
+ '@path': '$.properties.externalCampaignId'
238
+ }
239
+ },
240
+ deviceType: {
241
+ label: 'Device Type',
242
+ description: 'The device the user is on.',
243
+ type: 'string',
244
+ required: false,
245
+ default: {
246
+ '@path': '$.context.device.type'
247
+ }
248
+ },
249
+ channel: {
250
+ label: 'Channel',
251
+ description: 'The channel where the event occurred.',
252
+ type: 'string',
253
+ required: false,
254
+ default: {
255
+ '@path': '$.properties.channel'
256
+ }
53
257
  }
54
258
  },
55
259
  perform: (request, { payload, settings }) => {
56
260
  const client = new client_1.TopsortAPIClient(request, settings);
261
+ payload.deviceType = (0, functions_1.NormalizeDeviceType)(payload.deviceType);
57
262
  return client.sendEvent({
58
263
  clicks: [payload]
59
264
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/topsort/click/index.ts"],"names":[],"mappings":";;AAGA,sCAA4C;AAE5C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,mBAAmB,EAAE,8CAA8C;IACnE,WAAW,EAAE,2EAA2E;IACxF,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,UAAU;YACjB,WAAW,EACT,8GAA8G;YAChH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,0GAA0G;YAC5G,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,wHAAwH;YAC1H,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,4BAA4B;aACtC;SACF;QACD,qBAAqB,EAAE;YACrB,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,oCAAoC;aAC9C;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,yBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACtD,OAAO,MAAM,CAAC,SAAS,CAAC;YACtB,MAAM,EAAE,CAAC,OAAO,CAAC;SAClB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/topsort/click/index.ts"],"names":[],"mappings":";;AAGA,sCAA4C;A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,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,sBAAsB;aAChC;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,yBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAEtD,OAAO,CAAC,UAAU,GAAG,IAAA,+BAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAC5D,OAAO,MAAM,CAAC,SAAS,CAAC;YACtB,MAAM,EAAE,CAAC,OAAO,CAAC;SAClB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1 @@
1
+ export declare function NormalizeDeviceType(t: string | undefined): string | undefined;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NormalizeDeviceType = NormalizeDeviceType;
4
+ function NormalizeDeviceType(t) {
5
+ if (t === 'ios' || t === 'android') {
6
+ t = 'mobile';
7
+ }
8
+ if (t === 'macos' || t === 'windows') {
9
+ t = 'desktop';
10
+ }
11
+ if (t !== 'mobile' && t !== 'desktop') {
12
+ t = undefined;
13
+ }
14
+ return t;
15
+ }
16
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/topsort/functions.ts"],"names":[],"mappings":";;AAAA,kDAYC;AAZD,SAAgB,mBAAmB,CAAC,CAAqB;IACvD,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACnC,CAAC,GAAG,QAAQ,CAAA;IACd,CAAC;IACD,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACrC,CAAC,GAAG,SAAS,CAAA;IACf,CAAC;IAED,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACtC,CAAC,GAAG,SAAS,CAAA;IACf,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC"}
@@ -6,4 +6,31 @@ export interface Payload {
6
6
  additionalAttribution?: {
7
7
  [k: string]: unknown;
8
8
  };
9
+ externalVendorId?: string;
10
+ entity?: {
11
+ id: string;
12
+ type: string;
13
+ };
14
+ placement?: {
15
+ path: string;
16
+ position?: number;
17
+ page?: number;
18
+ pageSize?: number;
19
+ productId?: string;
20
+ categoryIds?: string[];
21
+ searchQuery?: string;
22
+ };
23
+ page?: {
24
+ type: string;
25
+ pageId: string;
26
+ value?: string;
27
+ };
28
+ object?: {
29
+ type: string;
30
+ assetId?: string;
31
+ clickType?: string;
32
+ };
33
+ externalCampaignId?: string;
34
+ deviceType?: string;
35
+ channel?: string;
9
36
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const client_1 = require("../client");
4
+ const functions_1 = require("../functions");
4
5
  const action = {
5
6
  title: 'Impression',
6
7
  defaultSubscription: 'type = "track" and event = "Product Viewed"',
@@ -50,10 +51,214 @@ const action = {
50
51
  default: {
51
52
  '@path': '$.properties.additionalAttribution'
52
53
  }
54
+ },
55
+ externalVendorId: {
56
+ label: 'External Vendor ID',
57
+ description: 'Marketplace provided ID for a vendor.',
58
+ type: 'string',
59
+ required: false,
60
+ default: {
61
+ '@path': '$.properties.externalVendorId'
62
+ }
63
+ },
64
+ entity: {
65
+ label: 'Entity',
66
+ description: 'Entity is meant for reporting organic events, not sponsored or promoted products. It refers to the object involved in the organic interaction. If resolvedBidId has any value, entity will be disregarded.',
67
+ type: 'object',
68
+ required: false,
69
+ properties: {
70
+ id: {
71
+ label: 'Entity ID',
72
+ description: "The marketplace's ID of the entity associated with the interaction.",
73
+ type: 'string',
74
+ required: true
75
+ },
76
+ type: {
77
+ label: 'Entity Type',
78
+ description: 'The type of entity associated with the interaction.',
79
+ type: 'string',
80
+ required: true
81
+ }
82
+ },
83
+ default: {
84
+ '@path': '$.properties.entity'
85
+ }
86
+ },
87
+ placement: {
88
+ label: 'Placement',
89
+ description: 'Placement information for the impression.',
90
+ type: 'object',
91
+ required: false,
92
+ properties: {
93
+ path: {
94
+ label: 'Path',
95
+ description: 'URL path of the page triggering the event. For web apps, this can be obtained in JS using window.location.pathname.',
96
+ type: 'string',
97
+ required: true
98
+ },
99
+ position: {
100
+ label: 'Position',
101
+ description: 'Index of the item within a list (e.g., search results, similar products).',
102
+ type: 'integer',
103
+ required: false
104
+ },
105
+ page: {
106
+ label: 'Page Number',
107
+ description: 'For paginated pages, this indicates which page number triggered the event.',
108
+ type: 'integer',
109
+ required: false
110
+ },
111
+ pageSize: {
112
+ label: 'Page Size',
113
+ description: 'For paginated pages, this indicates how many items are in each result page.',
114
+ type: 'integer',
115
+ required: false
116
+ },
117
+ productId: {
118
+ label: 'Product ID',
119
+ description: 'The ID of the product associated to the page in which this event occurred. This ID must match the ID provided through the catalog service.',
120
+ type: 'string',
121
+ required: false
122
+ },
123
+ categoryIds: {
124
+ label: 'Category IDs',
125
+ description: 'An array of IDs of the categories associated to the page in which this event occurred. These IDs must match the IDs provided through the catalog service.',
126
+ type: 'string',
127
+ required: false,
128
+ multiple: true
129
+ },
130
+ searchQuery: {
131
+ label: 'Search Query',
132
+ description: 'The search string provided by the user. This must match the searchQuery field provided in the auction request.',
133
+ type: 'string',
134
+ required: false
135
+ }
136
+ },
137
+ default: {
138
+ '@if': {
139
+ exists: { '@path': '$.context.page.path' },
140
+ then: {
141
+ '@merge': {
142
+ objects: [
143
+ {
144
+ path: { '@path': '$.context.page.path' },
145
+ position: { '@path': '$.position' }
146
+ },
147
+ { '@path': '$.properties.placement' }
148
+ ],
149
+ direction: 'right'
150
+ }
151
+ },
152
+ else: { '@path': '$.properties.page' }
153
+ }
154
+ }
155
+ },
156
+ page: {
157
+ label: 'Page',
158
+ description: 'Page information for the impression.',
159
+ type: 'object',
160
+ required: false,
161
+ properties: {
162
+ type: {
163
+ label: 'Page Type',
164
+ description: 'Type of page.',
165
+ type: 'string',
166
+ required: true
167
+ },
168
+ pageId: {
169
+ label: 'Page ID',
170
+ description: 'Identifies the page.',
171
+ type: 'string',
172
+ required: true
173
+ },
174
+ value: {
175
+ label: 'Page Value',
176
+ description: 'Detail of the page, depending on the type.',
177
+ type: 'string',
178
+ required: false
179
+ }
180
+ },
181
+ default: {
182
+ '@if': {
183
+ exists: { '@path': '$.properties.page.type' },
184
+ then: {
185
+ '@merge': {
186
+ objects: [
187
+ {
188
+ value: { '@path': '$.context.page.title' }
189
+ },
190
+ { '@path': '$.properties.page' }
191
+ ],
192
+ direction: 'right'
193
+ }
194
+ },
195
+ else: { '@path': '$.properties.page' }
196
+ }
197
+ }
198
+ },
199
+ object: {
200
+ label: 'Object',
201
+ description: 'Information regarding an organic or non-sponsored event.',
202
+ type: 'object',
203
+ required: false,
204
+ properties: {
205
+ type: {
206
+ label: 'Object Type',
207
+ description: 'The type of object that is being reported on the interaction.',
208
+ type: 'string',
209
+ required: true,
210
+ defaultObjectUI: 'keyvalue'
211
+ },
212
+ assetId: {
213
+ label: 'Asset ID',
214
+ description: 'When type is banner, signals the ID of the asset of the banner.',
215
+ type: 'string',
216
+ required: false,
217
+ defaultObjectUI: 'keyvalue'
218
+ },
219
+ clickType: {
220
+ label: 'Click Type',
221
+ description: 'When type is listing, signals the specific interaction flavor with the listing.',
222
+ type: 'string',
223
+ required: false,
224
+ defaultObjectUI: 'keyvalue'
225
+ }
226
+ },
227
+ default: {
228
+ '@path': '$.properties.object'
229
+ }
230
+ },
231
+ externalCampaignId: {
232
+ label: 'External Campaign ID',
233
+ description: 'Marketplace provided ID for a campaign.',
234
+ type: 'string',
235
+ required: false,
236
+ default: {
237
+ '@path': '$.properties.externalCampaignId'
238
+ }
239
+ },
240
+ deviceType: {
241
+ label: 'Device Type',
242
+ description: 'The device the user is on.',
243
+ type: 'string',
244
+ required: false,
245
+ default: {
246
+ '@path': '$.context.device.type'
247
+ }
248
+ },
249
+ channel: {
250
+ label: 'Channel',
251
+ description: 'The channel where the event occurred.',
252
+ type: 'string',
253
+ required: false,
254
+ default: {
255
+ '@path': '$.properties.channel'
256
+ }
53
257
  }
54
258
  },
55
259
  perform: (request, { payload, settings }) => {
56
260
  const client = new client_1.TopsortAPIClient(request, settings);
261
+ payload.deviceType = (0, functions_1.NormalizeDeviceType)(payload.deviceType);
57
262
  return client.sendEvent({
58
263
  impressions: [payload]
59
264
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/topsort/impression/index.ts"],"names":[],"mappings":";;AAGA,sCAA4C;AAE5C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,mBAAmB,EAAE,6CAA6C;IAClE,WAAW,EAAE,4EAA4E;IACzF,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,UAAU;YACjB,WAAW,EACT,8GAA8G;YAChH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,0GAA0G;YAC5G,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,wHAAwH;YAC1H,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,4BAA4B;aACtC;SACF;QACD,qBAAqB,EAAE;YACrB,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,oCAAoC;aAC9C;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,yBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACtD,OAAO,MAAM,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,CAAC,OAAO,CAAC;SACvB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/topsort/impression/index.ts"],"names":[],"mappings":";;AAGA,sCAA4C;AAC5C,4CAAkD;AAElD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,mBAAmB,EAAE,6CAA6C;IAClE,WAAW,EAAE,4EAA4E;IACzF,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,UAAU;YACjB,WAAW,EACT,8GAA8G;YAChH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,0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ACvB,CAAC,CAAA;IACJ,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.446.0",
4
+ "version": "3.447.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",
@@ -92,5 +92,5 @@
92
92
  "__tests__/__helpers__/"
93
93
  ]
94
94
  },
95
- "gitHead": "ff810c6ce1f62e0f32ee0e7d8e28fe292054983f"
95
+ "gitHead": "53b87bf6466ddc2bf2cec00cd52752f67329375b"
96
96
  }