@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.
Files changed (155) hide show
  1. package/dist/destinations/amazon-ads/generated-types.d.ts +0 -9
  2. package/dist/destinations/amazon-ads/index.d.ts +2 -2
  3. package/dist/destinations/amazon-ads/index.js +3 -128
  4. package/dist/destinations/amazon-ads/index.js.map +1 -1
  5. package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +0 -17
  6. package/dist/destinations/amazon-ads/syncAudiences/index.js +7 -114
  7. package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -1
  8. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
  9. package/dist/destinations/customerio/utils.d.ts +1 -1
  10. package/dist/destinations/engage/utils/EngageActionPerformer.js +17 -1
  11. package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -1
  12. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.d.ts +3 -0
  13. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js +15 -0
  14. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -1
  15. package/dist/destinations/engage/utils/track.d.ts +20 -17
  16. package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.d.ts +13 -0
  17. package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.js.map +1 -0
  18. package/dist/destinations/liveramp-audiences/audienceEntered/index.js +95 -0
  19. package/dist/destinations/liveramp-audiences/audienceEntered/index.js.map +1 -0
  20. package/dist/destinations/liveramp-audiences/audienceEntered/s3.d.ts +6 -0
  21. package/dist/destinations/liveramp-audiences/audienceEntered/s3.js +37 -0
  22. package/dist/destinations/liveramp-audiences/audienceEntered/s3.js.map +1 -0
  23. package/dist/destinations/liveramp-audiences/audienceEntered/sftp.d.ts +7 -0
  24. package/dist/destinations/liveramp-audiences/audienceEntered/sftp.js +52 -0
  25. package/dist/destinations/liveramp-audiences/audienceEntered/sftp.js.map +1 -0
  26. package/package.json +1 -1
  27. package/dist/destinations/amazon-ads/utils.d.ts +0 -6
  28. package/dist/destinations/amazon-ads/utils.js +0 -8
  29. package/dist/destinations/amazon-ads/utils.js.map +0 -1
  30. package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +0 -1
  31. package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +0 -184
  32. package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +0 -1
  33. package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -4
  34. package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +0 -1
  35. package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +0 -5
  36. package/dist/destinations/klaviyo/removeProfileToList/index.js +0 -43
  37. package/dist/destinations/klaviyo/removeProfileToList/index.js.map +0 -1
  38. package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +0 -22
  39. package/dist/destinations/movable-ink/categoryView/generated-types.js +0 -3
  40. package/dist/destinations/movable-ink/categoryView/generated-types.js.map +0 -1
  41. package/dist/destinations/movable-ink/categoryView/index.js +0 -43
  42. package/dist/destinations/movable-ink/categoryView/index.js.map +0 -1
  43. package/dist/destinations/movable-ink/conversion/generated-types.d.ts +0 -20
  44. package/dist/destinations/movable-ink/conversion/generated-types.js +0 -3
  45. package/dist/destinations/movable-ink/conversion/generated-types.js.map +0 -1
  46. package/dist/destinations/movable-ink/conversion/index.d.ts +0 -5
  47. package/dist/destinations/movable-ink/conversion/index.js +0 -45
  48. package/dist/destinations/movable-ink/conversion/index.js.map +0 -1
  49. package/dist/destinations/movable-ink/fields.d.ts +0 -21
  50. package/dist/destinations/movable-ink/fields.js +0 -236
  51. package/dist/destinations/movable-ink/fields.js.map +0 -1
  52. package/dist/destinations/movable-ink/identify/generated-types.d.ts +0 -7
  53. package/dist/destinations/movable-ink/identify/generated-types.js +0 -3
  54. package/dist/destinations/movable-ink/identify/generated-types.js.map +0 -1
  55. package/dist/destinations/movable-ink/identify/index.d.ts +0 -5
  56. package/dist/destinations/movable-ink/identify/index.js +0 -32
  57. package/dist/destinations/movable-ink/identify/index.js.map +0 -1
  58. package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +0 -22
  59. package/dist/destinations/movable-ink/productAdded/generated-types.js +0 -3
  60. package/dist/destinations/movable-ink/productAdded/generated-types.js.map +0 -1
  61. package/dist/destinations/movable-ink/productAdded/index.d.ts +0 -5
  62. package/dist/destinations/movable-ink/productAdded/index.js +0 -43
  63. package/dist/destinations/movable-ink/productAdded/index.js.map +0 -1
  64. package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +0 -21
  65. package/dist/destinations/movable-ink/productViewed/generated-types.js +0 -3
  66. package/dist/destinations/movable-ink/productViewed/generated-types.js.map +0 -1
  67. package/dist/destinations/movable-ink/productViewed/index.d.ts +0 -5
  68. package/dist/destinations/movable-ink/productViewed/index.js +0 -43
  69. package/dist/destinations/movable-ink/productViewed/index.js.map +0 -1
  70. package/dist/destinations/movable-ink/search/generated-types.d.ts +0 -12
  71. package/dist/destinations/movable-ink/search/generated-types.js +0 -3
  72. package/dist/destinations/movable-ink/search/generated-types.js.map +0 -1
  73. package/dist/destinations/movable-ink/search/index.d.ts +0 -5
  74. package/dist/destinations/movable-ink/search/index.js +0 -43
  75. package/dist/destinations/movable-ink/search/index.js.map +0 -1
  76. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +0 -25
  77. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +0 -3
  78. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +0 -1
  79. package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +0 -5
  80. package/dist/destinations/movable-ink/sendCustomEvent/index.js +0 -48
  81. package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +0 -1
  82. package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +0 -14
  83. package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js +0 -3
  84. package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +0 -1
  85. package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +0 -5
  86. package/dist/destinations/responsys/asyncMergePetRecords/index.js +0 -113
  87. package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +0 -1
  88. package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +0 -20
  89. package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js +0 -3
  90. package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +0 -1
  91. package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +0 -5
  92. package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +0 -174
  93. package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +0 -1
  94. package/dist/destinations/responsys/rsp-operations.d.ts +0 -14
  95. package/dist/destinations/responsys/rsp-operations.js +0 -33
  96. package/dist/destinations/responsys/rsp-operations.js.map +0 -1
  97. package/dist/destinations/responsys/rsp-properties.d.ts +0 -4
  98. package/dist/destinations/responsys/rsp-properties.js +0 -27
  99. package/dist/destinations/responsys/rsp-properties.js.map +0 -1
  100. package/dist/destinations/responsys-cloud/generated-types.d.ts +0 -20
  101. package/dist/destinations/responsys-cloud/generated-types.js +0 -3
  102. package/dist/destinations/responsys-cloud/generated-types.js.map +0 -1
  103. package/dist/destinations/responsys-cloud/index.d.ts +0 -4
  104. package/dist/destinations/responsys-cloud/index.js +0 -207
  105. package/dist/destinations/responsys-cloud/index.js.map +0 -1
  106. package/dist/destinations/responsys-cloud/sendAudience/generated-types.d.ts +0 -16
  107. package/dist/destinations/responsys-cloud/sendAudience/generated-types.js +0 -3
  108. package/dist/destinations/responsys-cloud/sendAudience/generated-types.js.map +0 -1
  109. package/dist/destinations/responsys-cloud/sendAudience/index.d.ts +0 -5
  110. package/dist/destinations/responsys-cloud/sendAudience/index.js +0 -109
  111. package/dist/destinations/responsys-cloud/sendAudience/index.js.map +0 -1
  112. package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.d.ts +0 -11
  113. package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js +0 -3
  114. package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js.map +0 -1
  115. package/dist/destinations/responsys-cloud/sendCustomTraits/index.d.ts +0 -5
  116. package/dist/destinations/responsys-cloud/sendCustomTraits/index.js +0 -72
  117. package/dist/destinations/responsys-cloud/sendCustomTraits/index.js.map +0 -1
  118. package/dist/destinations/responsys-cloud/shared_properties.d.ts +0 -3
  119. package/dist/destinations/responsys-cloud/shared_properties.js +0 -19
  120. package/dist/destinations/responsys-cloud/shared_properties.js.map +0 -1
  121. package/dist/destinations/responsys-cloud/types.d.ts +0 -38
  122. package/dist/destinations/responsys-cloud/types.js +0 -3
  123. package/dist/destinations/responsys-cloud/types.js.map +0 -1
  124. package/dist/destinations/responsys-cloud/upsertListMember/generated-types.d.ts +0 -14
  125. package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js +0 -3
  126. package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js.map +0 -1
  127. package/dist/destinations/responsys-cloud/upsertListMember/index.d.ts +0 -5
  128. package/dist/destinations/responsys-cloud/upsertListMember/index.js +0 -85
  129. package/dist/destinations/responsys-cloud/upsertListMember/index.js.map +0 -1
  130. package/dist/destinations/responsys-cloud/utils.d.ts +0 -20
  131. package/dist/destinations/responsys-cloud/utils.js +0 -179
  132. package/dist/destinations/responsys-cloud/utils.js.map +0 -1
  133. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +0 -1
  134. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +0 -381
  135. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +0 -1
  136. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +0 -1
  137. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +0 -581
  138. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +0 -1
  139. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +0 -4
  140. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +0 -97
  141. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +0 -1
  142. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +0 -3
  143. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +0 -43
  144. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +0 -1
  145. package/dist/destinations/trackey/group.types.d.ts +0 -11
  146. package/dist/destinations/trackey/group.types.js +0 -3
  147. package/dist/destinations/trackey/group.types.js.map +0 -1
  148. package/dist/destinations/trackey/identify.types.d.ts +0 -11
  149. package/dist/destinations/trackey/identify.types.js +0 -3
  150. package/dist/destinations/trackey/identify.types.js.map +0 -1
  151. package/dist/destinations/trackey/track.types.d.ts +0 -12
  152. package/dist/destinations/trackey/track.types.js +0 -3
  153. package/dist/destinations/trackey/track.types.js.map +0 -1
  154. /package/dist/destinations/{klaviyo/removeProfileToList → liveramp-audiences/audienceEntered}/generated-types.js +0 -0
  155. /package/dist/destinations/{movable-ink/categoryView → liveramp-audiences/audienceEntered}/index.d.ts +0 -0
