@segment/action-destinations 3.259.0-staging-4802f81 → 3.259.0-staging-e402834b5
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/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/customerio/utils.d.ts +1 -1
- package/dist/destinations/engage/utils/track.d.ts +19 -19
- package/dist/destinations/klaviyo/orderCompleted/generated-types.d.ts +1 -4
- package/dist/destinations/klaviyo/orderCompleted/index.js +6 -15
- package/dist/destinations/klaviyo/orderCompleted/index.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfile/index.js +24 -3
- package/dist/destinations/klaviyo/removeProfile/index.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/{liveramp-audiences/audienceEntered → klaviyo/removeProfileToList}/index.d.ts +1 -1
- package/dist/destinations/klaviyo/removeProfileToList/index.js +42 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/klaviyo/trackEvent/index.js +1 -0
- package/dist/destinations/klaviyo/trackEvent/index.js.map +1 -1
- package/dist/destinations/klaviyo/types.d.ts +3 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +381 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +504 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +4 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +97 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +1 -0
- package/dist/destinations/trackey/group.types.d.ts +11 -0
- package/dist/destinations/trackey/group.types.js +3 -0
- package/dist/destinations/trackey/group.types.js.map +1 -0
- package/dist/destinations/trackey/identify.types.d.ts +11 -0
- package/dist/destinations/trackey/identify.types.js +3 -0
- package/dist/destinations/trackey/identify.types.js.map +1 -0
- package/dist/destinations/trackey/track.types.d.ts +12 -0
- package/dist/destinations/trackey/track.types.js +3 -0
- package/dist/destinations/trackey/track.types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.d.ts +4 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js +3 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.d.ts +5 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js +26 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.d.ts +6 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js +3 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.d.ts +5 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.js +38 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.js.map +1 -0
- package/dist/destinations/yahoo-audiences/utils.d.ts +4 -0
- package/dist/destinations/yahoo-audiences/utils.js +30 -0
- package/dist/destinations/yahoo-audiences/utils.js.map +1 -0
- package/package.json +1 -1
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.d.ts +0 -13
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.js.map +0 -1
- package/dist/destinations/liveramp-audiences/audienceEntered/index.js +0 -95
- package/dist/destinations/liveramp-audiences/audienceEntered/index.js.map +0 -1
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.d.ts +0 -6
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.js +0 -37
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.js.map +0 -1
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.d.ts +0 -7
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.js +0 -52
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.js.map +0 -1
- /package/dist/destinations/{liveramp-audiences/audienceEntered → klaviyo/removeProfileToList}/generated-types.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/group.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identify.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/identify.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/track.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createCustomerNode/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const action = {
|
|
4
|
+
title: 'Create top-level CUSTOMER node in Yahoo taxonomy',
|
|
5
|
+
defaultSubscription: 'event = "Audience Entered" and event = "Audience Exited"',
|
|
6
|
+
description: '',
|
|
7
|
+
fields: {
|
|
8
|
+
engage_space_id: {
|
|
9
|
+
label: 'Engage Space Id',
|
|
10
|
+
description: 'Provide Engage Space Id found in Unify > Settings > API Access. This maps to the "Id" and "Name" of the top-level Customer node in Yahoo taxonomy',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
customer_desc: {
|
|
15
|
+
label: 'Customer Description',
|
|
16
|
+
description: 'Provide a description for the Customer node in Yahoo taxonomy. This must be less then 1000 characters',
|
|
17
|
+
type: 'string',
|
|
18
|
+
required: false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
perform: () => {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.default = action;
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createCustomerNode/index.ts"],"names":[],"mappings":";;AAMA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kDAAkD;IACzD,mBAAmB,EAAE,0DAA0D;IAC/E,WAAW,EAAE,EAAE;IACf,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,mJAAmJ;YACrJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,uGAAuG;YACzG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IASD,OAAO,EAAE,GAAG,EAAE;QACZ,OAAM;IACR,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createSegment/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const action = {
|
|
4
|
+
title: 'Create SEGMENT sub-node in Yahoo taxonomy',
|
|
5
|
+
description: 'Use this action to generate SEGMENT sub-node within CUSTOMER node in Yahoo taxonomy',
|
|
6
|
+
defaultSubscription: 'event = "Audience Entered" and event = "Audience Exited"',
|
|
7
|
+
fields: {
|
|
8
|
+
segment_audience_key: {
|
|
9
|
+
label: 'Audience Key',
|
|
10
|
+
description: 'Provide audience key. This maps to the "Name" of the Segment node in Yahoo taxonomy',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
segment_audience_id: {
|
|
15
|
+
label: 'Audience Id',
|
|
16
|
+
description: 'Provide audience Id (aud_...) from audience URL in Segment Engage. This maps to the "Id" of the Segment node in Yahoo taxonomy',
|
|
17
|
+
type: 'string',
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
engage_space_id: {
|
|
21
|
+
label: 'Engage Space Id',
|
|
22
|
+
description: 'Provide Engage Space Id found in Unify > Settings > API Access. This maps to the "Id" and "Name" of the top-level Customer node in Yahoo taxonomy and specifies the parent node for your Segment node in Yahoo taxonomy',
|
|
23
|
+
type: 'string',
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
customer_desc: {
|
|
27
|
+
label: 'Space Description',
|
|
28
|
+
description: 'Provide the description for Segment node in Yahoo taxonomy. This must be less then 1000 characters',
|
|
29
|
+
type: 'string',
|
|
30
|
+
required: false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
perform: () => {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.default = action;
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createSegment/index.ts"],"names":[],"mappings":";;AAQA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,2CAA2C;IAClD,WAAW,EAAE,qFAAqF;IAClG,mBAAmB,EAAE,0DAA0D;IAE/E,MAAM,EAAE;QACN,oBAAoB,EAAE;YACpB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,qFAAqF;YAClG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,aAAa;YACpB,WAAW,EACT,gIAAgI;YAClI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,yNAAyN;YAC3N,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,aAAa,EAAE;YACb,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,oGAAoG;YACjH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IAUD,OAAO,EAAE,GAAG,EAAE;QACZ,OAAM;IACR,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RequestClient } from '@segment/actions-core';
|
|
2
|
+
import { CredsObj } from './types';
|
|
3
|
+
export declare function gen_random_id(length: number): string;
|
|
4
|
+
export declare function update_taxonomy(engage_space_id: string, tx_creds: CredsObj, request: RequestClient, body_form_data: string): Promise<any>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update_taxonomy = exports.gen_random_id = void 0;
|
|
4
|
+
const utils_tax_1 = require("./utils-tax");
|
|
5
|
+
function gen_random_id(length) {
|
|
6
|
+
const pattern = 'abcdefghijklmnopqrstuvwxyz123456789';
|
|
7
|
+
const result = [];
|
|
8
|
+
for (let i = 0; i < length; i++) {
|
|
9
|
+
result.push(pattern[Math.floor(Math.random() * pattern.length)]);
|
|
10
|
+
}
|
|
11
|
+
return result.join('');
|
|
12
|
+
}
|
|
13
|
+
exports.gen_random_id = gen_random_id;
|
|
14
|
+
async function update_taxonomy(engage_space_id, tx_creds, request, body_form_data) {
|
|
15
|
+
const tx_client_secret = tx_creds.tx_client_key;
|
|
16
|
+
const tx_client_key = tx_creds.tx_client_secret;
|
|
17
|
+
const url = `https://datax.yahooapis.com/v1/taxonomy/append${engage_space_id.length > 0 ? '/' + engage_space_id : ''}`;
|
|
18
|
+
const oauth1_auth_string = utils_tax_1.gen_oauth1_signature(tx_client_key, tx_client_secret, 'PUT', url);
|
|
19
|
+
const add_segment_node = await request(url, {
|
|
20
|
+
method: 'PUT',
|
|
21
|
+
body: body_form_data,
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: oauth1_auth_string,
|
|
24
|
+
'Content-Type': 'multipart/form-data; boundary=SEGMENT-DATA'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return await add_segment_node.json();
|
|
28
|
+
}
|
|
29
|
+
exports.update_taxonomy = update_taxonomy;
|
|
30
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/yahoo-audiences/utils.ts"],"names":[],"mappings":";;;AAEA,2CAAkD;AAQlD,SAAgB,aAAa,CAAC,MAAc;IAC1C,MAAM,OAAO,GAAG,qCAAqC,CAAA;IACrD,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;KACjE;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxB,CAAC;AAPD,sCAOC;AAEM,KAAK,UAAU,eAAe,CACnC,eAAuB,EACvB,QAAkB,EAClB,OAAsB,EACtB,cAAsB;IAEtB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAA;IAC/C,MAAM,aAAa,GAAG,QAAQ,CAAC,gBAAgB,CAAA;IAC/C,MAAM,GAAG,GAAG,iDAAiD,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;IACtH,MAAM,kBAAkB,GAAG,gCAAoB,CAAC,aAAa,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;IAE5F,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE;QAC1C,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE;YACP,aAAa,EAAE,kBAAkB;YACjC,cAAc,EAAE,4CAA4C;SAC7D;KACF,CAAC,CAAA;IAEF,OAAO,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAA;AACtC,CAAC;AArBD,0CAqBC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.259.0-staging-
|
|
4
|
+
"version": "3.259.0-staging-e402834b5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEntered/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,95 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,mBAAmB,EAAE,4BAA4B;IACjD,MAAM,EAAE;QACN,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,kDAAkD;YAC/D,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,gFAAgF;YAC7F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,eAAe,EAAE,eAAe;SACjC;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,0DAA0D;YACvE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,GAAG;SACb;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB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QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;KAC1F;IAED,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,yBAAY,CAAC,QAAQ,CAAC,CAAA;IAExD,QAAQ,QAAQ,CAAC,WAAW,EAAE;QAC5B,KAAK,IAAI;YACP,OAAO,aAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;QAC3D,KAAK,MAAM,CAAC,CAAC;YACX,MAAM,UAAU,GAAG,IAAI,aAAU,EAAE,CAAA;YACnC,OAAO,iBAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;SAC/D;KACF;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
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 };
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 };
|
|
@@ -1,52 +0,0 @@
|
|
|
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.Client = exports.testAuthenticationSFTP = exports.uploadSFTP = exports.validateSFTP = void 0;
|
|
7
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
8
|
-
const ssh2_sftp_client_1 = __importDefault(require("ssh2-sftp-client"));
|
|
9
|
-
exports.Client = ssh2_sftp_client_1.default;
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const LIVERAMP_SFTP_SERVER = 'files.liveramp.com';
|
|
12
|
-
const LIVERAMP_SFTP_PORT = 22;
|
|
13
|
-
function validateSFTP(settings) {
|
|
14
|
-
if (!settings.sftp_username) {
|
|
15
|
-
throw new actions_core_1.InvalidAuthenticationError('Selected SFTP upload mode, but missing credentials (Username)');
|
|
16
|
-
}
|
|
17
|
-
if (!settings.sftp_password) {
|
|
18
|
-
throw new actions_core_1.InvalidAuthenticationError('Selected SFTP upload mode, but missing credentials (Password)');
|
|
19
|
-
}
|
|
20
|
-
if (!settings.sftp_folder_path) {
|
|
21
|
-
throw new actions_core_1.InvalidAuthenticationError('Selected SFTP upload mode, but missing SFTP folder path.');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.validateSFTP = validateSFTP;
|
|
25
|
-
async function uploadSFTP(sftp, settings, filename, fileContent) {
|
|
26
|
-
return doSFTP(sftp, settings, async (sftp) => {
|
|
27
|
-
const targetPath = path_1.default.join(settings.sftp_folder_path, filename);
|
|
28
|
-
return sftp.put(fileContent, targetPath);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
exports.uploadSFTP = uploadSFTP;
|
|
32
|
-
async function doSFTP(sftp, settings, action) {
|
|
33
|
-
await sftp.connect({
|
|
34
|
-
host: LIVERAMP_SFTP_SERVER,
|
|
35
|
-
port: LIVERAMP_SFTP_PORT,
|
|
36
|
-
username: settings.sftp_username,
|
|
37
|
-
password: settings.sftp_password
|
|
38
|
-
});
|
|
39
|
-
const retVal = await action(sftp);
|
|
40
|
-
await sftp.end();
|
|
41
|
-
return retVal;
|
|
42
|
-
}
|
|
43
|
-
async function testAuthenticationSFTP(sftp, settings) {
|
|
44
|
-
return doSFTP(sftp, settings, async (sftp) => {
|
|
45
|
-
return sftp.exists(settings.sftp_folder_path).then((fileType) => {
|
|
46
|
-
if (!fileType)
|
|
47
|
-
throw new Error(`Could not find path: ${settings.sftp_folder_path}`);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
exports.testAuthenticationSFTP = testAuthenticationSFTP;
|
|
52
|
-
//# sourceMappingURL=sftp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sftp.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEntered/sftp.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAkE;AAClE,wEAAqC;AAiDsB,iBAjDpD,0BAAM,CAiDoD;AAhDjE,gDAAuB;AAGvB,MAAM,oBAAoB,GAAG,oBAAoB,CAAA;AACjD,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAE7B,SAAS,YAAY,CAAC,QAAkB;IACtC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QAC3B,MAAM,IAAI,yCAA0B,CAAC,+DAA+D,CAAC,CAAA;KACtG;IAED,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QAC3B,MAAM,IAAI,yCAA0B,CAAC,+DAA+D,CAAC,CAAA;KACtG;IAED,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE;QAC9B,MAAM,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