@segment/action-destinations 3.259.0-staging-dc504ee52 → 3.259.0-staging-4802f81d3
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 +1 -1
- package/dist/destinations/amazon-ads/index.js +10 -7
- package/dist/destinations/amazon-ads/index.js.map +1 -1
- package/dist/destinations/amazon-ads/syncAudiences/index.js +6 -4
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -1
- package/dist/destinations/engage/sendgrid/Profile.d.ts +6 -0
- package/dist/destinations/{responsys-cloud/types.js → engage/sendgrid/Profile.js} +1 -1
- package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +18 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +94 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.js +17 -2
- 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 +15 -12
- 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/dist/destinations/mixpanel/utils.d.ts +13 -0
- package/dist/destinations/mixpanel/utils.js +117 -0
- package/dist/destinations/mixpanel/utils.js.map +1 -0
- package/package.json +1 -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.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.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.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/{responsys-cloud → liveramp-audiences/audienceEntered}/generated-types.js +0 -0
- /package/dist/destinations/{responsys-cloud/sendAudience → liveramp-audiences/audienceEntered}/index.d.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export interface Settings {
|
|
2
2
|
region: string;
|
|
3
|
-
advertiserId: string;
|
|
4
3
|
}
|
|
5
4
|
export interface AudienceSettings {
|
|
6
5
|
description: string;
|
|
@@ -9,4 +8,5 @@ export interface AudienceSettings {
|
|
|
9
8
|
cpmCents?: number;
|
|
10
9
|
currency?: string;
|
|
11
10
|
ttl?: number;
|
|
11
|
+
advertiserId: string;
|
|
12
12
|
}
|
|
@@ -24,12 +24,6 @@ const destination = {
|
|
|
24
24
|
default: 'https://advertising-api.amazon.com',
|
|
25
25
|
type: 'string',
|
|
26
26
|
required: true
|
|
27
|
-
},
|
|
28
|
-
advertiserId: {
|
|
29
|
-
label: 'Advertiser ID',
|
|
30
|
-
description: 'Advertiser Id',
|
|
31
|
-
type: 'string',
|
|
32
|
-
required: true
|
|
33
27
|
}
|
|
34
28
|
},
|
|
35
29
|
testAuthentication: async (request, { auth }) => {
|
|
@@ -117,6 +111,12 @@ const destination = {
|
|
|
117
111
|
label: 'Time-to-live',
|
|
118
112
|
required: false,
|
|
119
113
|
description: 'Time-to-live in seconds. The amount of time the record is associated with the audience.'
|
|
114
|
+
},
|
|
115
|
+
advertiserId: {
|
|
116
|
+
label: 'Advertiser ID',
|
|
117
|
+
description: 'Advertiser Id',
|
|
118
|
+
type: 'string',
|
|
119
|
+
required: true
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
audienceConfig: {
|
|
@@ -128,13 +128,16 @@ const destination = {
|
|
|
128
128
|
const { audienceName, statsContext } = createAudienceInput;
|
|
129
129
|
const endpoint = createAudienceInput.settings.region;
|
|
130
130
|
const description = createAudienceInput.audienceSettings?.description;
|
|
131
|
-
const advertiser_id = createAudienceInput.
|
|
131
|
+
const advertiser_id = createAudienceInput.audienceSettings?.advertiserId;
|
|
132
132
|
const external_audience_id = createAudienceInput.audienceSettings?.externalAudienceId;
|
|
133
133
|
const country_code = createAudienceInput.audienceSettings?.countryCode;
|
|
134
134
|
const ttl = createAudienceInput.audienceSettings?.ttl;
|
|
135
135
|
const currency = createAudienceInput.audienceSettings?.currency;
|
|
136
136
|
const cpm_cents = createAudienceInput.audienceSettings?.cpmCents;
|
|
137
137
|
const { statsClient, tags: statsTags } = statsContext || {};
|
|
138
|
+
if (!advertiser_id) {
|
|
139
|
+
throw new actions_core_1.IntegrationError('Missing advertiserId value', 'MISSING_REQUIRED_FIELD', 400);
|
|
140
|
+
}
|
|
138
141
|
if (!description) {
|
|
139
142
|
throw new actions_core_1.IntegrationError('Missing Description value', 'MISSING_REQUIRED_FIELD', 400);
|
|
140
143
|
}
|
|
@@ -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,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ACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -120,10 +120,12 @@ async function processPayload(request, settings, payload) {
|
|
|
120
120
|
throw new actions_core_1.PayloadValidationError('Audience ID is required.');
|
|
121
121
|
}
|
|
122
122
|
try {
|
|
123
|
-
for (const
|
|
124
|
-
for (const
|
|
125
|
-
for (const key in
|
|
126
|
-
|
|
123
|
+
for (const record of payload.records) {
|
|
124
|
+
for (const pii of record.hashedPII) {
|
|
125
|
+
for (const key in pii) {
|
|
126
|
+
if (pii[key] !== undefined) {
|
|
127
|
+
pii[key] = await normalizeAndHash(pii[key]);
|
|
128
|
+
}
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
}
|
|
@@ -1 +1 @@
|
|
|
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;wB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,gIAAgI;SACnI;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,OAAO,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;CACF,CAAA;AAED,KAAK,UAAU,cAAc,CAAC,OAAsB,EAAE,QAAkB,EAAE,OAAgB;IACxF,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;QACvB,MAAM,IAAI,qCAAsB,CAAC,0BAA0B,CAAC,CAAA;KAC7D;IAED,IAAI;QACF,KAAK,MAAM,
|
|
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,EAA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IAAI,EAAE,CAAC,CAAA;YAC3D,MAAM,IAAI,uBAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;SAChD;aAAM,IAAI,CAAC,YAAY,+BAAgB,EAAE;YACxC,MAAM,IAAI,uBAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;SACnC;aAAM;YACL,MAAM,CAAC,CAAA;SACR;KACF;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,IAAY;IAE1C,MAAM,cAAc,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../../../../src/destinations/engage/sendgrid/Profile.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InputField } from '@segment/actions-core';
|
|
2
|
+
import { RequestClient } from '@segment/actions-core';
|
|
3
|
+
import { Logger, StatsClient } from '@segment/actions-core/destination-kit';
|
|
4
|
+
import type { Settings } from '../generated-types';
|
|
5
|
+
import { Profile } from '../Profile';
|
|
6
|
+
export declare type ApiLookupConfig = {
|
|
7
|
+
id?: string | undefined;
|
|
8
|
+
name: string;
|
|
9
|
+
url: string;
|
|
10
|
+
method: string;
|
|
11
|
+
cacheTtl: number;
|
|
12
|
+
body?: string | undefined;
|
|
13
|
+
headers?: object | undefined;
|
|
14
|
+
responseType: string;
|
|
15
|
+
};
|
|
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>;
|
|
17
|
+
export declare const apiLookupActionFields: Record<string, InputField>;
|
|
18
|
+
export declare const apiLookupLiquidKey = "lookups";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.apiLookupLiquidKey = exports.apiLookupActionFields = exports.performApiLookup = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const liquidjs_1 = require("liquidjs");
|
|
6
|
+
const Liquid = new liquidjs_1.Liquid();
|
|
7
|
+
const performApiLookup = async (request, { id, url, method, body, headers }, profile, statsClient, tags, settings, logger) => {
|
|
8
|
+
let renderedUrl;
|
|
9
|
+
let renderedBody;
|
|
10
|
+
try {
|
|
11
|
+
renderedUrl = await Liquid.parseAndRender(url, { profile });
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
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);
|
|
17
|
+
throw new actions_core_1.IntegrationError('Unable to parse email api lookup url', 'api lookup url parse failure', 400);
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
renderedBody = body ? await Liquid.parseAndRender(body, { profile }) : undefined;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
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
|
+
throw new actions_core_1.IntegrationError('Unable to parse email api lookup body', 'api lookup body parse failure', 400);
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
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;
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
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);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.performApiLookup = performApiLookup;
|
|
46
|
+
exports.apiLookupActionFields = {
|
|
47
|
+
id: {
|
|
48
|
+
label: 'ID',
|
|
49
|
+
description: 'The id of the API lookup for use in logging & observability',
|
|
50
|
+
type: 'string'
|
|
51
|
+
},
|
|
52
|
+
name: {
|
|
53
|
+
label: 'Name',
|
|
54
|
+
description: 'The name of the API lookup referenced in liquid syntax',
|
|
55
|
+
type: 'string',
|
|
56
|
+
required: true
|
|
57
|
+
},
|
|
58
|
+
url: {
|
|
59
|
+
label: 'URL',
|
|
60
|
+
description: 'The URL endpoint to call',
|
|
61
|
+
type: 'string',
|
|
62
|
+
required: true
|
|
63
|
+
},
|
|
64
|
+
method: {
|
|
65
|
+
label: 'Request Method',
|
|
66
|
+
description: 'The request method, e.g. GET/POST/etc.',
|
|
67
|
+
type: 'string',
|
|
68
|
+
required: true
|
|
69
|
+
},
|
|
70
|
+
cacheTtl: {
|
|
71
|
+
label: 'Cache TTL',
|
|
72
|
+
description: 'The cache TTL in ms',
|
|
73
|
+
type: 'integer',
|
|
74
|
+
required: true
|
|
75
|
+
},
|
|
76
|
+
body: {
|
|
77
|
+
label: 'Request Body',
|
|
78
|
+
description: 'The request body for use with POST/PUT/PATCH requests',
|
|
79
|
+
type: 'string'
|
|
80
|
+
},
|
|
81
|
+
headers: {
|
|
82
|
+
label: 'Request Headers',
|
|
83
|
+
description: 'Headers in JSON to be sent with the request',
|
|
84
|
+
type: 'object'
|
|
85
|
+
},
|
|
86
|
+
responseType: {
|
|
87
|
+
label: 'Response Type',
|
|
88
|
+
description: 'The response type of the request. Currently only supporting JSON.',
|
|
89
|
+
type: 'string',
|
|
90
|
+
required: true
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.apiLookupLiquidKey = 'lookups';
|
|
94
|
+
//# sourceMappingURL=api-lookups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;IACF,IAAI,WAAmB,CAAA;IACvB,IAAI,YAAgC,CAAA;IACpC,IAAI;QACF,WAAW,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;KAC5D;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,EAAE,KAAK,CACX,qEAAqE,EAAE,MAAM,QAAQ,CAAC,OAAO,OAAO,KAAK,GAAG,CAC7G,CAAA;QACD,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA;QACvC,WAAW,EAAE,IAAI,CAAC,2CAA2C,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;QACvE,MAAM,IAAI,+BAAgB,CAAC,sCAAsC,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;KACxG;IACD,IAAI;QACF,YAAY,G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AAE,wDAAwD;QACrE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,GAAG,EAAE;QACH,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,MAAM,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,wCAAwC;QACrD,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,uDAAuD;QACpE,IAAI,EAAE,QAAQ;KACf;IACD,OAAO,EAAE;QACP,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE,QAAQ;KACf;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,mEAAmE;QAChF,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;CACF,CAAA;AAEY,QAAA,kBAAkB,GAAG,SAAS,CAAA"}
|
|
@@ -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;
|
|
@@ -49,7 +50,6 @@ class EngageActionPerformer {
|
|
|
49
50
|
const errorCode = errorDetails.code ?? respError.code ?? 'etimedout';
|
|
50
51
|
respError.code = errorCode;
|
|
51
52
|
errorDetails.code = errorCode;
|
|
52
|
-
respError.retry = true;
|
|
53
53
|
}
|
|
54
54
|
if (errorDetails.code)
|
|
55
55
|
op.tags.push(`response_code:${errorDetails.code}`);
|
|
@@ -76,6 +76,20 @@ class EngageActionPerformer {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
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 onCatch');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
79
93
|
return await this.requestClient(url, options);
|
|
80
94
|
}
|
|
81
95
|
redactPii(pii) {
|
|
@@ -134,7 +148,8 @@ __decorate([
|
|
|
134
148
|
__decorate([
|
|
135
149
|
track_1.track({
|
|
136
150
|
onTry: addUrlToLog,
|
|
137
|
-
onFinally: addUrlToLog
|
|
151
|
+
onFinally: addUrlToLog,
|
|
152
|
+
onCatch: addUrlToLog
|
|
138
153
|
})
|
|
139
154
|
], EngageActionPerformer.prototype, "request", null);
|
|
140
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;A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apTryCatchFinallyPromisable';
|
|
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,10 +1,11 @@
|
|
|
1
1
|
import { ContextFromDecorator } from './operationTracking';
|
|
2
2
|
export declare const track: ((decoratorArgs?: ({
|
|
3
|
-
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
4
|
-
} & {
|
|
5
3
|
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
6
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;
|
|
7
6
|
} & import("./operationTracking").OperationLoggerDecoratorArgs & {
|
|
7
|
+
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
8
|
+
} & {
|
|
8
9
|
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
9
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;
|
|
@@ -15,26 +16,28 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
15
16
|
}) | undefined;
|
|
16
17
|
} & {
|
|
17
18
|
_contextType: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
18
|
-
decoratorArgs?: {
|
|
19
|
-
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
20
|
-
} | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
parent?: (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
|
|
23
|
-
sharedContext: {};
|
|
24
|
-
} & {
|
|
25
|
-
start?: number | undefined;
|
|
26
|
-
duration?: number | undefined;
|
|
27
|
-
} & {
|
|
28
19
|
onFinally: (() => void)[];
|
|
20
|
+
onCatch: (() => void)[];
|
|
29
21
|
decoratorArgs?: {
|
|
30
22
|
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
31
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;
|
|
32
25
|
} | undefined;
|
|
33
26
|
} & {
|
|
34
27
|
logs: string[];
|
|
35
28
|
logMetadata?: Record<string, unknown> | undefined;
|
|
36
29
|
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
37
30
|
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
31
|
+
} & {
|
|
32
|
+
decoratorArgs?: {
|
|
33
|
+
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
} & {
|
|
36
|
+
parent?: (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
|
|
37
|
+
sharedContext: {};
|
|
38
|
+
} & {
|
|
39
|
+
start?: number | undefined;
|
|
40
|
+
duration?: number | undefined;
|
|
38
41
|
} & {
|
|
39
42
|
tags: string[];
|
|
40
43
|
sharedContext: {
|
|
@@ -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":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const s3_1 = require("./s3");
|
|
5
|
+
const sftp_1 = require("./sftp");
|
|
6
|
+
const operations_1 = require("../operations");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Audience Entered',
|
|
9
|
+
description: 'Uploads audience membership data to a file for LiveRamp ingestion.',
|
|
10
|
+
defaultSubscription: 'event = "Audience Entered"',
|
|
11
|
+
fields: {
|
|
12
|
+
audience_key: {
|
|
13
|
+
label: 'Audience Key',
|
|
14
|
+
description: 'Identifies the user within the entered audience.',
|
|
15
|
+
type: 'string',
|
|
16
|
+
required: true,
|
|
17
|
+
default: { '@path': '$.userId' }
|
|
18
|
+
},
|
|
19
|
+
identifier_data: {
|
|
20
|
+
label: 'Identifier Data',
|
|
21
|
+
description: `Additional data pertaining to the user to be written to the file.`,
|
|
22
|
+
type: 'object',
|
|
23
|
+
required: false,
|
|
24
|
+
defaultObjectUI: 'keyvalue:only'
|
|
25
|
+
},
|
|
26
|
+
unhashed_identifier_data: {
|
|
27
|
+
label: 'Hashable Identifier Data',
|
|
28
|
+
description: `Additional data pertaining to the user to be hashed before written to the file`,
|
|
29
|
+
type: 'object',
|
|
30
|
+
required: false,
|
|
31
|
+
defaultObjectUI: 'keyvalue:only'
|
|
32
|
+
},
|
|
33
|
+
delimiter: {
|
|
34
|
+
label: 'Delimeter',
|
|
35
|
+
description: `Character used to separate tokens in the resulting file.`,
|
|
36
|
+
type: 'string',
|
|
37
|
+
required: true,
|
|
38
|
+
default: ','
|
|
39
|
+
},
|
|
40
|
+
filename: {
|
|
41
|
+
label: 'Filename',
|
|
42
|
+
description: `Name of the CSV file to upload for LiveRamp ingestion.`,
|
|
43
|
+
type: 'string',
|
|
44
|
+
required: true,
|
|
45
|
+
default: { '@template': '{{properties.audience_key}}_PII_{{timestamp}}.csv' }
|
|
46
|
+
},
|
|
47
|
+
enable_batching: {
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
label: 'Batch data',
|
|
50
|
+
description: 'Receive events in a batch payload. This is required for LiveRamp audiences ingestion.',
|
|
51
|
+
required: true,
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
54
|
+
batch_size: {
|
|
55
|
+
label: 'Batch Size',
|
|
56
|
+
description: 'Maximum number of events to include in each batch. Actual batch sizes may be lower.',
|
|
57
|
+
type: 'number',
|
|
58
|
+
required: false,
|
|
59
|
+
default: 1000000
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
perform: async (request, { settings, payload }) => {
|
|
63
|
+
return processData(request, settings, [payload]);
|
|
64
|
+
},
|
|
65
|
+
performBatch: (request, { settings, payload }) => {
|
|
66
|
+
return processData(request, settings, payload);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
async function processData(request, settings, payloads) {
|
|
70
|
+
const LIVERAMP_MIN_RECORD_COUNT = 25;
|
|
71
|
+
if (payloads.length < LIVERAMP_MIN_RECORD_COUNT) {
|
|
72
|
+
throw new actions_core_1.PayloadValidationError(`received payload count below LiveRamp's ingestion limits. expected: >=${LIVERAMP_MIN_RECORD_COUNT} actual: ${payloads.length}`);
|
|
73
|
+
}
|
|
74
|
+
switch (settings.upload_mode) {
|
|
75
|
+
case 'S3':
|
|
76
|
+
s3_1.validateS3(settings);
|
|
77
|
+
break;
|
|
78
|
+
case 'SFTP':
|
|
79
|
+
sftp_1.validateSFTP(settings);
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
throw new actions_core_1.InvalidAuthenticationError(`Unexpected upload mode: ${settings.upload_mode}`);
|
|
83
|
+
}
|
|
84
|
+
const { filename, fileContent } = operations_1.generateFile(payloads);
|
|
85
|
+
switch (settings.upload_mode) {
|
|
86
|
+
case 'S3':
|
|
87
|
+
return s3_1.uploadS3(settings, filename, fileContent, request);
|
|
88
|
+
case 'SFTP': {
|
|
89
|
+
const sftpClient = new sftp_1.Client();
|
|
90
|
+
return sftp_1.uploadSFTP(sftpClient, settings, filename, fileContent);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.default = action;
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEntered/index.ts"],"names":[],"mappings":";;AAAA,wDAK8B;AAG9B,6BAA2C;AAC3C,iCAAuE;AACvE,8CAA4C;AAE5C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,oEAAoE;IACjF,m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+
import { ModifiedResponse, RequestOptions } from '@segment/actions-core';
|
|
3
|
+
import { Settings } from '../generated-types';
|
|
4
|
+
declare function validateS3(settings: Settings): void;
|
|
5
|
+
declare function uploadS3(settings: Settings, filename: string, fileContent: Buffer, request: <Data = unknown>(url: string, options?: RequestOptions) => Promise<ModifiedResponse<Data>>): Promise<ModifiedResponse<unknown>>;
|
|
6
|
+
export { validateS3, uploadS3 };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.uploadS3 = exports.validateS3 = void 0;
|
|
7
|
+
const s3_1 = __importDefault(require("../../../lib/AWS/s3"));
|
|
8
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
9
|
+
function validateS3(settings) {
|
|
10
|
+
if (!settings.s3_aws_access_key) {
|
|
11
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS Access Key');
|
|
12
|
+
}
|
|
13
|
+
if (!settings.s3_aws_secret_key) {
|
|
14
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS Secret Key');
|
|
15
|
+
}
|
|
16
|
+
if (!settings.s3_aws_bucket_name) {
|
|
17
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS S3 bucket name');
|
|
18
|
+
}
|
|
19
|
+
if (!settings.s3_aws_region) {
|
|
20
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS Region');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.validateS3 = validateS3;
|
|
24
|
+
async function uploadS3(settings, filename, fileContent, request) {
|
|
25
|
+
const method = 'PUT';
|
|
26
|
+
const opts = await s3_1.default(settings.s3_aws_bucket_name, settings.s3_aws_region, filename, method, fileContent, settings.s3_aws_access_key, settings.s3_aws_secret_key);
|
|
27
|
+
if (!opts.headers || !opts.method || !opts.host || !opts.path) {
|
|
28
|
+
throw new actions_core_1.InvalidAuthenticationError('Unable to generate signature header for AWS S3 request.');
|
|
29
|
+
}
|
|
30
|
+
return await request(`https://${opts.host}/${opts.path}`, {
|
|
31
|
+
headers: opts.headers,
|
|
32
|
+
method,
|
|
33
|
+
body: opts.body
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.uploadS3 = uploadS3;
|
|
37
|
+
//# sourceMappingURL=s3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEntered/s3.ts"],"names":[],"mappings":";;;;;;AAAA,6DAA0D;AAC1D,wDAAoG;AAGpG,SAAS,UAAU,CAAC,QAAkB;IACpC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE;QAC/B,MAAM,IAAI,yCAA0B,CAAC,qDAAqD,CAAC,CAAA;KAC5F;IAED,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE;QAC/B,MAAM,IAAI,yCAA0B,CAAC,qDAAqD,CAAC,CAAA;KAC5F;IAED,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;QAChC,MAAM,IAAI,yCAA0B,CAAC,yDAAyD,CAAC,CAAA;KAChG;IAED,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QAC3B,MAAM,IAAI,yCAA0B,CAAC,iDAAiD,CAAC,CAAA;KACxF;AACH,CAAC;AA6BQ,gCAAU;AA3BnB,KAAK,UAAU,QAAQ,CACrB,QAAkB,EAClB,QAAgB,EAChB,WAAmB,EACnB,OAAmG;IAEnG,MAAM,MAAM,GAAG,KAAK,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,YAAwB,CACzC,QAAQ,CAAC,kBAA4B,EACrC,QAAQ,CAAC,aAAuB,EAChC,QAAQ,EACR,MAAM,EACN,WAAW,EACX,QAAQ,CAAC,iBAA2B,EACpC,QAAQ,CAAC,iBAA2B,CACrC,CAAA;IACD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QAC7D,MAAM,IAAI,yCAA0B,CAAC,yDAAyD,CAAC,CAAA;KAChG;IAED,OAAO,MAAM,OAAO,CAAC,WAAW,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE;QACxD,OAAO,EAAE,IAAI,CAAC,OAAiC;QAC/C,MAAM;QACN,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC,CAAA;AACJ,CAAC;AAEoB,4BAAQ"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import Client from 'ssh2-sftp-client';
|
|
3
|
+
import { Settings } from '../generated-types';
|
|
4
|
+
declare function validateSFTP(settings: Settings): void;
|
|
5
|
+
declare function uploadSFTP(sftp: Client, settings: Settings, filename: string, fileContent: Buffer): Promise<unknown>;
|
|
6
|
+
declare function testAuthenticationSFTP(sftp: Client, settings: Settings): Promise<unknown>;
|
|
7
|
+
export { validateSFTP, uploadSFTP, testAuthenticationSFTP, Client };
|