@@ -1,12 +1,3 @@
1
1
  export interface Settings {
2
2
  region: string;
3
- advertiserId: number;
4
- }
5
- export interface AudienceSettings {
6
- description: string;
7
- countryCode?: string;
8
- externalAudienceId: string;
9
- cpmCents?: number;
10
- currency?: string;
11
- ttl?: number;
12
3
  }
@@ -1,4 +1,4 @@
1
1
  import type { AudienceDestinationDefinition } from '@segment/actions-core';
2
- import type { Settings, AudienceSettings } from './generated-types';
3
- declare const destination: AudienceDestinationDefinition<Settings, AudienceSettings>;
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: 'https://advertising-api.amazon.com',
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
- 'Content-Type': 'application/vnd.amcaudiences.v1+json',
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,wDAA0G;AAK1G,oEAA2C;AAG3C,MAAM,WAAW,GAA8D;IAC7E,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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;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 Audience',
4
+ title: 'Sync Audiences',
6
5
  description: 'Sync audiences from Segment to Amazon Ads Audience.',
7
- defaultSubscription: 'event = "Audience Entered" or event = "Audience Exited"',
8
- fields: {
9
- records: {
10
- label: 'Records',
11
- description: 'Records to create and upload audiences to Amazon DSP.',
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
- catch (e) {
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":";;AACA,wDAA0F;AAK1F,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe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B,MAAM,IAAI,+BAAgB,CAAC,mDAAmD,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAA;SACzG;QAED,OAAO;YACL,YAAY;SACb,CAAA;KACF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,KAAK,GAAG,CAAmB,CAAA;QACjC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QACnD,MAAM,IAAI,uBAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;KACnD;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
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<Address> | Partial<OnlinePresence> | Partial<Phone> | Partial<Constituent>)[];
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-eu.customer.io" | "https://track.customer.io";
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;AAKtC,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;IAiBD,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,MAAM,YAAY,GAAG,+BAAe,CAAC,SAAS,CAAC,CAAA;gBAC/C,MAAM,YAAY,GAAG,YAAY,EAAE,OAAO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,EACd,UAAmF;QAEnF,MAAM,iDAAuB,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;IAC9E,CAAC;CACF;AAtIC;IADC,aAAK,EAAE;oDAIP;AAiBD;IAJC,aAAK,CAAC;QACL,KAAK,EAAE,WAAW;QAClB,SAAS,EAAE,WAAW;KACvB,CAAC;oDAgDD;AApFH,sDAuJC;AAED,SAAS,WAAW,CAAC,GAAQ;IAE3B,MAAM,OAAO,GAAG,GAAuB,CAAA;IACvC,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;IAChC,IAAI,OAAO,CAAC,IAAI,IAAI,MAAM,EAAE;QAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAQ,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;KACpD;AACH,CAAC"}
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;IACv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C,aAAK,EAAE;oDAIP;AAkBD;IALC,aAAK,CAAC;QACL,KAAK,EAAE,WAAW;QAClB,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,WAAW;KACrB,CAAC;oDAmED;AAxGH,sDA2KC;AAED,SAAS,WAAW,CAAC,GAAQ;IAE3B,MAAM,OAAO,GAAG,GAAuB,CAAA;IACvC,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;IAChC,IAAI,OAAO,CAAC,IAAI,IAAI,MAAM,EAAE;QAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,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":";;;AAeA,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,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;CACF;AA1BD,sDA0BC"}
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
- tags: string[];
19
- sharedContext: {
20
- tags: string[];
21
- };
19
+ onFinally: (() => void)[];
20
+ onCatch: (() => void)[];
22
21
  decoratorArgs?: {
23
- shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
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
- onFinally: (() => void)[];
42
+ tags: string[];
43
+ sharedContext: {
44
+ tags: string[];
45
+ };
37
46
  decoratorArgs?: {
38
- onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
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":""}