@segment/action-destinations 3.201.0 → 3.205.2-staging.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/acoustic-s3tc/generated-types.d.ts +8 -0
- package/dist/destinations/{liveramp-audiences/audienceEnteredSFTP.types.js → acoustic-s3tc/generated-types.js} +1 -1
- package/dist/destinations/acoustic-s3tc/generated-types.js.map +1 -0
- package/dist/destinations/acoustic-s3tc/index.d.ts +4 -0
- package/dist/destinations/acoustic-s3tc/index.js +97 -0
- package/dist/destinations/acoustic-s3tc/index.js.map +1 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.d.ts +7 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js +109 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js.map +1 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/generated-types.d.ts +20 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/generated-types.js +3 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/generated-types.js.map +1 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/index.d.ts +5 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/index.js +98 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/index.js.map +1 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.d.ts +3 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.js +23 -0
- package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.js.map +1 -0
- package/dist/destinations/airship/index.js +7 -5
- package/dist/destinations/airship/index.js.map +1 -1
- package/dist/destinations/airship/registerAndAssociate/generated-types.d.ts +20 -0
- package/dist/destinations/airship/registerAndAssociate/generated-types.js +3 -0
- package/dist/destinations/airship/registerAndAssociate/generated-types.js.map +1 -0
- package/dist/destinations/airship/registerAndAssociate/index.d.ts +5 -0
- package/dist/destinations/airship/registerAndAssociate/index.js +169 -0
- package/dist/destinations/airship/registerAndAssociate/index.js.map +1 -0
- package/dist/destinations/airship/utilities.d.ts +10 -4
- package/dist/destinations/airship/utilities.js +94 -8
- package/dist/destinations/airship/utilities.js.map +1 -1
- package/dist/destinations/braze/index.js +1 -0
- package/dist/destinations/braze/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/constants.d.ts +1 -0
- package/dist/destinations/dynamic-yield-audiences/constants.js +5 -0
- package/dist/destinations/dynamic-yield-audiences/constants.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/generated-types.d.ts +7 -0
- package/dist/destinations/dynamic-yield-audiences/generated-types.js +3 -0
- package/dist/destinations/dynamic-yield-audiences/generated-types.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/helpers.d.ts +4 -0
- package/dist/destinations/dynamic-yield-audiences/helpers.js +18 -0
- package/dist/destinations/dynamic-yield-audiences/helpers.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/index.d.ts +4 -0
- package/dist/destinations/dynamic-yield-audiences/index.js +76 -0
- package/dist/destinations/dynamic-yield-audiences/index.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/generated-types.d.ts +7 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/generated-types.js +3 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/generated-types.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.d.ts +5 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js +78 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/types.d.ts +22 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/types.js +3 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/types.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/types.d.ts +8 -0
- package/dist/destinations/dynamic-yield-audiences/types.js +12 -0
- package/dist/destinations/dynamic-yield-audiences/types.js.map +1 -0
- package/dist/destinations/index.js +3 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/operations.js +15 -13
- package/dist/destinations/liveramp-audiences/operations.js.map +1 -1
- package/dist/destinations/mixpanel/mixpanel-types.d.ts +5 -0
- package/dist/destinations/mixpanel/trackEvent/functions.js +6 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
- package/dist/destinations/optimizely-advanced-audience-targeting/generated-types.d.ts +4 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/generated-types.js +3 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/generated-types.js.map +1 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/index.d.ts +4 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/index.js +51 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/index.js.map +1 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/generated-types.d.ts +7 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/generated-types.js +3 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/generated-types.js.map +1 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.d.ts +5 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js +80 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js.map +1 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/utils.d.ts +2 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/utils.js +23 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/utils.js.map +1 -0
- package/dist/destinations/pushwoosh/updateUserProfile/index.js.map +1 -1
- package/dist/destinations/salesforce/lead/index.js +2 -2
- package/dist/destinations/salesforce/lead/index.js.map +1 -1
- package/dist/destinations/salesforce/sf-operations.d.ts +8 -6
- package/dist/destinations/salesforce/sf-operations.js +24 -14
- package/dist/destinations/salesforce/sf-operations.js.map +1 -1
- package/dist/destinations/salesforce/sf-utils.js +8 -10
- package/dist/destinations/salesforce/sf-utils.js.map +1 -1
- package/dist/destinations/the-trade-desk-crm/properties.d.ts +0 -1
- package/dist/destinations/the-trade-desk-crm/properties.js +11 -24
- package/dist/destinations/the-trade-desk-crm/properties.js.map +1 -1
- package/dist/destinations/tiktok-audiences/addToAudience/generated-types.d.ts +9 -0
- package/dist/destinations/tiktok-audiences/addToAudience/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/addToAudience/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/addToAudience/index.d.ts +5 -0
- package/dist/destinations/tiktok-audiences/addToAudience/index.js +43 -0
- package/dist/destinations/tiktok-audiences/addToAudience/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/addUser/index.js +14 -3
- package/dist/destinations/tiktok-audiences/addUser/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/createAudience/index.js +10 -1
- package/dist/destinations/tiktok-audiences/createAudience/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/functions.d.ts +6 -2
- package/dist/destinations/tiktok-audiences/functions.js +27 -5
- package/dist/destinations/tiktok-audiences/functions.js.map +1 -1
- package/dist/destinations/tiktok-audiences/generated-types.d.ts +1 -1
- package/dist/destinations/tiktok-audiences/index.js +14 -2
- package/dist/destinations/tiktok-audiences/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/properties.d.ts +1 -0
- package/dist/destinations/tiktok-audiences/properties.js +9 -1
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
- package/dist/destinations/tiktok-audiences/removeFromAudience/generated-types.d.ts +9 -0
- package/dist/destinations/tiktok-audiences/removeFromAudience/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/removeFromAudience/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/removeFromAudience/index.d.ts +5 -0
- package/dist/destinations/tiktok-audiences/removeFromAudience/index.js +39 -0
- package/dist/destinations/tiktok-audiences/removeFromAudience/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/removeUser/index.js +14 -3
- package/dist/destinations/tiktok-audiences/removeUser/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/liveramp-audiences/audienceEnteredSFTP.types.d.ts +0 -16
- package/dist/destinations/liveramp-audiences/audienceEnteredSFTP.types.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/acoustic-s3tc/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const index_1 = __importDefault(require("./receiveEvents/index"));
|
|
8
|
+
const mod = `
|
|
9
|
+
Last-Modified: 08.22.2023 09.14.43
|
|
10
|
+
`;
|
|
11
|
+
const presets = [
|
|
12
|
+
{
|
|
13
|
+
name: 'Track Calls',
|
|
14
|
+
subscribe: 'type = "track"',
|
|
15
|
+
partnerAction: 'receiveEvents',
|
|
16
|
+
mapping: {
|
|
17
|
+
...actions_core_1.defaultValues(index_1.default.fields),
|
|
18
|
+
email: {
|
|
19
|
+
'@if': {
|
|
20
|
+
exists: { '@path': '$.properties.email' },
|
|
21
|
+
then: { '@path': '$.properties.email' },
|
|
22
|
+
else: { '@path': '$.context.traits.email' }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
type: 'automatic'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Identify Calls',
|
|
30
|
+
subscribe: 'type = "identify"',
|
|
31
|
+
partnerAction: 'receiveEvents',
|
|
32
|
+
mapping: {
|
|
33
|
+
...actions_core_1.defaultValues(index_1.default.fields),
|
|
34
|
+
email: {
|
|
35
|
+
'@if': {
|
|
36
|
+
exists: { '@path': '$.traits.email' },
|
|
37
|
+
then: { '@path': '$.traits.email' },
|
|
38
|
+
else: { '@path': '$.context.traits.email' }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
type: 'automatic'
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
const destination = {
|
|
46
|
+
name: 'Acoustic (Actions)',
|
|
47
|
+
slug: 'actions-acoustic',
|
|
48
|
+
mode: 'cloud',
|
|
49
|
+
description: 'Send Segment Track and Identify Event Data to Acoustic Connect',
|
|
50
|
+
authentication: {
|
|
51
|
+
scheme: 'custom',
|
|
52
|
+
fields: {
|
|
53
|
+
fileNamePrefix: {
|
|
54
|
+
label: 'File Name Prefix',
|
|
55
|
+
description: `Prefix to all Stored File Names`,
|
|
56
|
+
type: 'string',
|
|
57
|
+
required: false,
|
|
58
|
+
default: 'customer_org_'
|
|
59
|
+
},
|
|
60
|
+
s3_access_key: {
|
|
61
|
+
label: 'S3 Access Key',
|
|
62
|
+
description: 'Write permission to the S3 bucket.',
|
|
63
|
+
type: 'string'
|
|
64
|
+
},
|
|
65
|
+
s3_secret: {
|
|
66
|
+
label: 'S3 Secret',
|
|
67
|
+
description: 'Write permission to the S3 bucket.',
|
|
68
|
+
type: 'password'
|
|
69
|
+
},
|
|
70
|
+
s3_bucket: {
|
|
71
|
+
label: 'S3 Bucket Access Point',
|
|
72
|
+
description: 'An Access Point created as access to the S3 bucket.',
|
|
73
|
+
default: 's3://arn:aws:s3:us-east-1:777957353822:accesspoint/tricklercache-access',
|
|
74
|
+
type: 'string'
|
|
75
|
+
},
|
|
76
|
+
s3_region: {
|
|
77
|
+
label: 'S3 Region',
|
|
78
|
+
description: 'See S3 definition, should be eg: us-east-1, us-east-2',
|
|
79
|
+
default: 'us-east-1',
|
|
80
|
+
type: 'string'
|
|
81
|
+
},
|
|
82
|
+
version: {
|
|
83
|
+
label: `Version:`,
|
|
84
|
+
description: `\n${mod}\n`,
|
|
85
|
+
default: 'Version 1.7',
|
|
86
|
+
type: 'string',
|
|
87
|
+
required: false
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
presets,
|
|
92
|
+
actions: {
|
|
93
|
+
receiveEvents: index_1.default
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
exports.default = destination;
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/acoustic-s3tc/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,kEAAiD;AAEjD,MAAM,GAAG,GAAG;;CAEX,CAAA;AAID,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,eAAe;QAC9B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,eAAa,CAAC,MAAM,CAAC;YACtC,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;iBAC5C;aACF;SACF;QACD,IAAI,EAAE,WAAW;KAClB;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,mBAAmB;QAC9B,aAAa,EAAE,eAAe;QAC9B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,eAAa,CAAC,MAAM,CAAC;YACtC,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACrC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACnC,IAAI,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;iBAC5C;aACF;SACF;QACD,IAAI,EAAE,WAAW;KAClB;CACF,CAAA;AAED,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,gEAAgE;IAC7E,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,cAAc,EAAE;gBACd,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EAAE,iCAAiC;gBAC9C,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,eAAe;aACzB;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,oCAAoC;gBACjD,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,oCAAoC;gBACjD,IAAI,EAAE,UAAU;aACjB;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,wBAAwB;gBAC/B,WAAW,EAAE,qDAAqD;gBAClE,OAAO,EAAE,yEAAyE;gBAClF,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,uDAAuD;gBACpE,OAAO,EAAE,WAAW;gBACpB,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,KAAK,GAAG,IAAI;gBACzB,OAAO,EAAE,aAAa;gBACtB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;aAChB;SACF;KACF;IACD,OAAO;IACP,OAAO,EAAE;QACP,aAAa,EAAb,eAAa;KACd;CACF,CAAA;AACD,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
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.addUpdateEvents = exports.parseSections = void 0;
|
|
7
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
8
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
9
|
+
function parseSections(section, nestDepth) {
|
|
10
|
+
const parseResults = {};
|
|
11
|
+
try {
|
|
12
|
+
if (nestDepth > 10)
|
|
13
|
+
throw new actions_core_1.IntegrationError('Event data exceeds nesting depth. Use Mapping to avoid nesting data attributes more than 10 levels deep', 'NESTING_DEPTH_EXCEEDED', 400);
|
|
14
|
+
for (const key of Object.keys(section)) {
|
|
15
|
+
if (typeof section[key] === 'object') {
|
|
16
|
+
nestDepth++;
|
|
17
|
+
const nested = parseSections(section[key], nestDepth);
|
|
18
|
+
for (const nestedKey of Object.keys(nested)) {
|
|
19
|
+
parseResults[`${key}.${nestedKey}`] = nested[nestedKey];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
parseResults[key] = section[key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
throw new actions_core_1.IntegrationError(`Unexpected Exception while parsing Event payload.\n ${e}`, 'UNEXPECTED_EVENT_PARSING_EXCEPTION', 400);
|
|
29
|
+
}
|
|
30
|
+
return parseResults;
|
|
31
|
+
}
|
|
32
|
+
exports.parseSections = parseSections;
|
|
33
|
+
function addUpdateEvents(payload, email) {
|
|
34
|
+
let eventName = '';
|
|
35
|
+
let eventValue = '';
|
|
36
|
+
let csvRows = 'EMAIL, EventSource, EventName, EventValue, Event Timestamp\n';
|
|
37
|
+
const eventSource = get_1.default(payload, 'type', 'Null') + ' Event';
|
|
38
|
+
const timestamp = get_1.default(payload, 'timestamp', 'Null');
|
|
39
|
+
let propertiesTraitsKV = {};
|
|
40
|
+
try {
|
|
41
|
+
if (payload.key_value_pairs)
|
|
42
|
+
propertiesTraitsKV = {
|
|
43
|
+
...propertiesTraitsKV,
|
|
44
|
+
...parseSections(payload.key_value_pairs, 0)
|
|
45
|
+
};
|
|
46
|
+
if (payload.array_data)
|
|
47
|
+
propertiesTraitsKV = {
|
|
48
|
+
...propertiesTraitsKV,
|
|
49
|
+
...parseSections(payload.array_data, 0)
|
|
50
|
+
};
|
|
51
|
+
if (payload.traits)
|
|
52
|
+
propertiesTraitsKV = {
|
|
53
|
+
...propertiesTraitsKV,
|
|
54
|
+
...parseSections(payload.traits, 0)
|
|
55
|
+
};
|
|
56
|
+
if (payload.properties)
|
|
57
|
+
propertiesTraitsKV = {
|
|
58
|
+
...propertiesTraitsKV,
|
|
59
|
+
...parseSections(payload.properties, 0)
|
|
60
|
+
};
|
|
61
|
+
if (payload.context)
|
|
62
|
+
propertiesTraitsKV = {
|
|
63
|
+
...propertiesTraitsKV,
|
|
64
|
+
...parseSections(payload.context, 0)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
throw new actions_core_1.IntegrationError('Unexpected Exception processing payload \n ${e}', 'UNEXPECTED_EXCEPTION_PROCESSING_PAYLOAD', 400);
|
|
69
|
+
}
|
|
70
|
+
let ak = '';
|
|
71
|
+
let av = '';
|
|
72
|
+
const getValue = (o, part) => Object.entries(o).find(([k, _v]) => k.includes(part))?.[1];
|
|
73
|
+
const getKey = (o, part) => Object.entries(o).find(([k, _v]) => k.includes(part))?.[0];
|
|
74
|
+
if (getValue(propertiesTraitsKV, 'computation_class')?.toLowerCase() === 'audience') {
|
|
75
|
+
ak = getValue(propertiesTraitsKV, 'computation_key');
|
|
76
|
+
av = getValue(propertiesTraitsKV, `${ak}`);
|
|
77
|
+
let x = getKey(propertiesTraitsKV, 'computation_class');
|
|
78
|
+
delete propertiesTraitsKV[`${x}`];
|
|
79
|
+
x = getKey(propertiesTraitsKV, 'computation_key');
|
|
80
|
+
delete propertiesTraitsKV[`${x}`];
|
|
81
|
+
delete propertiesTraitsKV[`${ak}`];
|
|
82
|
+
}
|
|
83
|
+
if (getValue(propertiesTraitsKV, 'audience_key')) {
|
|
84
|
+
ak = getValue(propertiesTraitsKV, 'audience_key');
|
|
85
|
+
av = getValue(propertiesTraitsKV, `${ak}`);
|
|
86
|
+
const x = getKey(propertiesTraitsKV, 'audience_key');
|
|
87
|
+
delete propertiesTraitsKV[`${x}`];
|
|
88
|
+
delete propertiesTraitsKV[`${ak}`];
|
|
89
|
+
}
|
|
90
|
+
if (av !== '') {
|
|
91
|
+
let audiStatus = av;
|
|
92
|
+
eventValue = audiStatus;
|
|
93
|
+
audiStatus = audiStatus.toString().toLowerCase();
|
|
94
|
+
if (audiStatus === 'true')
|
|
95
|
+
eventValue = 'Audience Entered';
|
|
96
|
+
if (audiStatus === 'false')
|
|
97
|
+
eventValue = 'Audience Exited';
|
|
98
|
+
eventName = ak;
|
|
99
|
+
csvRows += `${email}, ${eventSource}, ${eventName}, ${eventValue}, ${timestamp}\n`;
|
|
100
|
+
}
|
|
101
|
+
for (const e in propertiesTraitsKV) {
|
|
102
|
+
const eventName = e;
|
|
103
|
+
const eventValue = propertiesTraitsKV[e];
|
|
104
|
+
csvRows += `${email}, ${eventSource}, ${eventName}, ${eventValue}, ${timestamp}\n`;
|
|
105
|
+
}
|
|
106
|
+
return csvRows;
|
|
107
|
+
}
|
|
108
|
+
exports.addUpdateEvents = addUpdateEvents;
|
|
109
|
+
//# sourceMappingURL=eventprocessing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventprocessing.js","sourceRoot":"","sources":["../../../../src/destinations/acoustic-s3tc/receiveEvents/eventprocessing.ts"],"names":[],"mappings":";;;;;;AACA,wDAAwD;AAExD,qDAA4B;AAE5B,SAAgB,aAAa,CAAC,OAAkC,EAAE,SAAiB;IACjF,MAAM,YAAY,GAA8B,EAAE,CAAA;IAClD,IAAI;QACF,IAAI,SAAS,GAAG,EAAE;YAChB,MAAM,IAAI,+BAAgB,CACxB,yGAAyG,EACzG,wBAAwB,EACxB,GAAG,CACJ,CAAA;QAEH,KAAK,MAAM,GAAG,I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AAE,CAAA;QAGd,OAAO,IAAI,GAAG,KAAK,KAAK,WAAW,KAAK,SAAS,KAAK,UAAU,KAAK,SAAS,IAAI,CAAA;KACnF;IAGD,KAAK,MAAM,CAAC,IAAI,kBAAkB,EAAE;QAClC,MAAM,SAAS,GAAG,CAAC,CAAA;QACnB,MAAM,UAAU,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAA;QAExC,OAAO,IAAI,GAAG,KAAK,KAAK,WAAW,KAAK,SAAS,KAAK,UAAU,KAAK,SAAS,IAAI,CAAA;KACnF;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AApGD,0CAoGC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
key_value_pairs?: {
|
|
3
|
+
[k: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
array_data?: {
|
|
6
|
+
[k: string]: unknown;
|
|
7
|
+
}[];
|
|
8
|
+
context?: {
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
properties?: {
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
traits?: {
|
|
15
|
+
[k: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
email: string;
|
|
18
|
+
type: string;
|
|
19
|
+
timestamp: string | number;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/acoustic-s3tc/receiveEvents/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
+
const eventprocessing_1 = require("./eventprocessing");
|
|
9
|
+
const s3_1 = __importDefault(require("../../../lib/AWS/s3"));
|
|
10
|
+
const preCheck_1 = require("./preCheck");
|
|
11
|
+
const action = {
|
|
12
|
+
title: 'Send Events',
|
|
13
|
+
description: 'Send Segment identify() and track() events to Acoustic Connect. At least one of the following optional fields should be populated: Key-Value pairs, Arrays, Context, Properties, Traits.',
|
|
14
|
+
fields: {
|
|
15
|
+
key_value_pairs: {
|
|
16
|
+
label: 'Key-Value pairs',
|
|
17
|
+
description: '(optional) Map simple Key-Value pairs',
|
|
18
|
+
type: 'object'
|
|
19
|
+
},
|
|
20
|
+
array_data: {
|
|
21
|
+
label: 'Arrays',
|
|
22
|
+
description: '(optional) If the data needed is in an array, use this section to Map Array data into useable attributes',
|
|
23
|
+
type: 'object',
|
|
24
|
+
multiple: true,
|
|
25
|
+
additionalProperties: true
|
|
26
|
+
},
|
|
27
|
+
context: {
|
|
28
|
+
label: 'Context',
|
|
29
|
+
description: '(optional) If the data is present in a Context section, use this to map the attributes of a Context Section',
|
|
30
|
+
type: 'object'
|
|
31
|
+
},
|
|
32
|
+
properties: {
|
|
33
|
+
label: 'Properties',
|
|
34
|
+
description: '(optional) If the data is present in a Properties section, use this to map the attributes of a Properties Section',
|
|
35
|
+
type: 'object'
|
|
36
|
+
},
|
|
37
|
+
traits: {
|
|
38
|
+
label: 'Traits',
|
|
39
|
+
description: '(optional) If the data is present in a Traits section, use this to map the attributes of a Traits Section',
|
|
40
|
+
type: 'object'
|
|
41
|
+
},
|
|
42
|
+
email: {
|
|
43
|
+
label: 'Email',
|
|
44
|
+
description: 'Do Not Modify - Email is required',
|
|
45
|
+
type: 'string',
|
|
46
|
+
format: 'email',
|
|
47
|
+
required: true,
|
|
48
|
+
default: {
|
|
49
|
+
'@if': {
|
|
50
|
+
exists: { '@path': '$.properties.email' },
|
|
51
|
+
then: { '@path': '$.properties.email' },
|
|
52
|
+
else: { '@path': '$.traits.email' }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
type: {
|
|
57
|
+
label: 'Type',
|
|
58
|
+
description: 'The type of event. e.g. track or identify. This field is required',
|
|
59
|
+
type: 'string',
|
|
60
|
+
required: true,
|
|
61
|
+
default: {
|
|
62
|
+
'@path': '$.type'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
timestamp: {
|
|
66
|
+
label: 'Timestamp',
|
|
67
|
+
description: 'The timestamp for when the event took place. This field is required',
|
|
68
|
+
type: 'datetime',
|
|
69
|
+
required: true,
|
|
70
|
+
default: {
|
|
71
|
+
'@path': '$.timestamp'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
perform: async (request, { settings, payload }) => {
|
|
76
|
+
const email = get_1.default(payload, 'email', '');
|
|
77
|
+
if (!email) {
|
|
78
|
+
throw new actions_core_1.IntegrationError('Email Not Found, invalid Event received.', 'INVALID_EVENT_HAS_NO_EMAIL', 400);
|
|
79
|
+
}
|
|
80
|
+
if (!payload.context && !payload.traits && !payload.properties)
|
|
81
|
+
throw new actions_core_1.IntegrationError('No mapped data provided, must use at least one of the mapping fields to define the data to be sent to Acoustic.', 'INVALID_NO_DATA_MAPPED', 400);
|
|
82
|
+
preCheck_1.validateSettings(settings);
|
|
83
|
+
const csvRows = eventprocessing_1.addUpdateEvents(payload, email);
|
|
84
|
+
const fileName = settings.fileNamePrefix + `${new Date().toISOString().replace(/(\.|-|:)/g, '_')}` + '.csv';
|
|
85
|
+
const method = 'PUT';
|
|
86
|
+
const opts = await s3_1.default(settings.s3_bucket, settings.s3_region, fileName, method, csvRows, settings.s3_access_key, settings.s3_secret);
|
|
87
|
+
if (!opts.headers || !opts.method || !opts.host || !opts.path) {
|
|
88
|
+
throw new actions_core_1.InvalidAuthenticationError('Unable to generate signature header for AWS S3 request.');
|
|
89
|
+
}
|
|
90
|
+
return await request(`https://${opts.host}/${opts.path}`, {
|
|
91
|
+
headers: opts.headers,
|
|
92
|
+
method,
|
|
93
|
+
body: opts.body
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
exports.default = action;
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/acoustic-s3tc/receiveEvents/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsG;AAGtG,qDAA4B;AAC5B,uDAAmD;AACnD,6DAA0D;AAC1D,yCAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,0LAA0L;IAC5L,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,0GAA0G;YAC5G,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,oBAAoB,EAAE,IAAI;SAC3B;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EACT,6GAA6G;YAC/G,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,mHAAmH;YACrH,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,2GAA2G;YAC7G,IAAI,EAAE,QAAQ;SACf;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,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,CAAC,SAAmB,EAC5B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,CAAC,aAAuB,EAChC,QAAQ,CAAC,SAAmB,CAC7B,CAAA;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAC7D,MAAM,IAAI,yCAA0B,CAAC,yDAAyD,CAAC,CAAA;SAChG;QAED,OAAO,MAAM,OAAO,CAAC,WAAW,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE;YACxD,OAAO,EAAE,IAAI,CAAC,OAAiC;YAC/C,MAAM;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AACD,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSettings = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
function validateSettings(settings) {
|
|
6
|
+
if (!settings.s3_access_key) {
|
|
7
|
+
throw new actions_core_1.IntegrationError('Missing S3 Access Key', 'MISSING_S3_ACCESS_KEY', 400);
|
|
8
|
+
}
|
|
9
|
+
if (!settings.s3_secret) {
|
|
10
|
+
throw new actions_core_1.IntegrationError('Missing S3 Secret.', 'MISSING_S3_SECRET', 400);
|
|
11
|
+
}
|
|
12
|
+
if (!settings.s3_region) {
|
|
13
|
+
throw new actions_core_1.IntegrationError('Missing S3 Region', 'MISSING_S3_REGION', 400);
|
|
14
|
+
}
|
|
15
|
+
if (!settings.s3_bucket) {
|
|
16
|
+
throw new actions_core_1.IntegrationError('Missing S3 Bucket.', 'MISSING_S3_BUCKET', 400);
|
|
17
|
+
}
|
|
18
|
+
if (!settings.fileNamePrefix) {
|
|
19
|
+
throw new actions_core_1.IntegrationError('Missing File Name Prefix', 'MISSING_FILE_NAME_PREFIX', 400);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.validateSettings = validateSettings;
|
|
23
|
+
//# sourceMappingURL=preCheck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preCheck.js","sourceRoot":"","sources":["../../../../src/destinations/acoustic-s3tc/receiveEvents/preCheck.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AAGxD,SAAS,gBAAgB,CAAC,QAAkB;IAC1C,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QAC3B,MAAM,IAAI,+BAAgB,CAAC,uBAAuB,EAAE,uBAAuB,EAAE,GAAG,CAAC,CAAA;KAClF;IAED,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE;QACvB,MAAM,IAAI,+BAAgB,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAA;KAC3E;IAED,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE;QACvB,MAAM,IAAI,+BAAgB,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAA;KAC1E;IAED,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE;QACvB,MAAM,IAAI,+BAAgB,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAA;KAC3E;IAED,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;QAC5B,MAAM,IAAI,+BAAgB,CAAC,0BAA0B,EAAE,0BAA0B,EAAE,GAAG,CAAC,CAAA;KACxF;AACH,CAAC;AAEQ,4CAAgB"}
|
|
@@ -8,6 +8,7 @@ const customEvents_1 = __importDefault(require("./customEvents"));
|
|
|
8
8
|
const setAttributes_1 = __importDefault(require("./setAttributes"));
|
|
9
9
|
const manageTags_1 = __importDefault(require("./manageTags"));
|
|
10
10
|
const utilities_1 = require("./utilities");
|
|
11
|
+
const registerAndAssociate_1 = __importDefault(require("./registerAndAssociate"));
|
|
11
12
|
const destination = {
|
|
12
13
|
name: 'Airship (Actions)',
|
|
13
14
|
slug: 'actions-airship',
|
|
@@ -58,17 +59,17 @@ const destination = {
|
|
|
58
59
|
presets: [
|
|
59
60
|
{
|
|
60
61
|
name: 'Custom Events',
|
|
62
|
+
type: 'automatic',
|
|
61
63
|
subscribe: 'type = "track"',
|
|
62
64
|
partnerAction: 'customEvents',
|
|
63
|
-
mapping: actions_core_1.defaultValues(customEvents_1.default.fields)
|
|
64
|
-
type: 'automatic'
|
|
65
|
+
mapping: actions_core_1.defaultValues(customEvents_1.default.fields)
|
|
65
66
|
},
|
|
66
67
|
{
|
|
67
68
|
name: 'Set Attributes',
|
|
69
|
+
type: 'automatic',
|
|
68
70
|
subscribe: 'type = "identify"',
|
|
69
71
|
partnerAction: 'setAttributes',
|
|
70
|
-
mapping: actions_core_1.defaultValues(setAttributes_1.default.fields)
|
|
71
|
-
type: 'automatic'
|
|
72
|
+
mapping: actions_core_1.defaultValues(setAttributes_1.default.fields)
|
|
72
73
|
}
|
|
73
74
|
],
|
|
74
75
|
onDelete: async (request, { settings, payload }) => {
|
|
@@ -93,7 +94,8 @@ const destination = {
|
|
|
93
94
|
actions: {
|
|
94
95
|
customEvents: customEvents_1.default,
|
|
95
96
|
setAttributes: setAttributes_1.default,
|
|
96
|
-
manageTags: manageTags_1.default
|
|
97
|
+
manageTags: manageTags_1.default,
|
|
98
|
+
registerAndAssociate: registerAndAssociate_1.default
|
|
97
99
|
}
|
|
98
100
|
};
|
|
99
101
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/airship/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAG5E,kEAAyC;AAEzC,oEAA2C;AAE3C,8DAAqC;AAErC,2CAA0C;AAE1C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,iBAAiB;IACvB,IAAI,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|
|
4
|
+
timezone?: string;
|
|
5
|
+
opt_in_choices?: string;
|
|
6
|
+
channel_object: {
|
|
7
|
+
address: string;
|
|
8
|
+
new_address?: string;
|
|
9
|
+
commercial_opted_in?: string;
|
|
10
|
+
commercial_opted_out?: string;
|
|
11
|
+
click_tracking_opted_in?: string;
|
|
12
|
+
click_tracking_opted_out?: string;
|
|
13
|
+
open_tracking_opted_in?: string;
|
|
14
|
+
open_tracking_opted_out?: string;
|
|
15
|
+
transactional_opted_in?: string;
|
|
16
|
+
transactional_opted_out?: string;
|
|
17
|
+
suppression_state?: string;
|
|
18
|
+
[k: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/airship/registerAndAssociate/generated-types.ts"],"names":[],"mappings":""}
|