@segment/action-destinations 3.259.0-staging-bbeebc18f → 3.259.0-staging-8d584ce0f
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/amazon-ads/generated-types.d.ts +0 -9
- package/dist/destinations/amazon-ads/index.d.ts +2 -2
- package/dist/destinations/amazon-ads/index.js +3 -128
- package/dist/destinations/amazon-ads/index.js.map +1 -1
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +0 -17
- package/dist/destinations/amazon-ads/syncAudiences/index.js +7 -114
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/customerio/utils.d.ts +1 -1
- package/dist/destinations/engage/utils/EngageActionPerformer.js +17 -1
- package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -1
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.d.ts +3 -0
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js +15 -0
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -1
- package/dist/destinations/engage/utils/track.d.ts +20 -17
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.d.ts +13 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.js.map +1 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/index.js +95 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/index.js.map +1 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.d.ts +6 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.js +37 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.js.map +1 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.d.ts +7 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.js +52 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.js.map +1 -0
- package/package.json +1 -1
- package/dist/destinations/amazon-ads/utils.d.ts +0 -6
- package/dist/destinations/amazon-ads/utils.js +0 -8
- package/dist/destinations/amazon-ads/utils.js.map +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +0 -184
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -4
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +0 -5
- package/dist/destinations/klaviyo/removeProfileToList/index.js +0 -43
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/categoryView/generated-types.js +0 -3
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/index.js +0 -43
- package/dist/destinations/movable-ink/categoryView/index.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +0 -20
- package/dist/destinations/movable-ink/conversion/generated-types.js +0 -3
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/index.d.ts +0 -5
- package/dist/destinations/movable-ink/conversion/index.js +0 -45
- package/dist/destinations/movable-ink/conversion/index.js.map +0 -1
- package/dist/destinations/movable-ink/fields.d.ts +0 -21
- package/dist/destinations/movable-ink/fields.js +0 -236
- package/dist/destinations/movable-ink/fields.js.map +0 -1
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +0 -7
- package/dist/destinations/movable-ink/identify/generated-types.js +0 -3
- package/dist/destinations/movable-ink/identify/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/identify/index.d.ts +0 -5
- package/dist/destinations/movable-ink/identify/index.js +0 -32
- package/dist/destinations/movable-ink/identify/index.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/productAdded/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productAdded/index.js +0 -43
- package/dist/destinations/movable-ink/productAdded/index.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +0 -21
- package/dist/destinations/movable-ink/productViewed/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productViewed/index.js +0 -43
- package/dist/destinations/movable-ink/productViewed/index.js.map +0 -1
- package/dist/destinations/movable-ink/search/generated-types.d.ts +0 -12
- package/dist/destinations/movable-ink/search/generated-types.js +0 -3
- package/dist/destinations/movable-ink/search/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/search/index.d.ts +0 -5
- package/dist/destinations/movable-ink/search/index.js +0 -43
- package/dist/destinations/movable-ink/search/index.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +0 -25
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +0 -3
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +0 -5
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +0 -48
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +0 -14
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js +0 -3
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +0 -5
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +0 -113
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +0 -20
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js +0 -3
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +0 -5
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +0 -174
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +0 -1
- package/dist/destinations/responsys/rsp-operations.d.ts +0 -14
- package/dist/destinations/responsys/rsp-operations.js +0 -33
- package/dist/destinations/responsys/rsp-operations.js.map +0 -1
- package/dist/destinations/responsys/rsp-properties.d.ts +0 -4
- package/dist/destinations/responsys/rsp-properties.js +0 -27
- package/dist/destinations/responsys/rsp-properties.js.map +0 -1
- package/dist/destinations/responsys-cloud/generated-types.d.ts +0 -20
- package/dist/destinations/responsys-cloud/generated-types.js +0 -3
- package/dist/destinations/responsys-cloud/generated-types.js.map +0 -1
- package/dist/destinations/responsys-cloud/index.d.ts +0 -4
- package/dist/destinations/responsys-cloud/index.js +0 -207
- package/dist/destinations/responsys-cloud/index.js.map +0 -1
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.d.ts +0 -16
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.js +0 -3
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.js.map +0 -1
- package/dist/destinations/responsys-cloud/sendAudience/index.d.ts +0 -5
- package/dist/destinations/responsys-cloud/sendAudience/index.js +0 -109
- package/dist/destinations/responsys-cloud/sendAudience/index.js.map +0 -1
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.d.ts +0 -11
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js +0 -3
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js.map +0 -1
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.d.ts +0 -5
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.js +0 -72
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.js.map +0 -1
- package/dist/destinations/responsys-cloud/shared_properties.d.ts +0 -3
- package/dist/destinations/responsys-cloud/shared_properties.js +0 -19
- package/dist/destinations/responsys-cloud/shared_properties.js.map +0 -1
- package/dist/destinations/responsys-cloud/types.d.ts +0 -38
- package/dist/destinations/responsys-cloud/types.js +0 -3
- package/dist/destinations/responsys-cloud/types.js.map +0 -1
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.d.ts +0 -14
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js +0 -3
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js.map +0 -1
- package/dist/destinations/responsys-cloud/upsertListMember/index.d.ts +0 -5
- package/dist/destinations/responsys-cloud/upsertListMember/index.js +0 -85
- package/dist/destinations/responsys-cloud/upsertListMember/index.js.map +0 -1
- package/dist/destinations/responsys-cloud/utils.d.ts +0 -20
- package/dist/destinations/responsys-cloud/utils.js +0 -179
- package/dist/destinations/responsys-cloud/utils.js.map +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +0 -381
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +0 -581
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +0 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +0 -4
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +0 -97
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +0 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +0 -3
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +0 -43
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +0 -1
- package/dist/destinations/trackey/group.types.d.ts +0 -11
- package/dist/destinations/trackey/group.types.js +0 -3
- package/dist/destinations/trackey/group.types.js.map +0 -1
- package/dist/destinations/trackey/identify.types.d.ts +0 -11
- package/dist/destinations/trackey/identify.types.js +0 -3
- package/dist/destinations/trackey/identify.types.js.map +0 -1
- package/dist/destinations/trackey/track.types.d.ts +0 -12
- package/dist/destinations/trackey/track.types.js +0 -3
- package/dist/destinations/trackey/track.types.js.map +0 -1
- /package/dist/destinations/{klaviyo/removeProfileToList → liveramp-audiences/audienceEntered}/generated-types.js +0 -0
- /package/dist/destinations/{movable-ink/categoryView → liveramp-audiences/audienceEntered}/index.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AudienceDestinationDefinition } from '@segment/actions-core';
|
|
2
|
-
import type { Settings
|
|
3
|
-
declare const destination: AudienceDestinationDefinition<Settings
|
|
2
|
+
import type { Settings } from './generated-types';
|
|
3
|
+
declare const destination: AudienceDestinationDefinition<Settings>;
|
|
4
4
|
export default destination;
|
|
@@ -20,21 +20,12 @@ const destination = {
|
|
|
20
20
|
{ label: 'Europe (EU)', value: 'https://advertising-api-eu.amazon.com' },
|
|
21
21
|
{ label: 'Far East (FE)', value: 'https://advertising-api-fe.amazon.com' }
|
|
22
22
|
],
|
|
23
|
-
default: '
|
|
23
|
+
default: 'North America (NA)',
|
|
24
24
|
type: 'string',
|
|
25
25
|
required: true
|
|
26
|
-
},
|
|
27
|
-
advertiserId: {
|
|
28
|
-
label: 'Advertiser ID',
|
|
29
|
-
description: 'Advertiser Id',
|
|
30
|
-
type: 'number',
|
|
31
|
-
required: true
|
|
32
26
|
}
|
|
33
27
|
},
|
|
34
28
|
testAuthentication: async (request, { auth }) => {
|
|
35
|
-
if (!process.env.ACTIONS_AMAZON_ADS_CLIENT_ID) {
|
|
36
|
-
throw new actions_core_1.IntegrationError('Missing amazon API client ID', 'MISSING_REQUIRED_FIELD', 400);
|
|
37
|
-
}
|
|
38
29
|
if (!auth?.accessToken) {
|
|
39
30
|
throw new actions_core_1.InvalidAuthenticationError('Please authenticate via Oauth before enabling the destination.');
|
|
40
31
|
}
|
|
@@ -77,131 +68,15 @@ const destination = {
|
|
|
77
68
|
extendRequest({ auth }) {
|
|
78
69
|
return {
|
|
79
70
|
headers: {
|
|
80
|
-
|
|
81
|
-
authorization: `Bearer ${auth?.accessToken}`,
|
|
82
|
-
'Amazon-Advertising-API-ClientID': process.env.ACTIONS_AMAZON_ADS_CLIENT_ID || ''
|
|
71
|
+
authorization: `Bearer ${auth?.accessToken}`
|
|
83
72
|
}
|
|
84
73
|
};
|
|
85
74
|
},
|
|
86
|
-
audienceFields: {
|
|
87
|
-
description: {
|
|
88
|
-
type: 'string',
|
|
89
|
-
label: 'Description',
|
|
90
|
-
required: true,
|
|
91
|
-
description: 'The audience description. Must be an alphanumeric, non-null string between 0 to 1000 characters in length.'
|
|
92
|
-
},
|
|
93
|
-
countryCode: {
|
|
94
|
-
type: 'string',
|
|
95
|
-
label: 'Country Code',
|
|
96
|
-
required: false,
|
|
97
|
-
description: 'A String value representing ISO 3166-1 alpha-2 country code for the members in this audience.'
|
|
98
|
-
},
|
|
99
|
-
externalAudienceId: {
|
|
100
|
-
type: 'string',
|
|
101
|
-
label: 'External Audience Id.',
|
|
102
|
-
required: true,
|
|
103
|
-
description: 'The user-defined audience identifier.'
|
|
104
|
-
},
|
|
105
|
-
cpmCents: {
|
|
106
|
-
label: 'CPM Cents',
|
|
107
|
-
type: 'number',
|
|
108
|
-
description: `Cost per thousand impressions (CPM) in cents. For example, $1.00 = 100 cents.`
|
|
109
|
-
},
|
|
110
|
-
currency: {
|
|
111
|
-
label: 'Currency',
|
|
112
|
-
type: 'string',
|
|
113
|
-
description: `The price paid. Base units depend on the currency. As an example, USD should be reported as Dollars.Cents, whereas JPY should be reported as a whole number of Yen. All provided values will be rounded to two digits with toFixed(2)`
|
|
114
|
-
},
|
|
115
|
-
ttl: {
|
|
116
|
-
type: 'number',
|
|
117
|
-
label: 'Time-to-live',
|
|
118
|
-
required: false,
|
|
119
|
-
description: 'Time-to-live in seconds. The amount of time the record is associated with the audience.'
|
|
120
|
-
}
|
|
121
|
-
},
|
|
75
|
+
audienceFields: {},
|
|
122
76
|
audienceConfig: {
|
|
123
77
|
mode: {
|
|
124
78
|
type: 'synced',
|
|
125
79
|
full_audience_sync: false
|
|
126
|
-
},
|
|
127
|
-
async createAudience(request, createAudienceInput) {
|
|
128
|
-
const { audienceName, statsContext } = createAudienceInput;
|
|
129
|
-
const { statsClient, tags: statsTags } = statsContext || {};
|
|
130
|
-
const endpoint = createAudienceInput.settings.region;
|
|
131
|
-
const payload = {
|
|
132
|
-
name: audienceName,
|
|
133
|
-
description: createAudienceInput.audienceSettings?.description,
|
|
134
|
-
countryCode: createAudienceInput.audienceSettings?.countryCode || '',
|
|
135
|
-
targetResource: {
|
|
136
|
-
advertiserId: createAudienceInput.settings.advertiserId
|
|
137
|
-
},
|
|
138
|
-
metadata: {
|
|
139
|
-
externalAudienceId: createAudienceInput.audienceSettings?.externalAudienceId,
|
|
140
|
-
ttl: createAudienceInput.audienceSettings?.ttl || '',
|
|
141
|
-
audienceFees: [
|
|
142
|
-
{
|
|
143
|
-
cpmCents: createAudienceInput.audienceSettings?.cpmCents || '',
|
|
144
|
-
currency: createAudienceInput.audienceSettings?.currency || ''
|
|
145
|
-
}
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
const statsName = 'createAudience';
|
|
150
|
-
statsTags?.push(`slug:${destination.slug}`);
|
|
151
|
-
statsClient?.incr(`${statsName}.call`, 1, statsTags);
|
|
152
|
-
try {
|
|
153
|
-
const response = await request(`${endpoint}/amc/audiences/metadata`, {
|
|
154
|
-
method: 'POST',
|
|
155
|
-
json: payload
|
|
156
|
-
});
|
|
157
|
-
const r = await response.json();
|
|
158
|
-
const externalId = r.data.audienceId;
|
|
159
|
-
if (!externalId) {
|
|
160
|
-
statsClient?.incr(`${statsName}.error`, 1, statsTags);
|
|
161
|
-
throw new actions_core_1.IntegrationError('Invalid response from create audience request', 'INVALID_RESPONSE', 400);
|
|
162
|
-
}
|
|
163
|
-
statsClient?.incr(`${statsName}.success`, 1, statsTags);
|
|
164
|
-
return {
|
|
165
|
-
externalId
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
catch (e) {
|
|
169
|
-
const error = e;
|
|
170
|
-
const { message } = JSON.parse(error.response.data);
|
|
171
|
-
throw new actions_core_1.APIError(message, error.response.status);
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
async getAudience(request, getAudienceInput) {
|
|
175
|
-
const { statsContext } = getAudienceInput;
|
|
176
|
-
const audience_id = getAudienceInput.externalId;
|
|
177
|
-
const endpoint = getAudienceInput.settings.region;
|
|
178
|
-
const { statsClient, tags: statsTags } = statsContext || {};
|
|
179
|
-
const statsName = 'getAudience';
|
|
180
|
-
statsTags?.push(`slug:${destination.slug}`);
|
|
181
|
-
statsClient?.incr(`${statsName}.call`, 1, statsTags);
|
|
182
|
-
if (!audience_id) {
|
|
183
|
-
throw new actions_core_1.IntegrationError('Missing audience_id value', 'MISSING_REQUIRED_FIELD', 400);
|
|
184
|
-
}
|
|
185
|
-
try {
|
|
186
|
-
const response = await request(`${endpoint}/amc/audiences/metadata/${audience_id}`, {
|
|
187
|
-
method: 'GET'
|
|
188
|
-
});
|
|
189
|
-
const r = await response.json();
|
|
190
|
-
const externalId = r.data.audienceId;
|
|
191
|
-
if (externalId !== getAudienceInput.externalId) {
|
|
192
|
-
statsClient?.incr(`${statsName}.error`, 1, statsTags);
|
|
193
|
-
throw new actions_core_1.IntegrationError("Unable to verify ownership over audience. Segment Audience ID doesn't match Amazon Ads ID.", 'INVALID_REQUEST_DATA', 400);
|
|
194
|
-
}
|
|
195
|
-
statsClient?.incr(`${statsName}.success`, 1, statsTags);
|
|
196
|
-
return {
|
|
197
|
-
externalId
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
catch (e) {
|
|
201
|
-
const error = e;
|
|
202
|
-
const { message } = JSON.parse(error.response.data);
|
|
203
|
-
throw new actions_core_1.APIError(message, error.response.status);
|
|
204
|
-
}
|
|
205
80
|
}
|
|
206
81
|
},
|
|
207
82
|
actions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/amazon-ads/index.ts"],"names":[],"mappings":";;;;;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/amazon-ads/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAgG;AAIhG,oEAA2C;AAG3C,MAAM,WAAW,GAA4C;IAC3D,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,6CAA6C;gBAC1D,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,oCAAoC,EAAE;oBAC5E,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,uCAAuC,EAAE;oBACxE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,uCAAuC,EAAE;iBAC3E;gBACD,OAAO,EAAE,oBAAoB;gBAC7B,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE;gBACtB,MAAM,IAAI,yCAA0B,CAAC,gEAAgE,CAAC,CAAA;aACvG;YAED,IAAI;gBACF,MAAM,OAAO,CAAuB,gDAAgD,EAAE;oBACpF,MAAM,EAAE,KAAK;iBACd,CAAC,CAAA;aACH;YAAC,OAAO,CAAM,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,cAAc,EAAE;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,kBAAkB,EAAE,KAAK;SAC1B;KAWF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,19 +1,2 @@
|
|
|
1
1
|
export interface Payload {
|
|
2
|
-
records: {
|
|
3
|
-
external_user_id: string;
|
|
4
|
-
user_action: string;
|
|
5
|
-
country_code?: string;
|
|
6
|
-
measurements?: string;
|
|
7
|
-
hashedPII: {
|
|
8
|
-
firstname?: string;
|
|
9
|
-
address?: string;
|
|
10
|
-
phone?: string;
|
|
11
|
-
city?: string;
|
|
12
|
-
state?: string;
|
|
13
|
-
email?: string;
|
|
14
|
-
lastname?: string;
|
|
15
|
-
postal?: string;
|
|
16
|
-
}[];
|
|
17
|
-
}[];
|
|
18
|
-
audienceId: number;
|
|
19
2
|
}
|
|
@@ -1,122 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
3
|
const action = {
|
|
5
|
-
title: 'Sync
|
|
4
|
+
title: 'Sync Audiences',
|
|
6
5
|
description: 'Sync audiences from Segment to Amazon Ads Audience.',
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type: 'object',
|
|
13
|
-
multiple: true,
|
|
14
|
-
required: true,
|
|
15
|
-
properties: {
|
|
16
|
-
external_user_id: {
|
|
17
|
-
label: 'External User ID',
|
|
18
|
-
description: 'This is an external user identifier defined by data providers.',
|
|
19
|
-
type: 'string',
|
|
20
|
-
required: true
|
|
21
|
-
},
|
|
22
|
-
user_action: {
|
|
23
|
-
label: 'User Action',
|
|
24
|
-
description: 'A specific key used to define action type.',
|
|
25
|
-
type: 'string',
|
|
26
|
-
required: true,
|
|
27
|
-
choices: [
|
|
28
|
-
{ label: `Auto Detect`, value: 'AUTO' },
|
|
29
|
-
{ label: `Create`, value: 'CREATE' },
|
|
30
|
-
{ label: 'Delete', value: 'DELETE' }
|
|
31
|
-
],
|
|
32
|
-
default: 'AUTO'
|
|
33
|
-
},
|
|
34
|
-
country_code: {
|
|
35
|
-
label: 'Country Code',
|
|
36
|
-
description: 'A String value representing ISO 3166-1 alpha-2 country code for the members in this audience.',
|
|
37
|
-
type: 'string'
|
|
38
|
-
},
|
|
39
|
-
measurements: {
|
|
40
|
-
label: 'Measurements',
|
|
41
|
-
type: 'string'
|
|
42
|
-
},
|
|
43
|
-
hashedPII: {
|
|
44
|
-
label: `hashed PII`,
|
|
45
|
-
description: 'List of hashed personally-identifiable information records to be matched with Amazon identities for future use. All inputs must be properly normalized and SHA-256 hashed.',
|
|
46
|
-
type: 'object',
|
|
47
|
-
required: true,
|
|
48
|
-
multiple: true,
|
|
49
|
-
properties: {
|
|
50
|
-
firstname: {
|
|
51
|
-
label: 'Measurements',
|
|
52
|
-
type: 'string'
|
|
53
|
-
},
|
|
54
|
-
address: {
|
|
55
|
-
label: 'Measurements',
|
|
56
|
-
type: 'string'
|
|
57
|
-
},
|
|
58
|
-
phone: {
|
|
59
|
-
label: 'Measurements',
|
|
60
|
-
type: 'string'
|
|
61
|
-
},
|
|
62
|
-
city: {
|
|
63
|
-
label: 'Measurements',
|
|
64
|
-
type: 'string'
|
|
65
|
-
},
|
|
66
|
-
state: {
|
|
67
|
-
label: 'Measurements',
|
|
68
|
-
type: 'string'
|
|
69
|
-
},
|
|
70
|
-
email: {
|
|
71
|
-
label: 'Measurements',
|
|
72
|
-
type: 'string'
|
|
73
|
-
},
|
|
74
|
-
lastname: {
|
|
75
|
-
label: 'Measurements',
|
|
76
|
-
type: 'string'
|
|
77
|
-
},
|
|
78
|
-
postal: {
|
|
79
|
-
label: 'Measurements',
|
|
80
|
-
type: 'string'
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
audienceId: {
|
|
87
|
-
label: 'Audience ID',
|
|
88
|
-
type: 'number',
|
|
89
|
-
required: true,
|
|
90
|
-
description: 'An number value representing the Amazon audience identifier. This is the identifier that is returned during audience creation.'
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
perform: (request, { settings, payload }) => {
|
|
94
|
-
return processPayload(request, settings, payload);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
async function processPayload(request, settings, payload) {
|
|
98
|
-
if (payload.audienceId) {
|
|
99
|
-
throw new actions_core_1.PayloadValidationError('Audience ID is required.');
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
const response = await request(`${settings.region}/amc/audiences/records`, {
|
|
103
|
-
method: 'POST',
|
|
104
|
-
json: payload
|
|
6
|
+
fields: {},
|
|
7
|
+
perform: (request, data) => {
|
|
8
|
+
return request('https://example.com', {
|
|
9
|
+
method: 'post',
|
|
10
|
+
json: data.payload
|
|
105
11
|
});
|
|
106
|
-
const r = await response.json();
|
|
107
|
-
const jobRequestId = r.data.jobRequestId;
|
|
108
|
-
if (!jobRequestId) {
|
|
109
|
-
throw new actions_core_1.IntegrationError('Invalid response from upload audinece record call', 'INVALID_RESPONSE', 400);
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
jobRequestId
|
|
113
|
-
};
|
|
114
12
|
}
|
|
115
|
-
|
|
116
|
-
const error = e;
|
|
117
|
-
const { message } = JSON.parse(error.response.data);
|
|
118
|
-
throw new actions_core_1.APIError(message, error.response.status);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
13
|
+
};
|
|
121
14
|
exports.default = action;
|
|
122
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/amazon-ads/syncAudiences/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/amazon-ads/syncAudiences/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,qDAAqD;IAClE,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,OAAO,OAAO,CAAC,qBAAqB,EAAE;YACpC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,OAAO;SACnB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -9,7 +9,7 @@ export declare const dateStringToFuzzyDate: (dateString: string | number) => fal
|
|
|
9
9
|
y: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const augmentFieldsWithConstituentFields: (fields: Record<string, InputField>) => Record<string, InputField>;
|
|
12
|
-
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<
|
|
12
|
+
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<Phone> | Partial<Constituent> | Partial<Address> | Partial<OnlinePresence>)[];
|
|
13
13
|
export declare const buildConstituentPayloadFromPayload: (payload: StringIndexedObject) => Partial<CreateOrUpdateIndividualConstituentPayload>;
|
|
14
14
|
export declare const buildGiftDataFromPayload: (constituentId: string, payload: CreateGiftPayload) => Partial<Gift>;
|
|
15
15
|
export declare const buildConstituentActionDataFromPayload: (constituentId: string, payload: CreateConstituentAction) => Partial<ConstituentAction>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const trackApiEndpoint: ({ accountRegion }: {
|
|
2
2
|
accountRegion?: string | undefined;
|
|
3
|
-
}) => "https://track
|
|
3
|
+
}) => "https://track.customer.io" | "https://track-eu.customer.io";
|
|
4
4
|
export declare enum AccountRegion {
|
|
5
5
|
US = "US \uD83C\uDDFA\uD83C\uDDF8",
|
|
6
6
|
EU = "EU \uD83C\uDDEA\uD83C\uDDFA"
|
|
@@ -17,6 +17,7 @@ const isDestinationActionService_1 = require("./isDestinationActionService");
|
|
|
17
17
|
const ResponseError_1 = require("./ResponseError");
|
|
18
18
|
const IntegrationErrorWrapper_1 = require("./IntegrationErrorWrapper");
|
|
19
19
|
const truncate_1 = __importDefault(require("lodash/truncate"));
|
|
20
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
20
21
|
class EngageActionPerformer {
|
|
21
22
|
constructor(requestClient, executeInput) {
|
|
22
23
|
this.requestClient = requestClient;
|
|
@@ -75,6 +76,20 @@ class EngageActionPerformer {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
});
|
|
79
|
+
op?.onCatch.push(() => {
|
|
80
|
+
const respError = op?.error;
|
|
81
|
+
if (respError) {
|
|
82
|
+
const errorDetails = ResponseError_1.getErrorDetails(respError);
|
|
83
|
+
const msgLowercare = errorDetails?.message?.toLowerCase();
|
|
84
|
+
const isTimeoutErrorInOnCatch = msgLowercare?.includes('timeout') ||
|
|
85
|
+
msgLowercare?.includes('timedout') ||
|
|
86
|
+
msgLowercare?.includes('exceeded the deadline') ||
|
|
87
|
+
errorDetails.code?.toLowerCase().includes('etimedout');
|
|
88
|
+
if (isTimeoutErrorInOnCatch) {
|
|
89
|
+
op.error = new actions_core_1.RetryableError('Timeout error in on Catch, retrying...');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
78
93
|
return await this.requestClient(url, options);
|
|
79
94
|
}
|
|
80
95
|
redactPii(pii) {
|
|
@@ -133,7 +148,8 @@ __decorate([
|
|
|
133
148
|
__decorate([
|
|
134
149
|
track_1.track({
|
|
135
150
|
onTry: addUrlToLog,
|
|
136
|
-
onFinally: addUrlToLog
|
|
151
|
+
onFinally: addUrlToLog,
|
|
152
|
+
onCatch: addUrlToLog
|
|
137
153
|
})
|
|
138
154
|
], EngageActionPerformer.prototype, "request", null);
|
|
139
155
|
exports.EngageActionPerformer = EngageActionPerformer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngageActionPerformer.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/EngageActionPerformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,iDAA6C;AAC7C,+CAA2C;AAC3C,mCAAiD;AACjD,6EAAyE;AACzE,mDAAgE;AAGhE,uEAAmE;AAEnE,+DAAsC;
|
|
1
|
+
{"version":3,"file":"EngageActionPerformer.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/EngageActionPerformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,iDAA6C;AAC7C,+CAA2C;AAC3C,mCAAiD;AACjD,6EAAyE;AACzE,mDAAgE;AAGhE,uEAAmE;AAEnE,+DAAsC;AACtC,wDAAsD;AAKtD,MAAsB,qBAAqB;IASzC,YAAqB,aAA4B,EAAW,YAA+C;QAAtF,kBAAa,GAAb,aAAa,CAAe;QAAW,iBAAY,GAAZ,YAAY,CAAmC;QARlG,WAAM,GAAiB,IAAI,2BAAY,CAAC,IAAI,CAAC,CAAA;QAC7C,gBAAW,GAAgB,IAAI,yBAAW,CAAC,IAAI,CAAC,CAAA;QAChD,kBAAa,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAA;QAOtD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,CAAA;QACnC,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAA;IACvC,CAAC;IAKD,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,aAAa,EAAE,EAAE,CAAA;QAC5B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAA;IACzB,CAAC;IAkBD,KAAK,CAAC,OAAO,CAAiB,GAAW,EAAE,OAAwB;QACjE,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;YAEtB,MAAM,SAAS,GAAG,EAAE,EAAE,KAAsB,CAAA;YAC5C,IAAI,SAAS,EAAE;gBACb,M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AAI,CAAC,kBAAQ,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;KACpD;AACH,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { TryCatchFinallyContext, TryCatchFinallyHook } from './wrapTryCatchFinallyPromisable';
|
|
2
2
|
export declare type OperationFinallyHooksContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
3
3
|
onFinally: (() => void)[];
|
|
4
|
+
onCatch: (() => void)[];
|
|
4
5
|
decoratorArgs?: {
|
|
5
6
|
onTry?: (ctx: TContext) => void;
|
|
6
7
|
onFinally?: (ctx: TContext) => void;
|
|
8
|
+
onCatch?: (ctx: TContext) => void;
|
|
7
9
|
};
|
|
8
10
|
};
|
|
9
11
|
export declare class OperationFinallyHooks {
|
|
@@ -11,4 +13,5 @@ export declare class OperationFinallyHooks {
|
|
|
11
13
|
static getPriority(): number;
|
|
12
14
|
static onTry<TContext extends TryCatchFinallyContext>(ctx: OperationFinallyHooksContext<TContext>): void;
|
|
13
15
|
static onFinally<TContext extends TryCatchFinallyContext>(ctx: OperationFinallyHooksContext<TContext>): void;
|
|
16
|
+
static onCatch<TContext extends TryCatchFinallyContext>(ctx: OperationFinallyHooksContext<TContext>): void;
|
|
14
17
|
}
|
|
@@ -10,6 +10,7 @@ class OperationFinallyHooks {
|
|
|
10
10
|
}
|
|
11
11
|
static onTry(ctx) {
|
|
12
12
|
ctx.onFinally = [];
|
|
13
|
+
ctx.onCatch = [];
|
|
13
14
|
ctx.decoratorArgs?.onTry?.(ctx);
|
|
14
15
|
}
|
|
15
16
|
static onFinally(ctx) {
|
|
@@ -26,6 +27,20 @@ class OperationFinallyHooks {
|
|
|
26
27
|
}
|
|
27
28
|
ctx.decoratorArgs?.onFinally?.(ctx);
|
|
28
29
|
}
|
|
30
|
+
static onCatch(ctx) {
|
|
31
|
+
for (const hook of ctx.onCatch) {
|
|
32
|
+
try {
|
|
33
|
+
hook();
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
const error = e;
|
|
37
|
+
const loggerCtx = ctx;
|
|
38
|
+
if (loggerCtx.logs)
|
|
39
|
+
loggerCtx.logs.push(`Error in onCatch hook: ${error?.message || error.toString()}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
ctx.decoratorArgs?.onFinally?.(ctx);
|
|
43
|
+
}
|
|
29
44
|
}
|
|
30
45
|
exports.OperationFinallyHooks = OperationFinallyHooks;
|
|
31
46
|
//# sourceMappingURL=OperationFinallyHooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationFinallyHooks.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationFinallyHooks.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"OperationFinallyHooks.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationFinallyHooks.ts"],"names":[],"mappings":";;;AAiBA,MAAa,qBAAqB;IAChC,MAAM,CAAC,sBAAsB,CAAC,IAAkC;QAC9D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,CAAC,WAAW;QAChB,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,MAAM,CAAC,KAAK,CAA0C,GAA2C;QAC/F,GAAG,CAAC,SAAS,GAAG,EAAE,CAAA;QAClB,GAAG,CAAC,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,SAAS,CAA0C,GAA2C;QACnG,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,SAAS,EAAE;YAChC,IAAI;gBACF,IAAI,EAAE,CAAA;aACP;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,KAAK,GAAG,CAAU,CAAA;gBAExB,MAAM,SAAS,GAAG,GAAsC,CAAA;gBACxD,IAAI,SAAS,CAAC,IAAI;oBAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,KAAK,EAAE,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;aAC1G;SACF;QACD,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,CAAC,OAAO,CAA0C,GAA2C;QACjG,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE;YAC9B,IAAI;gBACF,IAAI,EAAE,CAAA;aACP;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,KAAK,GAAG,CAAU,CAAA;gBAExB,MAAM,SAAS,GAAG,GAAsC,CAAA;gBACxD,IAAI,SAAS,CAAC,IAAI;oBAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,KAAK,EAAE,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;aACxG;SACF;QACD,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;IACrC,CAAC;CACF;AAxCD,sDAwCC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ContextFromDecorator } from './operationTracking';
|
|
2
2
|
export declare const track: ((decoratorArgs?: ({
|
|
3
|
-
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
4
|
-
} & {
|
|
5
|
-
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
6
|
-
} & {
|
|
7
3
|
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
8
4
|
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
5
|
+
onCatch?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
9
6
|
} & import("./operationTracking").OperationLoggerDecoratorArgs & {
|
|
7
|
+
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
10
|
+
} & {
|
|
10
11
|
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
11
12
|
}) | undefined) => import("./operationTracking").GenericMethodDecorator<(this: any, ...args: any[]) => any>) & {
|
|
12
13
|
getCurrentOperation(classInstance: any): (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
@@ -15,13 +16,18 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
15
16
|
}) | undefined;
|
|
16
17
|
} & {
|
|
17
18
|
_contextType: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
tags: string[];
|
|
21
|
-
};
|
|
19
|
+
onFinally: (() => void)[];
|
|
20
|
+
onCatch: (() => void)[];
|
|
22
21
|
decoratorArgs?: {
|
|
23
|
-
|
|
22
|
+
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
23
|
+
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
24
|
+
onCatch?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
24
25
|
} | undefined;
|
|
26
|
+
} & {
|
|
27
|
+
logs: string[];
|
|
28
|
+
logMetadata?: Record<string, unknown> | undefined;
|
|
29
|
+
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
30
|
+
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
25
31
|
} & {
|
|
26
32
|
decoratorArgs?: {
|
|
27
33
|
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
@@ -33,16 +39,13 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
33
39
|
start?: number | undefined;
|
|
34
40
|
duration?: number | undefined;
|
|
35
41
|
} & {
|
|
36
|
-
|
|
42
|
+
tags: string[];
|
|
43
|
+
sharedContext: {
|
|
44
|
+
tags: string[];
|
|
45
|
+
};
|
|
37
46
|
decoratorArgs?: {
|
|
38
|
-
|
|
39
|
-
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
47
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
40
48
|
} | undefined;
|
|
41
|
-
} & {
|
|
42
|
-
logs: string[];
|
|
43
|
-
logMetadata?: Record<string, unknown> | undefined;
|
|
44
|
-
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
45
|
-
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
46
49
|
} & {
|
|
47
50
|
decoratorArgs?: {
|
|
48
51
|
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
audience_key: string;
|
|
3
|
+
identifier_data?: {
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
unhashed_identifier_data?: {
|
|
7
|
+
[k: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
delimiter: string;
|
|
10
|
+
filename: string;
|
|
11
|
+
enable_batching: boolean;
|
|
12
|
+
batch_size?: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEntered/generated-types.ts"],"names":[],"mappings":""}
|