@segment/action-destinations 3.216.0 → 3.217.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 +5 -5
- package/dist/destinations/acoustic-s3tc/index.js +22 -18
- package/dist/destinations/acoustic-s3tc/index.js.map +1 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js +30 -33
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js.map +1 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/index.js +9 -9
- package/dist/destinations/acoustic-s3tc/receiveEvents/index.js.map +1 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.js +3 -3
- package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.js.map +1 -1
- package/dist/destinations/algolia-insights/algolia-insight-api.d.ts +7 -1
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.d.ts +3 -0
- package/dist/destinations/algolia-insights/conversionEvents/index.js +14 -3
- package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/index.js +12 -2
- package/dist/destinations/algolia-insights/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productAddedEvents/generated-types.d.ts +10 -0
- package/dist/destinations/algolia-insights/productAddedEvents/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/productAddedEvents/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/productAddedEvents/index.d.ts +5 -0
- package/dist/destinations/algolia-insights/productAddedEvents/index.js +93 -0
- package/dist/destinations/algolia-insights/productAddedEvents/index.js.map +1 -0
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.d.ts +3 -0
- package/dist/destinations/algolia-insights/productClickedEvents/index.js +13 -2
- package/dist/destinations/algolia-insights/productClickedEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productListFilteredEvents/generated-types.d.ts +13 -0
- package/dist/destinations/algolia-insights/productListFilteredEvents/generated-types.js +3 -0
- package/dist/destinations/algolia-insights/productListFilteredEvents/generated-types.js.map +1 -0
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.d.ts +5 -0
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.js +101 -0
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.js.map +1 -0
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.d.ts +3 -0
- package/dist/destinations/algolia-insights/productViewedEvents/index.js +13 -2
- package/dist/destinations/algolia-insights/productViewedEvents/index.js.map +1 -1
- package/dist/destinations/attio/assertRecord/index.js +4 -5
- package/dist/destinations/attio/assertRecord/index.js.map +1 -1
- package/dist/destinations/attio/groupWorkspace/generated-types.d.ts +1 -1
- package/dist/destinations/attio/groupWorkspace/index.js +13 -14
- package/dist/destinations/attio/groupWorkspace/index.js.map +1 -1
- package/dist/destinations/attio/identifyUser/generated-types.d.ts +1 -0
- package/dist/destinations/attio/identifyUser/index.js +17 -8
- package/dist/destinations/attio/identifyUser/index.js.map +1 -1
- package/dist/destinations/devrev/mocks/index.d.ts +3 -0
- package/dist/destinations/devrev/mocks/index.js +4 -1
- package/dist/destinations/devrev/mocks/index.js.map +1 -1
- package/dist/destinations/devrev/streamEvent/generated-types.d.ts +3 -0
- package/dist/destinations/devrev/streamEvent/index.js +41 -2
- package/dist/destinations/devrev/streamEvent/index.js.map +1 -1
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +2 -0
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +1 -1
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +1 -3
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -1
- package/dist/destinations/engage/utils/EngageStats.js +4 -0
- package/dist/destinations/engage/utils/EngageStats.js.map +1 -1
- package/dist/destinations/engage/utils/MessageSendPerformer.js +4 -3
- package/dist/destinations/engage/utils/MessageSendPerformer.js.map +1 -1
- package/dist/destinations/facebook-conversions-api/fb-capi-properties.js +11 -1
- package/dist/destinations/facebook-conversions-api/fb-capi-properties.js.map +1 -1
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/iterable/trackEvent/index.js.map +1 -1
- package/dist/destinations/iterable/utils.js +1 -1
- package/dist/destinations/iterable/utils.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/sftp.d.ts +4 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/sftp.js +17 -2
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/sftp.js.map +1 -1
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js +1 -1
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js.map +1 -1
- package/dist/destinations/optimizely-data-platform/customEvent/generated-types.d.ts +16 -0
- package/dist/destinations/optimizely-data-platform/customEvent/generated-types.js +3 -0
- package/dist/destinations/optimizely-data-platform/customEvent/generated-types.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/customEvent/index.d.ts +5 -0
- package/dist/destinations/optimizely-data-platform/customEvent/index.js +33 -0
- package/dist/destinations/optimizely-data-platform/customEvent/index.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/emailEvent/generated-types.d.ts +13 -0
- package/dist/destinations/optimizely-data-platform/emailEvent/generated-types.js +3 -0
- package/dist/destinations/optimizely-data-platform/emailEvent/generated-types.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/emailEvent/index.d.ts +5 -0
- package/dist/destinations/optimizely-data-platform/emailEvent/index.js +55 -0
- package/dist/destinations/optimizely-data-platform/emailEvent/index.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/fields.d.ts +8 -0
- package/dist/destinations/optimizely-data-platform/fields.js +148 -0
- package/dist/destinations/optimizely-data-platform/fields.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/generated-types.d.ts +4 -0
- package/dist/destinations/optimizely-data-platform/generated-types.js +3 -0
- package/dist/destinations/optimizely-data-platform/generated-types.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/index.d.ts +4 -0
- package/dist/destinations/optimizely-data-platform/index.js +155 -0
- package/dist/destinations/optimizely-data-platform/index.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/upsertContact/generated-types.d.ts +25 -0
- package/dist/destinations/optimizely-data-platform/upsertContact/generated-types.js +3 -0
- package/dist/destinations/optimizely-data-platform/upsertContact/generated-types.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/upsertContact/index.d.ts +5 -0
- package/dist/destinations/optimizely-data-platform/upsertContact/index.js +134 -0
- package/dist/destinations/optimizely-data-platform/upsertContact/index.js.map +1 -0
- package/dist/destinations/optimizely-data-platform/utils.d.ts +3 -0
- package/dist/destinations/optimizely-data-platform/utils.js +9 -0
- package/dist/destinations/optimizely-data-platform/utils.js.map +1 -0
- package/dist/destinations/segment-profiles/errors.d.ts +10 -10
- package/dist/destinations/segment-profiles/errors.js +11 -11
- package/dist/destinations/segment-profiles/errors.js.map +1 -1
- package/dist/destinations/segment-profiles/segment-properties.d.ts +0 -10
- package/dist/destinations/segment-profiles/segment-properties.js +1 -58
- package/dist/destinations/segment-profiles/segment-properties.js.map +1 -1
- package/dist/destinations/segment-profiles/sendSubscription/index.js +162 -137
- package/dist/destinations/segment-profiles/sendSubscription/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendSubscription/subscription-properties.d.ts +15 -0
- package/dist/destinations/segment-profiles/sendSubscription/subscription-properties.js +85 -0
- package/dist/destinations/segment-profiles/sendSubscription/subscription-properties.js.map +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/index.test.js +40 -1
- package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/generated-types.d.ts +6 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +2 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +2 -0
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js +81 -12
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -1
- package/dist/destinations/the-trade-desk-crm/index.js +12 -8
- package/dist/destinations/the-trade-desk-crm/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface Settings {
|
|
2
|
-
fileNamePrefix
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
s3_region
|
|
2
|
+
fileNamePrefix: string;
|
|
3
|
+
s3_bucket_accesspoint_alias: string;
|
|
4
|
+
s3_access_key: string;
|
|
5
|
+
s3_secret: string;
|
|
6
|
+
s3_region: string;
|
|
7
7
|
version?: string;
|
|
8
8
|
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
7
|
const index_1 = __importDefault(require("./receiveEvents/index"));
|
|
8
8
|
const mod = `
|
|
9
|
-
Last-Modified:
|
|
9
|
+
Last-Modified: 09.19.2023 10.30.43
|
|
10
10
|
`;
|
|
11
11
|
const presets = [
|
|
12
12
|
{
|
|
@@ -46,43 +46,47 @@ const destination = {
|
|
|
46
46
|
name: 'Acoustic (Actions)',
|
|
47
47
|
slug: 'actions-acoustic',
|
|
48
48
|
mode: 'cloud',
|
|
49
|
-
description: '
|
|
49
|
+
description: 'Acoustic (S3TC) - Provide Segment Track and Identify Event Data to Acoustic Connect',
|
|
50
50
|
authentication: {
|
|
51
51
|
scheme: 'custom',
|
|
52
52
|
fields: {
|
|
53
53
|
fileNamePrefix: {
|
|
54
|
-
label: '
|
|
55
|
-
description:
|
|
54
|
+
label: 'Customer Prefix',
|
|
55
|
+
description: 'Use your Acoustic Org name but replace any spaces with an underscore, eg., AcmeCustomer_Prod',
|
|
56
56
|
type: 'string',
|
|
57
|
-
required:
|
|
57
|
+
required: true,
|
|
58
58
|
default: 'customer_org_'
|
|
59
59
|
},
|
|
60
|
+
s3_bucket_accesspoint_alias: {
|
|
61
|
+
label: 'S3 Bucket Access Point Alias',
|
|
62
|
+
description: 'The Alias of the Access Point created for your access to the S3 Bucket.',
|
|
63
|
+
default: '',
|
|
64
|
+
type: 'string',
|
|
65
|
+
required: true
|
|
66
|
+
},
|
|
60
67
|
s3_access_key: {
|
|
61
68
|
label: 'S3 Access Key',
|
|
62
|
-
description: '
|
|
63
|
-
type: 'string'
|
|
69
|
+
description: 'S3 Access Key for the S3 bucket.',
|
|
70
|
+
type: 'string',
|
|
71
|
+
required: true
|
|
64
72
|
},
|
|
65
73
|
s3_secret: {
|
|
66
74
|
label: 'S3 Secret',
|
|
67
|
-
description: '
|
|
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
|
+
description: 'S3 Secret credential for the S3 bucket.',
|
|
76
|
+
type: 'password',
|
|
77
|
+
required: true
|
|
75
78
|
},
|
|
76
79
|
s3_region: {
|
|
77
80
|
label: 'S3 Region',
|
|
78
|
-
description: '
|
|
81
|
+
description: 'Should always be us-east-1 unless directed by Acoustic otherwise. ',
|
|
79
82
|
default: 'us-east-1',
|
|
80
|
-
type: 'string'
|
|
83
|
+
type: 'string',
|
|
84
|
+
required: true
|
|
81
85
|
},
|
|
82
86
|
version: {
|
|
83
87
|
label: `Version:`,
|
|
84
88
|
description: `\n${mod}\n`,
|
|
85
|
-
default: 'Version
|
|
89
|
+
default: 'Version 2.3',
|
|
86
90
|
type: 'string',
|
|
87
91
|
required: false
|
|
88
92
|
}
|
|
@@ -1 +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,
|
|
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;QA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eAAe;gBACtB,WAAW,EAAE,kCAAkC;gBAC/C,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,yCAAyC;gBACtD,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,oEAAoE;gBACjF,OAAO,EAAE,WAAW;gBACpB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;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"}
|
|
@@ -8,9 +8,11 @@ const actions_core_1 = require("@segment/actions-core");
|
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
function parseSections(section, nestDepth) {
|
|
10
10
|
const parseResults = {};
|
|
11
|
+
if (nestDepth > 10)
|
|
12
|
+
throw new actions_core_1.IntegrationError('Event data exceeds nesting depth. Use Mapping to flatten the data to no more than 3 levels deep', 'NESTING_DEPTH_EXCEEDED', 400);
|
|
11
13
|
try {
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
+
if (section === null)
|
|
15
|
+
section = { null: '' };
|
|
14
16
|
for (const key of Object.keys(section)) {
|
|
15
17
|
if (typeof section[key] === 'object') {
|
|
16
18
|
nestDepth++;
|
|
@@ -33,40 +35,35 @@ exports.parseSections = parseSections;
|
|
|
33
35
|
function addUpdateEvents(payload, email) {
|
|
34
36
|
let eventName = '';
|
|
35
37
|
let eventValue = '';
|
|
36
|
-
let csvRows = 'EMAIL, EventSource, EventName, EventValue,
|
|
38
|
+
let csvRows = 'EMAIL, EventSource, EventName, EventValue, EventTimestamp\n';
|
|
37
39
|
const eventSource = get_1.default(payload, 'type', 'Null') + ' Event';
|
|
38
40
|
const timestamp = get_1.default(payload, 'timestamp', 'Null');
|
|
39
41
|
let propertiesTraitsKV = {};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
propertiesTraitsKV
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
propertiesTraitsKV
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
propertiesTraitsKV
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
propertiesTraitsKV
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
propertiesTraitsKV
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
throw new actions_core_1.IntegrationError('Unexpected Exception processing payload \n ${e}', 'UNEXPECTED_EXCEPTION_PROCESSING_PAYLOAD', 400);
|
|
69
|
-
}
|
|
42
|
+
if (payload.key_value_pairs)
|
|
43
|
+
propertiesTraitsKV = {
|
|
44
|
+
...propertiesTraitsKV,
|
|
45
|
+
...parseSections(payload.key_value_pairs, 0)
|
|
46
|
+
};
|
|
47
|
+
if (payload.array_data)
|
|
48
|
+
propertiesTraitsKV = {
|
|
49
|
+
...propertiesTraitsKV,
|
|
50
|
+
...parseSections(payload.array_data, 0)
|
|
51
|
+
};
|
|
52
|
+
if (payload.traits)
|
|
53
|
+
propertiesTraitsKV = {
|
|
54
|
+
...propertiesTraitsKV,
|
|
55
|
+
...parseSections(payload.traits, 0)
|
|
56
|
+
};
|
|
57
|
+
if (payload.properties)
|
|
58
|
+
propertiesTraitsKV = {
|
|
59
|
+
...propertiesTraitsKV,
|
|
60
|
+
...parseSections(payload.properties, 0)
|
|
61
|
+
};
|
|
62
|
+
if (payload.context)
|
|
63
|
+
propertiesTraitsKV = {
|
|
64
|
+
...propertiesTraitsKV,
|
|
65
|
+
...parseSections(payload.context, 0)
|
|
66
|
+
};
|
|
70
67
|
let ak = '';
|
|
71
68
|
let av = '';
|
|
72
69
|
const getValue = (o, part) => Object.entries(o).find(([k, _v]) => k.includes(part))?.[1];
|
|
@@ -1 +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;
|
|
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;IAElD,IAAI,SAAS,GAAG,EAAE;QAChB,MAAM,IAAI,+BAAgB,CACxB,iGAAiG,EACjG,wBAAwB,EACxB,GAAG,CACJ,CAAA;IAEH,IAAI;QACF,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;QAE5C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YACtC,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;gBACpC,SAAS,EAAE,CAAA;gBACX,MAAM,MAAM,GAA8B,aAAa,CACrD,OAAO,CAAC,GAAG,CAAoC,EAC/C,SAAS,CACV,CAAA;gBACD,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE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
|
|
14
14
|
fields: {
|
|
15
15
|
key_value_pairs: {
|
|
16
16
|
label: 'Key-Value pairs',
|
|
17
|
-
description: '
|
|
17
|
+
description: 'Map simple Key-Value pairs (optional) ',
|
|
18
18
|
type: 'object'
|
|
19
19
|
},
|
|
20
20
|
array_data: {
|
|
21
21
|
label: 'Arrays',
|
|
22
|
-
description: '
|
|
22
|
+
description: 'If the data needed is in an array, use this section to Map Array data into useable attributes (optional) ',
|
|
23
23
|
type: 'object',
|
|
24
24
|
multiple: true,
|
|
25
25
|
additionalProperties: true
|
|
26
26
|
},
|
|
27
27
|
context: {
|
|
28
28
|
label: 'Context',
|
|
29
|
-
description: '
|
|
29
|
+
description: 'If the data is present in a Context section, use this to map the attributes of a Context Section (optional)',
|
|
30
30
|
type: 'object'
|
|
31
31
|
},
|
|
32
32
|
properties: {
|
|
33
33
|
label: 'Properties',
|
|
34
|
-
description: '
|
|
34
|
+
description: 'If the data is present in a Properties section, use this to map the attributes of a Properties Section (optional) ',
|
|
35
35
|
type: 'object'
|
|
36
36
|
},
|
|
37
37
|
traits: {
|
|
38
38
|
label: 'Traits',
|
|
39
|
-
description: '
|
|
39
|
+
description: 'If the data is present in a Traits section, use this to map the attributes of a Traits Section (optional) ',
|
|
40
40
|
type: 'object'
|
|
41
41
|
},
|
|
42
42
|
email: {
|
|
@@ -55,7 +55,7 @@ const action = {
|
|
|
55
55
|
},
|
|
56
56
|
type: {
|
|
57
57
|
label: 'Type',
|
|
58
|
-
description: 'The type of event. e.g. track or identify
|
|
58
|
+
description: 'Do Not Modify - The type of event. e.g. track or identify, this field is required',
|
|
59
59
|
type: 'string',
|
|
60
60
|
required: true,
|
|
61
61
|
default: {
|
|
@@ -64,7 +64,7 @@ const action = {
|
|
|
64
64
|
},
|
|
65
65
|
timestamp: {
|
|
66
66
|
label: 'Timestamp',
|
|
67
|
-
description: 'The timestamp for when the event took place. This field is required',
|
|
67
|
+
description: 'Do Not Modify - The timestamp for when the event took place. This field is required',
|
|
68
68
|
type: 'datetime',
|
|
69
69
|
required: true,
|
|
70
70
|
default: {
|
|
@@ -83,9 +83,9 @@ const action = {
|
|
|
83
83
|
const csvRows = eventprocessing_1.addUpdateEvents(payload, email);
|
|
84
84
|
const fileName = settings.fileNamePrefix + `${new Date().toISOString().replace(/(\.|-|:)/g, '_')}` + '.csv';
|
|
85
85
|
const method = 'PUT';
|
|
86
|
-
const opts = await s3_1.default(settings.
|
|
86
|
+
const opts = await s3_1.default(settings.s3_bucket_accesspoint_alias, settings.s3_region, fileName, method, csvRows, settings.s3_access_key, settings.s3_secret);
|
|
87
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.');
|
|
88
|
+
throw new actions_core_1.InvalidAuthenticationError('Unable to generate correct signature header for AWS S3 Put request.');
|
|
89
89
|
}
|
|
90
90
|
return await request(`https://${opts.host}/${opts.path}`, {
|
|
91
91
|
headers: opts.headers,
|
|
@@ -1 +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,
|
|
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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,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"}
|
|
@@ -12,11 +12,11 @@ function validateSettings(settings) {
|
|
|
12
12
|
if (!settings.s3_region) {
|
|
13
13
|
throw new actions_core_1.IntegrationError('Missing S3 Region', 'MISSING_S3_REGION', 400);
|
|
14
14
|
}
|
|
15
|
-
if (!settings.
|
|
16
|
-
throw new actions_core_1.IntegrationError('Missing S3 Bucket.', '
|
|
15
|
+
if (!settings.s3_bucket_accesspoint_alias) {
|
|
16
|
+
throw new actions_core_1.IntegrationError('Missing S3 Bucket Access Point.', 'MISSING_S3_BUCKET_ACCESS_POINT', 400);
|
|
17
17
|
}
|
|
18
18
|
if (!settings.fileNamePrefix) {
|
|
19
|
-
throw new actions_core_1.IntegrationError('Missing
|
|
19
|
+
throw new actions_core_1.IntegrationError('Missing Customer Prefix', 'MISSING_CUSTOMER_PREFIX', 400);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.validateSettings = validateSettings;
|
|
@@ -1 +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,
|
|
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,2BAA2B,EAAE;QACzC,MAAM,IAAI,+BAAgB,CAAC,iCAAiC,EAAE,gCAAgC,EAAE,GAAG,CAAC,CAAA;KACrG;IAED,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;QAC5B,MAAM,IAAI,+BAAgB,CAAC,yBAAyB,EAAE,yBAAyB,EAAE,GAAG,CAAC,CAAA;KACtF;AACH,CAAC;AAEQ,4CAAgB"}
|
|
@@ -6,19 +6,25 @@ declare type EventCommon = {
|
|
|
6
6
|
eventName: string;
|
|
7
7
|
index: string;
|
|
8
8
|
userToken: string;
|
|
9
|
-
objectIDs: string[];
|
|
10
9
|
timestamp?: number;
|
|
11
10
|
queryID?: string;
|
|
12
11
|
};
|
|
13
12
|
export declare type AlgoliaProductViewedEvent = EventCommon & {
|
|
14
13
|
eventType: 'view';
|
|
14
|
+
objectIDs: string[];
|
|
15
15
|
};
|
|
16
16
|
export declare type AlgoliaProductClickedEvent = EventCommon & {
|
|
17
17
|
eventType: 'click';
|
|
18
18
|
positions?: number[];
|
|
19
|
+
objectIDs: string[];
|
|
20
|
+
};
|
|
21
|
+
export declare type AlgoliaFilterClickedEvent = EventCommon & {
|
|
22
|
+
eventType: 'click';
|
|
23
|
+
filters: string[];
|
|
19
24
|
};
|
|
20
25
|
export declare type AlgoliaConversionEvent = EventCommon & {
|
|
21
26
|
eventType: 'conversion';
|
|
27
|
+
objectIDs: string[];
|
|
22
28
|
};
|
|
23
29
|
export declare type AlgoliaApiPermissions = {
|
|
24
30
|
acl: string[];
|
|
@@ -5,11 +5,11 @@ const actions_core_1 = require("@segment/actions-core");
|
|
|
5
5
|
const algolia_insight_api_1 = require("../algolia-insight-api");
|
|
6
6
|
exports.conversionEvents = {
|
|
7
7
|
title: 'Conversion Events',
|
|
8
|
-
description: '
|
|
8
|
+
description: 'In ecommerce, conversions are purchase events often but not always involving multiple products. Outside of a conversion can be any positive signal associated with an index record. Query ID is optional and indicates that the view events is the result of a search query.',
|
|
9
9
|
fields: {
|
|
10
10
|
products: {
|
|
11
11
|
label: 'Product Details',
|
|
12
|
-
description: 'An array of objects representing the purchased items. Each object must contains a product_id field.',
|
|
12
|
+
description: 'Populates the ObjectIds field in the Algolia Insights API. An array of objects representing the purchased items. Each object must contains a product_id field.',
|
|
13
13
|
type: 'object',
|
|
14
14
|
multiple: true,
|
|
15
15
|
properties: { product_id: { label: 'product_id', type: 'string', required: true } },
|
|
@@ -55,14 +55,25 @@ exports.conversionEvents = {
|
|
|
55
55
|
description: 'The timestamp of the event.',
|
|
56
56
|
label: 'timestamp',
|
|
57
57
|
default: { '@path': '$.timestamp' }
|
|
58
|
+
},
|
|
59
|
+
extraProperties: {
|
|
60
|
+
label: 'extraProperties',
|
|
61
|
+
required: false,
|
|
62
|
+
description: 'Additional fields for this event. This field may be useful for Algolia Insights fields which are not mapped in Segment.',
|
|
63
|
+
type: 'object',
|
|
64
|
+
default: {
|
|
65
|
+
'@path': '$.properties'
|
|
66
|
+
}
|
|
58
67
|
}
|
|
59
68
|
},
|
|
60
69
|
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
61
70
|
perform: (request, data) => {
|
|
62
71
|
const insightEvent = {
|
|
63
|
-
...data.payload,
|
|
72
|
+
...data.payload.extraProperties,
|
|
64
73
|
eventName: 'Conversion Event',
|
|
65
74
|
eventType: 'conversion',
|
|
75
|
+
index: data.payload.index,
|
|
76
|
+
queryID: data.payload.queryID,
|
|
66
77
|
objectIDs: data.payload.products.map((product) => product.product_id),
|
|
67
78
|
userToken: data.payload.userToken,
|
|
68
79
|
timestamp: data.payload.timestamp ? new Date(data.payload.timestamp).valueOf() : undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/algolia-insights/conversionEvents/index.ts"],"names":[],"mappings":";;;AACA,wDAAqD;AACrD,gEAAoF;AAIvE,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,mBAAmB;IAC1B,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/algolia-insights/conversionEvents/index.ts"],"names":[],"mappings":";;;AACA,wDAAqD;AACrD,gEAAoF;AAIvE,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACT,8QAA8Q;IAChR,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,gKAAgK;YAClK,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;YACnF,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAA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,OAAO,CAAC,OAAO;YAC7B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;YACrE,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;SAC3F,CAAA;QACD,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,CAAA;QAEjD,OAAO,OAAO,CAAC,yCAAmB,EAAE;YAClC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAGY,QAAA,iBAAiB,GAAW;IACvC,IAAI,EAAE,mCAAmC;IACzC,SAAS,EAAE,wBAAgB,CAAC,mBAA6B;IACzD,aAAa,EAAE,kBAAkB;IACjC,OAAO,EAAE,4BAAa,CAAC,wBAAgB,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,WAAW;CAClB,CAAA"}
|
|
@@ -5,6 +5,8 @@ const productClickedEvents_1 = require("./productClickedEvents");
|
|
|
5
5
|
const conversionEvents_1 = require("./conversionEvents");
|
|
6
6
|
const productViewedEvents_1 = require("./productViewedEvents");
|
|
7
7
|
const algolia_insight_api_1 = require("./algolia-insight-api");
|
|
8
|
+
const productAddedEvents_1 = require("./productAddedEvents");
|
|
9
|
+
const productListFilteredEvents_1 = require("./productListFilteredEvents");
|
|
8
10
|
exports.ALGOLIA_INSIGHTS_USER_AGENT = 'algolia-segment-action-destination: 0.1';
|
|
9
11
|
const destination = {
|
|
10
12
|
name: 'Algolia Insights (Actions)',
|
|
@@ -43,11 +45,19 @@ const destination = {
|
|
|
43
45
|
}
|
|
44
46
|
};
|
|
45
47
|
},
|
|
46
|
-
presets: [
|
|
48
|
+
presets: [
|
|
49
|
+
productClickedEvents_1.productClickPresets,
|
|
50
|
+
conversionEvents_1.conversionPresets,
|
|
51
|
+
productViewedEvents_1.productViewedPresets,
|
|
52
|
+
productAddedEvents_1.productAddedPresets,
|
|
53
|
+
productListFilteredEvents_1.productListFilteredPresets
|
|
54
|
+
],
|
|
47
55
|
actions: {
|
|
48
56
|
productClickedEvents: productClickedEvents_1.productClickedEvents,
|
|
49
57
|
conversionEvents: conversionEvents_1.conversionEvents,
|
|
50
|
-
productViewedEvents: productViewedEvents_1.productViewedEvents
|
|
58
|
+
productViewedEvents: productViewedEvents_1.productViewedEvents,
|
|
59
|
+
productAddedEvents: productAddedEvents_1.productAddedEvents,
|
|
60
|
+
productListFilteredEvents: productListFilteredEvents_1.productListFilteredEvents
|
|
51
61
|
}
|
|
52
62
|
};
|
|
53
63
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/algolia-insights/index.ts"],"names":[],"mappings":";;;AAGA,iEAAkF;AAElF,yDAAwE;AAExE,+DAAiF;AACjF,+DAAuF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/algolia-insights/index.ts"],"names":[],"mappings":";;;AAGA,iEAAkF;AAElF,yDAAwE;AAExE,+DAAiF;AACjF,+DAAuF;AAEvF,6DAA8E;AAE9E,2EAAmG;AAEtF,QAAA,2BAA2B,GAAG,yCAAyC,CAAA;AAEpF,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,8BAA8B;gBAC3C,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,oEAAoE;gBACjF,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAwB,8CAAwB,CAAC,QAAQ,CAAC,CAAC,CAAA;YAEzF,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC9C,OAAO,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAA;aAClD;YAED,OAAO,QAAQ,CAAA;QACjB,CAAC;KACF;IAED,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP,0BAA0B,EAAE,QAAQ,CAAC,KAAK;gBAC1C,mBAAmB,EAAE,QAAQ,CAAC,MAAM;gBACpC,iBAAiB,EAAE,mCAA2B;aAC/C;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,0CAAmB;QACnB,oCAAiB;QACjB,0CAAoB;QACpB,wCAAmB;QACnB,sDAA0B;KAC3B;IACD,OAAO,EAAE;QACP,oBAAoB,EAApB,2CAAoB;QACpB,gBAAgB,EAAhB,mCAAgB;QAChB,mBAAmB,EAAnB,yCAAmB;QACnB,kBAAkB,EAAlB,uCAAkB;QAClB,yBAAyB,EAAzB,qDAAyB;KAC1B;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/algolia-insights/productAddedEvents/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ActionDefinition, Preset } from '@segment/actions-core';
|
|
2
|
+
import type { Settings } from '../generated-types';
|
|
3
|
+
import type { Payload } from './generated-types';
|
|
4
|
+
export declare const productAddedEvents: ActionDefinition<Settings, Payload>;
|
|
5
|
+
export declare const productAddedPresets: Preset;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productAddedPresets = exports.productAddedEvents = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const algolia_insight_api_1 = require("../algolia-insight-api");
|
|
6
|
+
exports.productAddedEvents = {
|
|
7
|
+
title: 'Product Added Events',
|
|
8
|
+
description: 'Product added events for ecommerce use cases for a customer adding an item to their cart. Query ID is optional and indicates that the event was the result of a search query.',
|
|
9
|
+
fields: {
|
|
10
|
+
product: {
|
|
11
|
+
label: 'Product ID',
|
|
12
|
+
description: 'Populates the ObjectIds field in the Algolia Insights API with a single ObjectId (productId) of the product added.',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true,
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.properties.product_id'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
index: {
|
|
20
|
+
label: 'Index',
|
|
21
|
+
description: 'Name of the targeted search index.',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: true,
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.properties.search_index'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
queryID: {
|
|
29
|
+
label: 'Query ID',
|
|
30
|
+
description: 'Query ID of the list on which the item was purchased.',
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: false,
|
|
33
|
+
default: {
|
|
34
|
+
'@path': '$.properties.query_id'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
userToken: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
required: true,
|
|
40
|
+
description: 'The ID associated with the user.',
|
|
41
|
+
label: 'userToken',
|
|
42
|
+
default: {
|
|
43
|
+
'@if': {
|
|
44
|
+
exists: { '@path': '$.userId' },
|
|
45
|
+
then: { '@path': '$.userId' },
|
|
46
|
+
else: { '@path': '$.anonymousId' }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
timestamp: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
required: false,
|
|
53
|
+
description: 'The timestamp of the event.',
|
|
54
|
+
label: 'timestamp',
|
|
55
|
+
default: { '@path': '$.timestamp' }
|
|
56
|
+
},
|
|
57
|
+
extraProperties: {
|
|
58
|
+
label: 'extraProperties',
|
|
59
|
+
required: false,
|
|
60
|
+
description: 'Additional fields for this event. This field may be useful for Algolia Insights fields which are not mapped in Segment.',
|
|
61
|
+
type: 'object',
|
|
62
|
+
default: {
|
|
63
|
+
'@path': '$.properties'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
defaultSubscription: 'type = "track" and event = "Product Added"',
|
|
68
|
+
perform: (request, data) => {
|
|
69
|
+
const insightEvent = {
|
|
70
|
+
...data.payload.extraProperties,
|
|
71
|
+
eventName: 'Add to cart',
|
|
72
|
+
eventType: 'conversion',
|
|
73
|
+
index: data.payload.index,
|
|
74
|
+
queryID: data.payload.queryID,
|
|
75
|
+
objectIDs: [data.payload.product],
|
|
76
|
+
userToken: data.payload.userToken,
|
|
77
|
+
timestamp: data.payload.timestamp ? new Date(data.payload.timestamp).valueOf() : undefined
|
|
78
|
+
};
|
|
79
|
+
const insightPayload = { events: [insightEvent] };
|
|
80
|
+
return request(algolia_insight_api_1.AlgoliaBehaviourURL, {
|
|
81
|
+
method: 'post',
|
|
82
|
+
json: insightPayload
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports.productAddedPresets = {
|
|
87
|
+
name: 'Send product added events to Algolia',
|
|
88
|
+
subscribe: exports.productAddedEvents.defaultSubscription,
|
|
89
|
+
partnerAction: 'productAddedEvents',
|
|
90
|
+
mapping: actions_core_1.defaultValues(exports.productAddedEvents.fields),
|
|
91
|
+
type: 'automatic'
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/algolia-insights/productAddedEvents/index.ts"],"names":[],"mappings":";;;AACA,wDAAqD;AAGrD,gEAAoF;AAEvE,QAAA,kBAAkB,GAAwC;IACrE,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,+KAA+K;IACjL,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,oHAAoH;YACtH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,oCAAoC;YACjD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,2BAA2B;aACrC;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,uDAAuD;YACpE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kCAAkC;YAC/C,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAA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AkB,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,WAAW;CAClB,CAAA"}
|
|
@@ -9,7 +9,7 @@ exports.productClickedEvents = {
|
|
|
9
9
|
fields: {
|
|
10
10
|
objectID: {
|
|
11
11
|
label: 'Product ID',
|
|
12
|
-
description: 'Product ID of the clicked item.',
|
|
12
|
+
description: 'Populates the ObjectIds field in the Algolia Insights API. Product ID of the clicked item.',
|
|
13
13
|
type: 'string',
|
|
14
14
|
required: true,
|
|
15
15
|
default: {
|
|
@@ -62,14 +62,25 @@ exports.productClickedEvents = {
|
|
|
62
62
|
description: 'The timestamp of the event.',
|
|
63
63
|
label: 'timestamp',
|
|
64
64
|
default: { '@path': '$.timestamp' }
|
|
65
|
+
},
|
|
66
|
+
extraProperties: {
|
|
67
|
+
label: 'extraProperties',
|
|
68
|
+
required: false,
|
|
69
|
+
description: 'Additional fields for this event. This field may be useful for Algolia Insights fields which are not mapped in Segment.',
|
|
70
|
+
type: 'object',
|
|
71
|
+
default: {
|
|
72
|
+
'@path': '$.properties'
|
|
73
|
+
}
|
|
65
74
|
}
|
|
66
75
|
},
|
|
67
76
|
defaultSubscription: 'type = "track" and event = "Product Clicked"',
|
|
68
77
|
perform: (request, data) => {
|
|
69
78
|
const insightEvent = {
|
|
70
|
-
...data.payload,
|
|
79
|
+
...data.payload.extraProperties,
|
|
71
80
|
eventName: 'Product Clicked',
|
|
72
81
|
eventType: 'click',
|
|
82
|
+
index: data.payload.index,
|
|
83
|
+
queryID: data.payload.queryID,
|
|
73
84
|
objectIDs: [data.payload.objectID],
|
|
74
85
|
userToken: data.payload.userToken,
|
|
75
86
|
positions: data.payload.position ? [data.payload.position] : undefined,
|