@segment/action-destinations 3.233.0-streams.1 → 3.234.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/algolia-insights/algolia-insight-api.d.ts +2 -4
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.d.ts +2 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.js +21 -2
- package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productAddedEvents/generated-types.d.ts +2 -0
- package/dist/destinations/algolia-insights/productAddedEvents/index.js +21 -2
- package/dist/destinations/algolia-insights/productAddedEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.d.ts +2 -0
- package/dist/destinations/algolia-insights/productClickedEvents/index.js +21 -2
- package/dist/destinations/algolia-insights/productClickedEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productListFilteredEvents/generated-types.d.ts +2 -0
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.js +21 -2
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.d.ts +2 -0
- package/dist/destinations/algolia-insights/productViewedEvents/index.js +21 -2
- package/dist/destinations/algolia-insights/productViewedEvents/index.js.map +1 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js +3 -3
- package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js.map +1 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.d.ts +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.js +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.js.map +1 -1
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.d.ts +3 -2
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +36 -6
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js +2 -2
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js.map +1 -1
- package/dist/destinations/engage/utils/Profile.js.map +1 -0
- package/dist/destinations/engage/{sendgrid/previewApiLookup/api-lookups.d.ts → utils/apiLookups.d.ts} +4 -3
- package/dist/destinations/engage/{sendgrid/previewApiLookup/api-lookups.js → utils/apiLookups.js} +52 -37
- package/dist/destinations/engage/utils/apiLookups.js.map +1 -0
- package/dist/destinations/engage/utils/track.d.ts +9 -9
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js +4 -24
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.d.ts +0 -9
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.js +1 -22
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/index.js +1 -20
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/operations.d.ts +1 -20
- package/dist/destinations/liveramp-audiences/operations.js +1 -67
- package/dist/destinations/liveramp-audiences/operations.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateDeal/generated-types.d.ts +1 -1
- package/dist/destinations/pipedrive/createUpdateDeal/index.js +6 -4
- package/dist/destinations/pipedrive/createUpdateDeal/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateLead/generated-types.d.ts +1 -2
- package/dist/destinations/pipedrive/createUpdateLead/index.js +7 -12
- package/dist/destinations/pipedrive/createUpdateLead/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateOrganization/generated-types.d.ts +1 -1
- package/dist/destinations/pipedrive/createUpdateOrganization/index.js +6 -4
- package/dist/destinations/pipedrive/createUpdateOrganization/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdatePerson/generated-types.d.ts +1 -1
- package/dist/destinations/pipedrive/createUpdatePerson/index.js +6 -4
- package/dist/destinations/pipedrive/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/deals.d.ts +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/leads.d.ts +1 -2
- package/dist/destinations/pipedrive/pipedriveApi/leads.js.map +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/organizations.d.ts +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/persons.d.ts +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js +4 -1
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js.map +1 -1
- package/dist/destinations/tiktok-audiences/functions.js +6 -1
- package/dist/destinations/tiktok-audiences/functions.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +0 -184
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +0 -1
- package/dist/destinations/engage/sendgrid/Profile.js.map +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -4
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +0 -3
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +0 -5
- package/dist/destinations/klaviyo/removeProfileToList/index.js +0 -43
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +0 -1
- package/dist/destinations/mixpanel/utils.d.ts +0 -13
- package/dist/destinations/mixpanel/utils.js +0 -117
- package/dist/destinations/mixpanel/utils.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/categoryView/generated-types.js +0 -3
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/index.d.ts +0 -5
- package/dist/destinations/movable-ink/categoryView/index.js +0 -43
- package/dist/destinations/movable-ink/categoryView/index.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +0 -20
- package/dist/destinations/movable-ink/conversion/generated-types.js +0 -3
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/index.d.ts +0 -5
- package/dist/destinations/movable-ink/conversion/index.js +0 -45
- package/dist/destinations/movable-ink/conversion/index.js.map +0 -1
- package/dist/destinations/movable-ink/fields.d.ts +0 -21
- package/dist/destinations/movable-ink/fields.js +0 -236
- package/dist/destinations/movable-ink/fields.js.map +0 -1
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +0 -7
- package/dist/destinations/movable-ink/identify/generated-types.js +0 -3
- package/dist/destinations/movable-ink/identify/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/identify/index.d.ts +0 -5
- package/dist/destinations/movable-ink/identify/index.js +0 -32
- package/dist/destinations/movable-ink/identify/index.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/productAdded/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productAdded/index.js +0 -43
- package/dist/destinations/movable-ink/productAdded/index.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +0 -21
- package/dist/destinations/movable-ink/productViewed/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productViewed/index.js +0 -43
- package/dist/destinations/movable-ink/productViewed/index.js.map +0 -1
- package/dist/destinations/movable-ink/search/generated-types.d.ts +0 -12
- package/dist/destinations/movable-ink/search/generated-types.js +0 -3
- package/dist/destinations/movable-ink/search/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/search/index.d.ts +0 -5
- package/dist/destinations/movable-ink/search/index.js +0 -43
- package/dist/destinations/movable-ink/search/index.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +0 -25
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +0 -3
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +0 -5
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +0 -48
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +0 -1
- package/dist/destinations/trackey/group.types.d.ts +0 -11
- package/dist/destinations/trackey/group.types.js +0 -3
- package/dist/destinations/trackey/group.types.js.map +0 -1
- package/dist/destinations/trackey/identify.types.d.ts +0 -11
- package/dist/destinations/trackey/identify.types.js +0 -3
- package/dist/destinations/trackey/identify.types.js.map +0 -1
- package/dist/destinations/trackey/track.types.d.ts +0 -12
- package/dist/destinations/trackey/track.types.js +0 -3
- package/dist/destinations/trackey/track.types.js.map +0 -1
- /package/dist/destinations/engage/{sendgrid → utils}/Profile.d.ts +0 -0
- /package/dist/destinations/engage/{sendgrid → utils}/Profile.js +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputField } from '@segment/actions-core';
|
|
2
2
|
import { RequestClient } from '@segment/actions-core';
|
|
3
3
|
import { Logger, StatsClient, DataFeedCache } from '@segment/actions-core/destination-kit';
|
|
4
|
-
import type { Settings } from '../generated-types';
|
|
5
|
-
import { Profile } from '
|
|
4
|
+
import type { Settings } from '../sendgrid/generated-types';
|
|
5
|
+
import { Profile } from './Profile';
|
|
6
6
|
export declare type ApiLookupConfig = {
|
|
7
7
|
id?: string | undefined;
|
|
8
8
|
name: string;
|
|
@@ -12,10 +12,11 @@ export declare type ApiLookupConfig = {
|
|
|
12
12
|
body?: string | undefined;
|
|
13
13
|
headers?: object | undefined;
|
|
14
14
|
responseType: string;
|
|
15
|
+
shouldRetryOnRetryableError?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export declare const getRequestId: ({ method, url, body, headers }: ApiLookupConfig) => string;
|
|
17
18
|
export declare const getCachedResponse: ({ responseType }: ApiLookupConfig, requestId: string, dataFeedCache: DataFeedCache, datafeedTags: string[]) => Promise<any>;
|
|
18
19
|
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>;
|
|
19
20
|
export declare const apiLookupActionFields: Record<string, InputField>;
|
|
20
|
-
export declare const apiLookupLiquidKey = "
|
|
21
|
+
export declare const apiLookupLiquidKey = "datafeeds";
|
|
21
22
|
export declare const FLAGON_NAME_DATA_FEEDS = "is-datafeeds-enabled";
|
package/dist/destinations/engage/{sendgrid/previewApiLookup/api-lookups.js → utils/apiLookups.js}
RENAMED
|
@@ -5,25 +5,24 @@ const crypto_1 = require("crypto");
|
|
|
5
5
|
const actions_core_1 = require("@segment/actions-core");
|
|
6
6
|
const liquidjs_1 = require("liquidjs");
|
|
7
7
|
const Liquid = new liquidjs_1.Liquid();
|
|
8
|
-
const
|
|
9
|
-
const renderLiquidFields = async ({ id, url, body }, profile, datafeedTags, settings, logger) => {
|
|
8
|
+
const renderLiquidFields = async ({ url, body }, profile, datafeedTags, logDataFeedError) => {
|
|
10
9
|
let renderedUrl;
|
|
11
10
|
let renderedBody;
|
|
12
11
|
try {
|
|
13
12
|
renderedUrl = await Liquid.parseAndRender(url, { profile });
|
|
14
13
|
}
|
|
15
14
|
catch (error) {
|
|
16
|
-
|
|
17
|
-
datafeedTags.push('error:true',
|
|
18
|
-
throw new actions_core_1.IntegrationError('Unable to parse
|
|
15
|
+
logDataFeedError('URL liquid render failuere', error);
|
|
16
|
+
datafeedTags.push('error:true', 'reason:rendering_failure', 'rendering:url');
|
|
17
|
+
throw new actions_core_1.IntegrationError('Unable to parse data feed url', 'DATA_FEED_RENDERING_ERROR', 400);
|
|
19
18
|
}
|
|
20
19
|
try {
|
|
21
20
|
renderedBody = body ? await Liquid.parseAndRender(body, { profile }) : undefined;
|
|
22
21
|
}
|
|
23
22
|
catch (error) {
|
|
24
|
-
|
|
25
|
-
datafeedTags.push('error:true',
|
|
26
|
-
throw new actions_core_1.IntegrationError('Unable to parse email api lookup body', '
|
|
23
|
+
logDataFeedError('Body liquid render failure', error);
|
|
24
|
+
datafeedTags.push('error:true', 'reason:rendering_failure', 'rendering:body');
|
|
25
|
+
throw new actions_core_1.IntegrationError('Unable to parse email api lookup body', 'DATA_FEED_RENDERING_ERROR', 400);
|
|
27
26
|
}
|
|
28
27
|
return {
|
|
29
28
|
renderedUrl,
|
|
@@ -38,7 +37,7 @@ const getRequestId = ({ method, url, body, headers }) => {
|
|
|
38
37
|
};
|
|
39
38
|
exports.getRequestId = getRequestId;
|
|
40
39
|
const getCachedResponse = async ({ responseType }, requestId, dataFeedCache, datafeedTags) => {
|
|
41
|
-
const cachedResponse = await dataFeedCache
|
|
40
|
+
const cachedResponse = await dataFeedCache.getRequestResponse(requestId);
|
|
42
41
|
if (!cachedResponse) {
|
|
43
42
|
datafeedTags.push('cache_hit:false');
|
|
44
43
|
return;
|
|
@@ -51,17 +50,26 @@ const getCachedResponse = async ({ responseType }, requestId, dataFeedCache, dat
|
|
|
51
50
|
};
|
|
52
51
|
exports.getCachedResponse = getCachedResponse;
|
|
53
52
|
const performApiLookup = async (request, apiLookupConfig, profile, statsClient, tags, settings, logger, dataFeedCache) => {
|
|
54
|
-
const { id, method, headers, cacheTtl, name } = apiLookupConfig;
|
|
53
|
+
const { id, method, headers, cacheTtl, name, shouldRetryOnRetryableError = true } = apiLookupConfig;
|
|
55
54
|
const datafeedTags = [
|
|
56
55
|
...tags,
|
|
57
56
|
`datafeed_id:${id}`,
|
|
58
57
|
`datafeed_name:${name}`,
|
|
59
58
|
`space_id:${settings.spaceId}`,
|
|
60
|
-
`cache_ttl_greater_than_0:${cacheTtl > 0}
|
|
59
|
+
`cache_ttl_greater_than_0:${cacheTtl > 0}`,
|
|
60
|
+
`retry_enabled:${shouldRetryOnRetryableError}`
|
|
61
61
|
];
|
|
62
|
+
const logDataFeedError = (message, error) => {
|
|
63
|
+
logger?.error(`TE Messaging: Data feed error - message: ${message} - data feed name: ${name} - data feed id: ${id} - space id: ${settings.spaceId} - raw error: ${error}`);
|
|
64
|
+
};
|
|
62
65
|
try {
|
|
63
|
-
const { renderedUrl, renderedBody } = await renderLiquidFields(apiLookupConfig, profile, datafeedTags,
|
|
66
|
+
const { renderedUrl, renderedBody } = await renderLiquidFields(apiLookupConfig, profile, datafeedTags, logDataFeedError);
|
|
64
67
|
const requestId = exports.getRequestId({ ...apiLookupConfig, url: renderedUrl, body: renderedBody });
|
|
68
|
+
if (cacheTtl > 0 && !dataFeedCache) {
|
|
69
|
+
logDataFeedError('Data feed cache not available and cache needed');
|
|
70
|
+
datafeedTags.push('cache_set:false');
|
|
71
|
+
throw new actions_core_1.IntegrationError('Data feed cache not available and cache needed', 'DATA_FEED_CACHE_NOT_AVAILABLE', 400);
|
|
72
|
+
}
|
|
65
73
|
if (cacheTtl > 0 && dataFeedCache) {
|
|
66
74
|
const cachedResponse = await exports.getCachedResponse(apiLookupConfig, requestId, dataFeedCache, datafeedTags);
|
|
67
75
|
if (cachedResponse) {
|
|
@@ -82,43 +90,45 @@ const performApiLookup = async (request, apiLookupConfig, profile, statsClient,
|
|
|
82
90
|
}
|
|
83
91
|
catch (error) {
|
|
84
92
|
const respError = error.response;
|
|
85
|
-
|
|
86
|
-
datafeedTags.push(`error:true`, `
|
|
87
|
-
|
|
93
|
+
logDataFeedError('Data feed call failure', error);
|
|
94
|
+
datafeedTags.push(`error:true`, `error_status:${respError?.status}`, 'reason:api_call_failure');
|
|
95
|
+
if (shouldRetryOnRetryableError) {
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
return {};
|
|
88
99
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
datafeedTags.push('cache_set:false');
|
|
101
|
-
datafeedTags.push('error:true', 'reason:cache_set_failure', `error_message:${err?.message}`);
|
|
102
|
-
throw err;
|
|
103
|
-
}
|
|
100
|
+
if (cacheTtl > 0 && dataFeedCache) {
|
|
101
|
+
const dataString = JSON.stringify(data);
|
|
102
|
+
const size = Buffer.byteLength(dataString, 'utf-8');
|
|
103
|
+
if (size > dataFeedCache.maxResponseSizeBytes) {
|
|
104
|
+
datafeedTags.push('error:true', 'reason:response_size_too_big');
|
|
105
|
+
logDataFeedError('Data feed response size too big too cache and caching needed, failing send');
|
|
106
|
+
throw new actions_core_1.IntegrationError('Data feed response size too big too cache and caching needed, failing send', 'DATA_FEED_RESPONSE_TOO_BIG', 400);
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
await dataFeedCache.setRequestResponse(requestId, dataString, cacheTtl / 1000);
|
|
110
|
+
datafeedTags.push('cache_set:true');
|
|
104
111
|
}
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
catch (error) {
|
|
113
|
+
logDataFeedError('Data feed cache set failure', error);
|
|
114
|
+
datafeedTags.push('error:true', 'reason:cache_set_failure', 'cache_set:false');
|
|
115
|
+
throw error;
|
|
107
116
|
}
|
|
108
117
|
}
|
|
118
|
+
datafeedTags.push('error:false');
|
|
109
119
|
return data;
|
|
110
120
|
}
|
|
111
121
|
catch (error) {
|
|
112
122
|
const isErrorCapturedInTags = datafeedTags.find((str) => str.includes('error:true'));
|
|
113
123
|
if (!isErrorCapturedInTags) {
|
|
114
|
-
datafeedTags.push('error:true',
|
|
124
|
+
datafeedTags.push('error:true', 'reason:unknown');
|
|
115
125
|
}
|
|
116
126
|
tags.push('reason:datafeed_failure');
|
|
117
|
-
|
|
127
|
+
logDataFeedError('Unexpected data feed error', error);
|
|
118
128
|
throw error;
|
|
119
129
|
}
|
|
120
130
|
finally {
|
|
121
|
-
statsClient?.incr('
|
|
131
|
+
statsClient?.incr('datafeed_execution', 1, datafeedTags);
|
|
122
132
|
}
|
|
123
133
|
};
|
|
124
134
|
exports.performApiLookup = performApiLookup;
|
|
@@ -167,8 +177,13 @@ exports.apiLookupActionFields = {
|
|
|
167
177
|
description: 'The response type of the request. Currently only supporting JSON.',
|
|
168
178
|
type: 'string',
|
|
169
179
|
required: true
|
|
180
|
+
},
|
|
181
|
+
shouldRetryOnRetryableError: {
|
|
182
|
+
label: 'Should Retry',
|
|
183
|
+
description: 'Whether the message should be retried (if the error code is retryable) when the data feed fails or if it should be sent with empty data instead',
|
|
184
|
+
type: 'boolean'
|
|
170
185
|
}
|
|
171
186
|
};
|
|
172
|
-
exports.apiLookupLiquidKey = '
|
|
187
|
+
exports.apiLookupLiquidKey = 'datafeeds';
|
|
173
188
|
exports.FLAGON_NAME_DATA_FEEDS = 'is-datafeeds-enabled';
|
|
174
|
-
//# sourceMappingURL=
|
|
189
|
+
//# sourceMappingURL=apiLookups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiLookups.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/apiLookups.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,wDAAwD;AAKxD,uCAA6C;AAI7C,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAkB7B,MAAM,kBAAkB,GAAG,KAAK,EAC9B,EAAE,GAAG,EAAE,IAAI,EAAyC,EACpD,OAAgB,EAChB,YAAsB,EACtB,gBAAkC,EAClC,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,gBAAgB,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@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ContextFromDecorator } from './operationTracking';
|
|
2
2
|
export declare const track: ((decoratorArgs?: ({
|
|
3
3
|
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
4
|
-
} & {
|
|
4
|
+
} & import("./operationTracking").OperationLoggerDecoratorArgs & {
|
|
5
5
|
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
6
6
|
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
7
|
-
} &
|
|
7
|
+
} & {
|
|
8
8
|
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
9
9
|
} & {
|
|
10
10
|
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
@@ -15,6 +15,9 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
15
15
|
}) | undefined;
|
|
16
16
|
} & {
|
|
17
17
|
_contextType: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
18
|
+
start?: number | undefined;
|
|
19
|
+
duration?: number | undefined;
|
|
20
|
+
} & {
|
|
18
21
|
decoratorArgs?: {
|
|
19
22
|
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
20
23
|
} | undefined;
|
|
@@ -22,19 +25,16 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
22
25
|
parent?: (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
|
|
23
26
|
sharedContext: {};
|
|
24
27
|
} & {
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
logs: string[];
|
|
29
|
+
logMetadata?: Record<string, unknown> | undefined;
|
|
30
|
+
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
31
|
+
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
27
32
|
} & {
|
|
28
33
|
onFinally: (() => void)[];
|
|
29
34
|
decoratorArgs?: {
|
|
30
35
|
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
31
36
|
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
32
37
|
} | undefined;
|
|
33
|
-
} & {
|
|
34
|
-
logs: string[];
|
|
35
|
-
logMetadata?: Record<string, unknown> | undefined;
|
|
36
|
-
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
37
|
-
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
38
38
|
} & {
|
|
39
39
|
tags: string[];
|
|
40
40
|
sharedContext: {
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
4
|
const s3_1 = require("./s3");
|
|
8
5
|
const operations_1 = require("../operations");
|
|
9
|
-
const properties_1 = require("../properties");
|
|
10
|
-
const promises_1 = require("stream/promises");
|
|
11
6
|
const awsClient_1 = require("../awsClient");
|
|
12
|
-
const
|
|
7
|
+
const properties_1 = require("../properties");
|
|
13
8
|
const action = {
|
|
14
9
|
title: 'Audience Entered (S3)',
|
|
15
10
|
description: 'Uploads audience membership data to a file in S3 for LiveRamp ingestion.',
|
|
@@ -102,27 +97,12 @@ const action = {
|
|
|
102
97
|
features,
|
|
103
98
|
rawData
|
|
104
99
|
});
|
|
105
|
-
},
|
|
106
|
-
performBatchStream: async (request, { payload }) => {
|
|
107
|
-
const transformStream = new operations_1.ObjectToCSVTransformer({});
|
|
108
|
-
const writeToS3 = new s3_1.S3WriteStream();
|
|
109
|
-
await promises_1.pipeline(payload, transformStream, writeToS3);
|
|
110
|
-
const opts = await s3_2.default(transformStream.s3.s3_aws_bucket_name, transformStream.s3.s3_aws_region, transformStream.s3.file_name, 'PUT', writeToS3.buffer, transformStream.s3.s3_aws_access_key, transformStream.s3.s3_aws_secret_key);
|
|
111
|
-
if (!opts.headers || !opts.method || !opts.host || !opts.path) {
|
|
112
|
-
throw new actions_core_1.InvalidAuthenticationError('Unable to generate signature header for AWS S3 request.');
|
|
113
|
-
}
|
|
114
|
-
console.time('s3');
|
|
115
|
-
const res = await request(`https://${opts.host}/${opts.path}`, {
|
|
116
|
-
headers: opts.headers,
|
|
117
|
-
method: 'PUT',
|
|
118
|
-
timeout: 120000,
|
|
119
|
-
body: opts.body
|
|
120
|
-
});
|
|
121
|
-
console.timeEnd('s3');
|
|
122
|
-
return res;
|
|
123
100
|
}
|
|
124
101
|
};
|
|
125
102
|
async function processData(input) {
|
|
103
|
+
if (input.payloads.length < properties_1.LIVERAMP_MIN_RECORD_COUNT) {
|
|
104
|
+
throw new actions_core_1.PayloadValidationError(`received payload count below LiveRamp's ingestion limits. expected: >=${properties_1.LIVERAMP_MIN_RECORD_COUNT} actual: ${input.payloads.length}`);
|
|
105
|
+
}
|
|
126
106
|
s3_1.validateS3(input.payloads[0]);
|
|
127
107
|
const { filename, fileContents } = operations_1.generateFile(input.payloads);
|
|
128
108
|
if (input.features && input.features[properties_1.LIVERAMP_LEGACY_FLOW_FLAG_NAME] === true) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEnteredS3/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEnteredS3/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAChF,6BAA2C;AAC3C,8CAA4C;AAC5C,4CAA6C;AAC7C,8CAAyF;AAMzF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,0EAA0E;IACvF,mBAAmB,EAAE,4BAA4B;IACjD,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,+DAA+D;YAC5E,IAAI,EAAE,QAAQ;SACf;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,uBAAuB;YAC9B,WAAW,EAAE,+DAA+D;YAC5E,IAAI,EAAE,UAAU;SACjB;QACD,kBAAkB,EAAE;YAClB,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,4DAA4D;YACzE,IAAI,EAAE,QAAQ;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,QAAQ;SACf;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EACT,2IAA2I;YAC7I,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,mEAAmE;YAChF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,eAAe,EAAE,eAAe;SACjC;QACD,wBAAwB,EAAE;YACxB,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,0KAA0K;YACvL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,eAAe,EAAE,eAAe;SACjC;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,0DAA0D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9B,yEAAyE,sCAAyB,YAAY,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CACtI,CAAA;KACF;IAED,eAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAE7B,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,yBAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAE/D,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,2CAA8B,CAAC,KAAK,IAAI,EAAE;QAI7E,OAAO,aAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;KAC1E;SAAM;QAIL,OAAO,0BAAc,CAAC,KAAK,CAAC,OAAO,EAAE;YACnC,iBAAiB,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc;YACvE,UAAU,EAAE,IAAI;YAChB,QAAQ;YACR,YAAY;YACZ,MAAM,EAAE;gBACN,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,kBAAkB;gBAClD,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa;gBACzC,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB;gBAClD,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB;aACvD;SACF,CAAC,CAAA;KACH;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ModifiedResponse, RequestOptions } from '@segment/actions-core';
|
|
3
3
|
import { Payload } from './generated-types';
|
|
4
|
-
import { Writable } from 'stream';
|
|
5
4
|
declare function validateS3(payload: Payload): void;
|
|
6
5
|
declare function uploadS3(payload: Payload, filename: string, fileContent: Buffer, request: <Data = unknown>(url: string, options?: RequestOptions) => Promise<ModifiedResponse<Data>>): Promise<ModifiedResponse<unknown>>;
|
|
7
|
-
export declare class S3WriteStream extends Writable {
|
|
8
|
-
buffer: Buffer;
|
|
9
|
-
constructor();
|
|
10
|
-
_construct(callback: (error?: Error) => void): void;
|
|
11
|
-
_write(chunk: any, _encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
12
|
-
_final(callback: (error?: Error) => void): void;
|
|
13
|
-
_destroy(_error: Error, callback: (error?: Error) => void): void;
|
|
14
|
-
}
|
|
15
6
|
export { validateS3, uploadS3 };
|
|
@@ -3,10 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.uploadS3 = exports.validateS3 =
|
|
6
|
+
exports.uploadS3 = exports.validateS3 = void 0;
|
|
7
7
|
const s3_1 = __importDefault(require("../../../lib/AWS/s3"));
|
|
8
8
|
const actions_core_1 = require("@segment/actions-core");
|
|
9
|
-
const stream_1 = require("stream");
|
|
10
9
|
function validateS3(payload) {
|
|
11
10
|
if (!payload.s3_aws_access_key) {
|
|
12
11
|
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS Access Key');
|
|
@@ -35,24 +34,4 @@ async function uploadS3(payload, filename, fileContent, request) {
|
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
exports.uploadS3 = uploadS3;
|
|
38
|
-
class S3WriteStream extends stream_1.Writable {
|
|
39
|
-
constructor() {
|
|
40
|
-
super({ objectMode: false });
|
|
41
|
-
this.buffer = Buffer.from('');
|
|
42
|
-
}
|
|
43
|
-
_construct(callback) {
|
|
44
|
-
callback();
|
|
45
|
-
}
|
|
46
|
-
_write(chunk, _encoding, callback) {
|
|
47
|
-
this.buffer = Buffer.concat([this.buffer, chunk]);
|
|
48
|
-
callback();
|
|
49
|
-
}
|
|
50
|
-
_final(callback) {
|
|
51
|
-
callback();
|
|
52
|
-
}
|
|
53
|
-
_destroy(_error, callback) {
|
|
54
|
-
callback();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.S3WriteStream = S3WriteStream;
|
|
58
37
|
//# sourceMappingURL=s3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEnteredS3/s3.ts"],"names":[],"mappings":";;;;;;AAAA,6DAA0D;AAC1D,wDAAoG;
|
|
1
|
+
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEnteredS3/s3.ts"],"names":[],"mappings":";;;;;;AAAA,6DAA0D;AAC1D,wDAAoG;AAGpG,SAAS,UAAU,CAAC,OAAgB;IAClC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE;QAC9B,MAAM,IAAI,yCAA0B,CAAC,qDAAqD,CAAC,CAAA;KAC5F;IAED,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE;QAC9B,MAAM,IAAI,yCAA0B,CAAC,qDAAqD,CAAC,CAAA;KAC5F;IAED,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE;QAC/B,MAAM,IAAI,yCAA0B,CAAC,yDAAyD,CAAC,CAAA;KAChG;IAED,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QAC1B,MAAM,IAAI,yCAA0B,CAAC,iDAAiD,CAAC,CAAA;KACxF;AACH,CAAC;AA6BQ,gCAAU;AA3BnB,KAAK,UAAU,QAAQ,CACrB,OAAgB,EAChB,QAAgB,EAChB,WAAmB,EACnB,OAAmG;IAEnG,MAAM,MAAM,GAAG,KAAK,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,YAAwB,CACzC,OAAO,CAAC,kBAA4B,EACpC,OAAO,CAAC,aAAuB,EAC/B,QAAQ,EACR,MAAM,EACN,WAAW,EACX,OAAO,CAAC,iBAA2B,EACnC,OAAO,CAAC,iBAA2B,CACpC,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"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
4
|
const sftp_1 = require("./sftp");
|
|
8
5
|
const operations_1 = require("../operations");
|
|
9
6
|
const awsClient_1 = require("../awsClient");
|
|
10
|
-
const fs_1 = __importDefault(require("fs"));
|
|
11
7
|
const properties_1 = require("../properties");
|
|
12
|
-
const promises_1 = require("stream/promises");
|
|
13
8
|
const action = {
|
|
14
9
|
title: 'Audience Entered (SFTP)',
|
|
15
10
|
description: 'Uploads audience membership data to a file through SFTP for LiveRamp ingestion.',
|
|
@@ -27,7 +22,7 @@ const action = {
|
|
|
27
22
|
},
|
|
28
23
|
sftp_folder_path: {
|
|
29
24
|
label: 'Folder Path',
|
|
30
|
-
description: 'Path within the LiveRamp SFTP server to
|
|
25
|
+
description: 'Path within the LiveRamp SFTP server to upload the files to. This path must exist and all subfolders must be pre-created.',
|
|
31
26
|
type: 'string',
|
|
32
27
|
default: { '@template': '/uploads/' },
|
|
33
28
|
format: 'uri-reference'
|
|
@@ -99,20 +94,6 @@ const action = {
|
|
|
99
94
|
features,
|
|
100
95
|
rawData
|
|
101
96
|
});
|
|
102
|
-
},
|
|
103
|
-
async performBatchStream(_request, { payload }) {
|
|
104
|
-
const csv = new operations_1.ObjectToCSVTransformer();
|
|
105
|
-
const fileStream = fs_1.default.createWriteStream('/tmp/test123.csv');
|
|
106
|
-
await promises_1.pipeline(payload, csv, fileStream);
|
|
107
|
-
const sftpClient = new sftp_1.Client();
|
|
108
|
-
await sftpClient.connect({
|
|
109
|
-
host: properties_1.LIVERAMP_SFTP_SERVER,
|
|
110
|
-
port: properties_1.LIVERAMP_SFTP_PORT,
|
|
111
|
-
username: csv.sftp.sftpUsername,
|
|
112
|
-
password: csv.sftp.sftpPassword
|
|
113
|
-
});
|
|
114
|
-
await sftpClient.fastPut('test123.csv', '/uploads/varada_test/test1123.csv');
|
|
115
|
-
fs_1.default.unlinkSync('test123.csv');
|
|
116
97
|
}
|
|
117
98
|
};
|
|
118
99
|
async function processData(input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEnteredSftp/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEnteredSftp/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAChF,iCAAuE;AACvE,8CAA4C;AAC5C,4CAA6C;AAC7C,8CAAyF;AAMzF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,iFAAiF;IAC9F,mBAAmB,EAAE,4BAA4B;IACjD,MAAM,EAAE;QACN,aAAa,EAAE;YACb,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,qEAAqE;YAClF,IAAI,EAAE,QAA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KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;KACzE;SAAM;QAIL,OAAO,0BAAc,CAAC,KAAK,CAAC,OAAO,EAAE;YACnC,iBAAiB,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc;YACvE,UAAU,EAAE,MAAM;YAClB,QAAQ;YACR,YAAY;YACZ,QAAQ,EAAE;gBACR,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa;gBAC7C,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa;gBAC7C,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB;aACnD;SACF,CAAC,CAAA;KACH;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { RequestClient, ExecuteInput } from '@segment/actions-core';
|
|
3
3
|
import type { Payload as s3Payload } from './audienceEnteredS3/generated-types';
|
|
4
4
|
import type { Payload as sftpPayload } from './audienceEnteredSftp/generated-types';
|
|
5
|
-
import { Transform } from 'stream';
|
|
6
5
|
export declare type RawData = {
|
|
7
6
|
context?: {
|
|
8
7
|
personas?: {
|
|
@@ -21,28 +20,10 @@ export declare type ProcessDataInput<T extends s3Payload | sftpPayload> = {
|
|
|
21
20
|
export declare type ExecuteInputRaw<Settings, Payload, RawData, AudienceSettings = unknown> = ExecuteInput<Settings, Payload, AudienceSettings> & {
|
|
22
21
|
rawData?: RawData;
|
|
23
22
|
};
|
|
24
|
-
export declare type SFTPCreds = {
|
|
25
|
-
sftpUsername: string;
|
|
26
|
-
sftpPassword: string;
|
|
27
|
-
};
|
|
28
|
-
export declare type S3Creds = {
|
|
29
|
-
s3_aws_access_key: string;
|
|
30
|
-
s3_aws_secret_key: string;
|
|
31
|
-
s3_aws_bucket_name: string;
|
|
32
|
-
s3_aws_region: string;
|
|
33
|
-
file_name: string;
|
|
34
|
-
};
|
|
35
|
-
declare class ObjectToCSVTransformer extends Transform {
|
|
36
|
-
headerWritten: boolean;
|
|
37
|
-
sftp: SFTPCreds;
|
|
38
|
-
s3: S3Creds;
|
|
39
|
-
constructor(options?: {});
|
|
40
|
-
_transform(payloads: s3Payload[] | sftpPayload[], _encoding: any, callback: (err?: Error) => void): void;
|
|
41
|
-
}
|
|
42
23
|
declare function generateFile(payloads: s3Payload[] | sftpPayload[]): {
|
|
43
24
|
filename: string;
|
|
44
25
|
fileContents: Buffer;
|
|
45
26
|
};
|
|
46
27
|
declare function enquoteIdentifier(identifier: string): string;
|
|
47
28
|
declare const normalize: (key: string, value: string) => string;
|
|
48
|
-
export { generateFile, enquoteIdentifier, normalize
|
|
29
|
+
export { generateFile, enquoteIdentifier, normalize };
|
|
@@ -1,73 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.normalize = exports.enquoteIdentifier = exports.generateFile = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
|
-
const stream_1 = require("stream");
|
|
6
|
-
class ObjectToCSVTransformer extends stream_1.Transform {
|
|
7
|
-
constructor(options = {}) {
|
|
8
|
-
super(Object.assign({ objectMode: true }, options));
|
|
9
|
-
this.headerWritten = false;
|
|
10
|
-
}
|
|
11
|
-
_transform(payloads, _encoding, callback) {
|
|
12
|
-
const rows = [];
|
|
13
|
-
try {
|
|
14
|
-
for (const payload of payloads) {
|
|
15
|
-
if (!this.headerWritten) {
|
|
16
|
-
const headers = ['audience_key'];
|
|
17
|
-
if (!this.sftp && payload.sftp_password && payload.sftp_username) {
|
|
18
|
-
this.sftp = {
|
|
19
|
-
sftpPassword: payload.sftp_password,
|
|
20
|
-
sftpUsername: payload.sftp_username
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
if (!this.s3 && payload.s3_aws_access_key) {
|
|
24
|
-
this.s3 = {
|
|
25
|
-
s3_aws_access_key: payload.s3_aws_access_key,
|
|
26
|
-
s3_aws_region: payload.s3_aws_region,
|
|
27
|
-
s3_aws_secret_key: payload.s3_aws_secret_key,
|
|
28
|
-
s3_aws_bucket_name: payload.s3_aws_bucket_name,
|
|
29
|
-
file_name: payload.filename
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
if (payloads[0].identifier_data) {
|
|
33
|
-
for (const identifier of Object.getOwnPropertyNames(payloads[0].identifier_data)) {
|
|
34
|
-
headers.push(identifier);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (payloads[0].unhashed_identifier_data) {
|
|
38
|
-
for (const identifier of Object.getOwnPropertyNames(payloads[0].unhashed_identifier_data)) {
|
|
39
|
-
headers.push(identifier);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
this.push(Buffer.from(headers.join(',') + '\n'));
|
|
43
|
-
this.headerWritten = true;
|
|
44
|
-
}
|
|
45
|
-
const row = [enquoteIdentifier(payload.audience_key)];
|
|
46
|
-
if (payload.identifier_data) {
|
|
47
|
-
for (const key in payload.identifier_data) {
|
|
48
|
-
if (Object.prototype.hasOwnProperty.call(payload.identifier_data, key)) {
|
|
49
|
-
row.push(enquoteIdentifier(String(payload.identifier_data[key])));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (payload.unhashed_identifier_data) {
|
|
54
|
-
for (const key in payload.unhashed_identifier_data) {
|
|
55
|
-
if (Object.prototype.hasOwnProperty.call(payload.unhashed_identifier_data, key)) {
|
|
56
|
-
row.push(`"${hash(normalize(key, String(payload.unhashed_identifier_data[key])))}"`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
rows.push(Buffer.from(row.join(',') + '\n'));
|
|
61
|
-
}
|
|
62
|
-
this.push(Buffer.concat(rows));
|
|
63
|
-
callback();
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
callback(error);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.ObjectToCSVTransformer = ObjectToCSVTransformer;
|
|
71
5
|
function generateFile(payloads) {
|
|
72
6
|
const headers = new Set();
|
|
73
7
|
headers.add('audience_key');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/destinations/liveramp-audiences/operations.ts"],"names":[],"mappings":";;;AACA,mCAAmC;
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/destinations/liveramp-audiences/operations.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AAgCnC,SAAS,YAAY,CAAC,QAAqC;IAEzD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAA;IACjC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IAG3B,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAG1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QAC3B,MAAM,GAAG,GAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA;QAG/D,IAAI,OAAO,CAAC,wBAAwB,EAAE;YACpC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE;gBAClD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,GAAG,CAAC,EAAE;oBAC/E,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;oBAChB,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,wBAA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AAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAA;AACtD,CAAC;AAoCsB,8CAAiB;AAlCxC,MAAM,IAAI,GAAG,CAAC,KAAa,EAAU,EAAE;IACrC,MAAM,IAAI,GAAG,mBAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC,CAAA;AAMD,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,KAAa,EAAU,EAAE;IACvD,QAAQ,GAAG,EAAE;QACX,KAAK,cAAc,CAAC,CAAC;YAMnB,MAAM,UAAU,GAAG,qDAAqD,CAAA;YACxE,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACpC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,KAAK,CAAA;YAG5C,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;SAC/B;QAED,KAAK,OAAO,CAAC,CAAC;YACZ,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAA;SAClC;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAEyC,8BAAS"}
|
|
@@ -138,11 +138,13 @@ const action = {
|
|
|
138
138
|
},
|
|
139
139
|
visible_to: {
|
|
140
140
|
label: 'Visible To',
|
|
141
|
-
description:
|
|
142
|
-
type: '
|
|
141
|
+
description: "Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user. 'Owner's visibility group and sub-groups' and 'Entire company' options only available with Professional or Enterprise plans",
|
|
142
|
+
type: 'string',
|
|
143
143
|
choices: [
|
|
144
|
-
{ label: 'Owner & followers (private)', value: 1 },
|
|
145
|
-
{ label: 'Entire company (shared)', value: 3 }
|
|
144
|
+
{ label: 'Owner & followers (private)', value: '1' },
|
|
145
|
+
{ label: 'Entire company (shared)', value: '3' },
|
|
146
|
+
{ label: "Owner's visibility group and sub-groups", value: '5' },
|
|
147
|
+
{ label: 'Entire company', value: '7' }
|
|
146
148
|
],
|
|
147
149
|
required: false
|
|
148
150
|
},
|