@segment/action-destinations 3.259.0-staging-ddaa2bef5 → 3.259.0-staging-460490c9d
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/index.js +5 -3
- package/dist/destinations/amazon-ads/index.js.map +1 -1
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +3 -3
- package/dist/destinations/amazon-ads/syncAudiences/index.js +42 -7
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +2 -5
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +18 -98
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -1
- package/dist/destinations/engage/utils/track.d.ts +10 -10
- package/dist/destinations/responsys-cloud/generated-types.d.ts +20 -0
- package/dist/destinations/responsys-cloud/generated-types.js +3 -0
- package/dist/destinations/responsys-cloud/generated-types.js.map +1 -0
- package/dist/destinations/responsys-cloud/index.d.ts +4 -0
- package/dist/destinations/responsys-cloud/index.js +207 -0
- package/dist/destinations/responsys-cloud/index.js.map +1 -0
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.d.ts +16 -0
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.js +3 -0
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.js.map +1 -0
- package/dist/destinations/responsys-cloud/sendAudience/index.d.ts +5 -0
- package/dist/destinations/responsys-cloud/sendAudience/index.js +109 -0
- package/dist/destinations/responsys-cloud/sendAudience/index.js.map +1 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.d.ts +11 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js +3 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js.map +1 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.d.ts +5 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.js +72 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.js.map +1 -0
- package/dist/destinations/responsys-cloud/shared_properties.d.ts +3 -0
- package/dist/destinations/responsys-cloud/shared_properties.js +19 -0
- package/dist/destinations/responsys-cloud/shared_properties.js.map +1 -0
- package/dist/destinations/responsys-cloud/types.d.ts +38 -0
- package/dist/destinations/responsys-cloud/types.js +3 -0
- package/dist/destinations/responsys-cloud/types.js.map +1 -0
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.d.ts +14 -0
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js +3 -0
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js.map +1 -0
- package/dist/destinations/responsys-cloud/upsertListMember/index.d.ts +5 -0
- package/dist/destinations/responsys-cloud/upsertListMember/index.js +85 -0
- package/dist/destinations/responsys-cloud/upsertListMember/index.js.map +1 -0
- package/dist/destinations/responsys-cloud/utils.d.ts +20 -0
- package/dist/destinations/responsys-cloud/utils.js +179 -0
- package/dist/destinations/responsys-cloud/utils.js.map +1 -0
- package/package.json +1 -1
|
@@ -78,7 +78,6 @@ const destination = {
|
|
|
78
78
|
extendRequest({ auth }) {
|
|
79
79
|
return {
|
|
80
80
|
headers: {
|
|
81
|
-
'Content-Type': 'application/vnd.amcaudiences.v1+json',
|
|
82
81
|
authorization: `Bearer ${auth?.accessToken}`,
|
|
83
82
|
'Amazon-Advertising-API-ClientID': process.env.ACTIONS_AMAZON_ADS_CLIENT_ID || ''
|
|
84
83
|
}
|
|
@@ -177,7 +176,10 @@ const destination = {
|
|
|
177
176
|
payloadString = payloadString.replace(regex, '"advertiserId":$1');
|
|
178
177
|
const response = await request(`${endpoint}/amc/audiences/metadata`, {
|
|
179
178
|
method: 'POST',
|
|
180
|
-
body: payloadString
|
|
179
|
+
body: payloadString,
|
|
180
|
+
headers: {
|
|
181
|
+
'Content-Type': 'application/vnd.amcaudiences.v1+json'
|
|
182
|
+
}
|
|
181
183
|
});
|
|
182
184
|
const r = await response.json();
|
|
183
185
|
const externalId = r?.audienceId;
|
|
@@ -220,7 +222,7 @@ const destination = {
|
|
|
220
222
|
});
|
|
221
223
|
const r = await response.json();
|
|
222
224
|
const externalId = r?.audienceId;
|
|
223
|
-
if (externalId
|
|
225
|
+
if (externalId != getAudienceInput.externalId) {
|
|
224
226
|
statsClient?.incr(`${statsName}.error`, 1, statsTags);
|
|
225
227
|
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);
|
|
226
228
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/amazon-ads/index.ts"],"names":[],"mappings":";;;;;AACA,wDAA0G;AAG1G,mCAAyD;AAEzD,oEAA2C;AAE3C,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,EAAE;oBACxE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,uCAAuC,EAAE;iBAC3E;gBACD,OAAO,EAAE,oCAAoC;gBAC7C,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,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
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
22
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
23
|
const utils_1 = require("../utils");
|
|
24
|
+
const crypto = __importStar(require("crypto"));
|
|
5
25
|
const action = {
|
|
6
26
|
title: 'Sync Audience',
|
|
7
27
|
description: 'Sync audiences from Segment to Amazon Ads Audience.',
|
|
@@ -14,13 +34,13 @@ const action = {
|
|
|
14
34
|
multiple: true,
|
|
15
35
|
required: true,
|
|
16
36
|
properties: {
|
|
17
|
-
|
|
37
|
+
externalUserId: {
|
|
18
38
|
label: 'External User ID',
|
|
19
39
|
description: 'This is an external user identifier defined by data providers.',
|
|
20
40
|
type: 'string',
|
|
21
41
|
required: true
|
|
22
42
|
},
|
|
23
|
-
|
|
43
|
+
action: {
|
|
24
44
|
label: 'User Action',
|
|
25
45
|
description: 'A specific key used to define action type.',
|
|
26
46
|
type: 'string',
|
|
@@ -32,7 +52,7 @@ const action = {
|
|
|
32
52
|
],
|
|
33
53
|
default: 'AUTO'
|
|
34
54
|
},
|
|
35
|
-
|
|
55
|
+
countryCode: {
|
|
36
56
|
label: 'Country Code',
|
|
37
57
|
description: 'A String value representing ISO 3166-1 alpha-2 country code for the members in this audience.',
|
|
38
58
|
type: 'string'
|
|
@@ -100,17 +120,27 @@ async function processPayload(request, settings, payload) {
|
|
|
100
120
|
throw new actions_core_1.PayloadValidationError('Audience ID is required.');
|
|
101
121
|
}
|
|
102
122
|
try {
|
|
123
|
+
for (const data of payload.records) {
|
|
124
|
+
for (const obj of data.hashedPII) {
|
|
125
|
+
for (const key in obj) {
|
|
126
|
+
obj[key] = await normalizeAndHash(obj[key] ?? '');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
103
130
|
const response = await request(`${settings.region}/amc/audiences/records`, {
|
|
104
131
|
method: 'POST',
|
|
105
|
-
json: payload
|
|
132
|
+
json: payload,
|
|
133
|
+
headers: {
|
|
134
|
+
'Content-Type': 'application/vnd.amcaudiences.v1+json'
|
|
135
|
+
}
|
|
106
136
|
});
|
|
107
|
-
const
|
|
108
|
-
const jobRequestId =
|
|
137
|
+
const result = await response.json();
|
|
138
|
+
const jobRequestId = result?.jobRequestId;
|
|
109
139
|
if (!jobRequestId) {
|
|
110
140
|
throw new actions_core_1.IntegrationError('Invalid response from upload audinece record call', 'INVALID_RESPONSE', 400);
|
|
111
141
|
}
|
|
112
142
|
return {
|
|
113
|
-
|
|
143
|
+
result
|
|
114
144
|
};
|
|
115
145
|
}
|
|
116
146
|
catch (e) {
|
|
@@ -126,5 +156,10 @@ async function processPayload(request, settings, payload) {
|
|
|
126
156
|
}
|
|
127
157
|
}
|
|
128
158
|
}
|
|
159
|
+
async function normalizeAndHash(data) {
|
|
160
|
+
const normalizedData = data.toLowerCase().trim();
|
|
161
|
+
const sha256Hash = crypto.createHash('sha256').update(normalizedData).digest('hex');
|
|
162
|
+
return sha256Hash;
|
|
163
|
+
}
|
|
129
164
|
exports.default = action;
|
|
130
165
|
//# 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":";;;;;;;;;;;;;;;;;;;;;AACA,wDAA0F;AAG1F,oCAAyC;AACzC,+CAAgC;AAEhC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,qDAAqD;IAClE,mBAAmB,EAAE,yDAAyD;IAC9E,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,uDAAuD;YACpE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,cAAc,EAAE;oBACd,KAAK,EAAE,kBAAkB;oBACzB,WAAW,EAAE,gEAAgE;oBAC7E,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,MAAM,EAAE;oBACN,KAAK,EAAE,aAAa;oBACpB,WAAW,EAAE,4CAA4C;oBACzD,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE;wBACvC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;wBACpC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;qBACrC;oBACD,OAAO,EAAE,MAAM;iBAChB;gBACD,WAAW,EAAE;oBACX,KAAK,EAAE,cAAc;oBACrB,WAAW,EAAE,+FAA+F;oBAC5G,IAAI,EAAE,QAAQ;iBACf;gBACD,YAAY,EAAE;oBACZ,KAAK,EAAE,cAAc;oBACrB,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE;oBACT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GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAA;IAEhD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAEnF,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputField } from '@segment/actions-core';
|
|
2
2
|
import { RequestClient } from '@segment/actions-core';
|
|
3
|
-
import { Logger, StatsClient
|
|
3
|
+
import { Logger, StatsClient } from '@segment/actions-core/destination-kit';
|
|
4
4
|
import type { Settings } from '../generated-types';
|
|
5
5
|
import { Profile } from '../Profile';
|
|
6
6
|
export declare type ApiLookupConfig = {
|
|
@@ -13,9 +13,6 @@ export declare type ApiLookupConfig = {
|
|
|
13
13
|
headers?: object | undefined;
|
|
14
14
|
responseType: string;
|
|
15
15
|
};
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const getCachedResponse: ({ responseType }: ApiLookupConfig, requestId: string, dataFeedCache: DataFeedCache, datafeedTags: string[]) => Promise<any>;
|
|
18
|
-
export declare const performApiLookup: (request: RequestClient, apiLookupConfig: ApiLookupConfig, profile: Profile, statsClient: StatsClient | undefined, tags: string[], settings: Settings, logger?: Logger | undefined, dataFeedCache?: DataFeedCache | undefined) => Promise<any>;
|
|
16
|
+
export declare const performApiLookup: (request: RequestClient, { id, url, method, body, headers }: ApiLookupConfig, profile: Profile, statsClient: StatsClient | undefined, tags: string[], settings: Settings, logger?: Logger | undefined) => Promise<unknown>;
|
|
19
17
|
export declare const apiLookupActionFields: Record<string, InputField>;
|
|
20
18
|
export declare const apiLookupLiquidKey = "lookups";
|
|
21
|
-
export declare const FLAGON_NAME_DATA_FEEDS = "is-datafeeds-enabled";
|
|
@@ -1,125 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
3
|
+
exports.apiLookupLiquidKey = exports.apiLookupActionFields = exports.performApiLookup = void 0;
|
|
5
4
|
const actions_core_1 = require("@segment/actions-core");
|
|
6
5
|
const liquidjs_1 = require("liquidjs");
|
|
7
6
|
const Liquid = new liquidjs_1.Liquid();
|
|
8
|
-
const
|
|
9
|
-
const renderLiquidFields = async ({ id, url, body }, profile, datafeedTags, settings, logger) => {
|
|
7
|
+
const performApiLookup = async (request, { id, url, method, body, headers }, profile, statsClient, tags, settings, logger) => {
|
|
10
8
|
let renderedUrl;
|
|
11
9
|
let renderedBody;
|
|
12
10
|
try {
|
|
13
11
|
renderedUrl = await Liquid.parseAndRender(url, { profile });
|
|
14
12
|
}
|
|
15
13
|
catch (error) {
|
|
16
|
-
logger?.error(`TE Messaging: Email
|
|
17
|
-
|
|
14
|
+
logger?.error(`TE Messaging: Email api lookup url parse failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
15
|
+
tags.push('reason:parse_apilookup_url');
|
|
16
|
+
statsClient?.incr('actions-personas-messaging-sendgrid-error', 1, tags);
|
|
18
17
|
throw new actions_core_1.IntegrationError('Unable to parse email api lookup url', 'api lookup url parse failure', 400);
|
|
19
18
|
}
|
|
20
19
|
try {
|
|
21
20
|
renderedBody = body ? await Liquid.parseAndRender(body, { profile }) : undefined;
|
|
22
21
|
}
|
|
23
22
|
catch (error) {
|
|
24
|
-
logger?.error(`TE Messaging: Email
|
|
25
|
-
|
|
23
|
+
logger?.error(`TE Messaging: Email api lookup body parse failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
24
|
+
tags.push('reason:parse_apilookup_body');
|
|
25
|
+
statsClient?.incr('actions-personas-messaging-sendgrid-error', 1, tags);
|
|
26
26
|
throw new actions_core_1.IntegrationError('Unable to parse email api lookup body', 'api lookup body parse failure', 400);
|
|
27
27
|
}
|
|
28
|
-
return {
|
|
29
|
-
renderedUrl,
|
|
30
|
-
renderedBody
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
const getRequestId = ({ method, url, body, headers }) => {
|
|
34
|
-
const requestHash = crypto_1.createHash('sha256');
|
|
35
|
-
requestHash.update(`${method}${url}${body}${JSON.stringify(headers)}`);
|
|
36
|
-
const requestId = requestHash.digest('hex');
|
|
37
|
-
return requestId;
|
|
38
|
-
};
|
|
39
|
-
exports.getRequestId = getRequestId;
|
|
40
|
-
const getCachedResponse = async ({ responseType }, requestId, dataFeedCache, datafeedTags) => {
|
|
41
|
-
const cachedResponse = await dataFeedCache?.getRequestResponse(requestId);
|
|
42
|
-
if (!cachedResponse) {
|
|
43
|
-
datafeedTags.push('cache_hit:false');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
datafeedTags.push('cache_hit:true');
|
|
47
|
-
if (responseType === 'json') {
|
|
48
|
-
return JSON.parse(cachedResponse);
|
|
49
|
-
}
|
|
50
|
-
return cachedResponse;
|
|
51
|
-
};
|
|
52
|
-
exports.getCachedResponse = getCachedResponse;
|
|
53
|
-
const performApiLookup = async (request, apiLookupConfig, profile, statsClient, tags, settings, logger, dataFeedCache) => {
|
|
54
|
-
const { id, method, headers, cacheTtl, name } = apiLookupConfig;
|
|
55
|
-
const datafeedTags = [
|
|
56
|
-
...tags,
|
|
57
|
-
`datafeed_id:${id}`,
|
|
58
|
-
`datafeed_name:${name}`,
|
|
59
|
-
`space_id:${settings.spaceId}`,
|
|
60
|
-
`cache_ttl_greater_than_0:${cacheTtl > 0}`
|
|
61
|
-
];
|
|
62
28
|
try {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
let data;
|
|
73
|
-
try {
|
|
74
|
-
const res = await request(renderedUrl, {
|
|
75
|
-
headers: headers ?? undefined,
|
|
76
|
-
timeout: 3000,
|
|
77
|
-
method: method,
|
|
78
|
-
body: renderedBody,
|
|
79
|
-
skipResponseCloning: true
|
|
80
|
-
});
|
|
81
|
-
data = await res.data;
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
const respError = error.response;
|
|
85
|
-
logger?.error(`TE Messaging: Email api lookup failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
86
|
-
datafeedTags.push(`error:true`, `error_message:${error.message}`, `error_status:${respError?.status}`, 'reason:api_call_failure');
|
|
87
|
-
throw error;
|
|
88
|
-
}
|
|
89
|
-
const dataString = JSON.stringify(data);
|
|
90
|
-
const size = Buffer.byteLength(dataString, 'utf-8');
|
|
91
|
-
datafeedTags.push(`response_size_greater_than_mb:${size > maxResponseSizeBytes}`);
|
|
92
|
-
if (cacheTtl > 0) {
|
|
93
|
-
if (size <= maxResponseSizeBytes) {
|
|
94
|
-
try {
|
|
95
|
-
await dataFeedCache?.setRequestResponse(requestId, dataString, cacheTtl / 1000);
|
|
96
|
-
datafeedTags.push('cache_set:true');
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
logger?.error(`TE Messaging: Email api lookup cache set failure - api lookup id: ${id} - ${settings.spaceId} - [${err}]`);
|
|
100
|
-
datafeedTags.push('cache_set:false');
|
|
101
|
-
datafeedTags.push('error:true', 'reason:cache_set_failure', `error_message:${err?.message}`);
|
|
102
|
-
throw err;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
datafeedTags.push('cache_set:false');
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return data;
|
|
29
|
+
const res = await request(renderedUrl, {
|
|
30
|
+
headers: headers ?? undefined,
|
|
31
|
+
timeout: 10000,
|
|
32
|
+
method: method,
|
|
33
|
+
body: renderedBody,
|
|
34
|
+
skipResponseCloning: true
|
|
35
|
+
});
|
|
36
|
+
return res.data;
|
|
110
37
|
}
|
|
111
38
|
catch (error) {
|
|
112
|
-
const isErrorCapturedInTags = datafeedTags.find((str) => str.includes('error:true'));
|
|
113
|
-
if (!isErrorCapturedInTags) {
|
|
114
|
-
datafeedTags.push('error:true', `error_message:${error?.message}`, 'reason:unknown');
|
|
115
|
-
}
|
|
116
|
-
tags.push('reason:datafeed_failure');
|
|
117
39
|
logger?.error(`TE Messaging: Email api lookup failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
40
|
+
tags.push('reason:apilookup_failure');
|
|
41
|
+
statsClient?.incr('actions-personas-messaging-sendgrid-error', 1, tags);
|
|
118
42
|
throw error;
|
|
119
43
|
}
|
|
120
|
-
finally {
|
|
121
|
-
statsClient?.incr('datafeed-execution', 1, datafeedTags);
|
|
122
|
-
}
|
|
123
44
|
};
|
|
124
45
|
exports.performApiLookup = performApiLookup;
|
|
125
46
|
exports.apiLookupActionFields = {
|
|
@@ -170,5 +91,4 @@ exports.apiLookupActionFields = {
|
|
|
170
91
|
}
|
|
171
92
|
};
|
|
172
93
|
exports.apiLookupLiquidKey = 'lookups';
|
|
173
|
-
exports.FLAGON_NAME_DATA_FEEDS = 'is-datafeeds-enabled';
|
|
174
94
|
//# sourceMappingURL=api-lookups.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-lookups.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/api-lookups.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"api-lookups.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/api-lookups.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AAKxD,uCAA6C;AAG7C,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AActB,MAAM,gBAAgB,GAAG,KAAK,EACnC,OAAsB,EACtB,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAmB,EACnD,OAAgB,EAChB,WAAoC,EACpC,IAAc,EACd,QAAkB,EAClB,MAA2B,EAC3B,EAAE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;QACd,QAAQ,EAAE,IAAI;KACf;CACF,CAAA;AAEY,QAAA,kBAAkB,GAAG,SAAS,CAAA"}
|
|
@@ -1,13 +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
3
|
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
6
4
|
} & {
|
|
7
5
|
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
8
6
|
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
9
7
|
onCatch?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
10
8
|
} & import("./operationTracking").OperationLoggerDecoratorArgs & {
|
|
9
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
10
|
+
} & {
|
|
11
11
|
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
12
12
|
}) | undefined) => import("./operationTracking").GenericMethodDecorator<(this: any, ...args: any[]) => any>) & {
|
|
13
13
|
getCurrentOperation(classInstance: any): (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
@@ -16,14 +16,6 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
16
16
|
}) | undefined;
|
|
17
17
|
} & {
|
|
18
18
|
_contextType: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
19
|
-
tags: string[];
|
|
20
|
-
sharedContext: {
|
|
21
|
-
tags: string[];
|
|
22
|
-
};
|
|
23
|
-
decoratorArgs?: {
|
|
24
|
-
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
25
|
-
} | undefined;
|
|
26
|
-
} & {
|
|
27
19
|
decoratorArgs?: {
|
|
28
20
|
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
29
21
|
} | undefined;
|
|
@@ -46,6 +38,14 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
46
38
|
logMetadata?: Record<string, unknown> | undefined;
|
|
47
39
|
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
48
40
|
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
41
|
+
} & {
|
|
42
|
+
tags: string[];
|
|
43
|
+
sharedContext: {
|
|
44
|
+
tags: string[];
|
|
45
|
+
};
|
|
46
|
+
decoratorArgs?: {
|
|
47
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
48
|
+
} | undefined;
|
|
49
49
|
} & {
|
|
50
50
|
decoratorArgs?: {
|
|
51
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,20 @@
|
|
|
1
|
+
export interface Settings {
|
|
2
|
+
segmentWriteKey?: string;
|
|
3
|
+
segmentWriteKeyRegion?: string;
|
|
4
|
+
username: string;
|
|
5
|
+
userPassword: string;
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
profileListName: string;
|
|
8
|
+
profileExtensionTable?: string;
|
|
9
|
+
insertOnNoMatch: boolean;
|
|
10
|
+
matchColumnName1: string;
|
|
11
|
+
matchColumnName2?: string;
|
|
12
|
+
updateOnMatch: string;
|
|
13
|
+
textValue?: string;
|
|
14
|
+
matchOperator?: string;
|
|
15
|
+
optoutValue?: string;
|
|
16
|
+
rejectRecordIfChannelEmpty?: string;
|
|
17
|
+
defaultPermissionStatus: string;
|
|
18
|
+
htmlValue?: string;
|
|
19
|
+
optinValue?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/responsys-cloud/generated-types.ts"],"names":[],"mappings":""}
|