@segment/action-destinations 3.421.1-staging-fb8bbedd8.0 → 3.421.1-staging-fb3b476c7.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/index.js +2 -3
- package/dist/destinations/acoustic-s3tc/index.js.map +1 -1
- package/dist/destinations/adobe-target/index.js +1 -2
- package/dist/destinations/adobe-target/index.js.map +1 -1
- package/dist/destinations/algolia-insights/conversionEvents/index.d.ts +0 -1
- package/dist/destinations/algolia-insights/conversionEvents/index.js +137 -145
- package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/index.js +1 -1
- package/dist/destinations/algolia-insights/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productAddedEvents/generated-types.d.ts +1 -0
- package/dist/destinations/algolia-insights/productAddedEvents/index.d.ts +2 -0
- package/dist/destinations/algolia-insights/productAddedEvents/index.js +19 -3
- package/dist/destinations/algolia-insights/productAddedEvents/index.js.map +1 -1
- package/dist/destinations/attentive/functions.js +0 -3
- package/dist/destinations/attentive/functions.js.map +1 -1
- package/dist/destinations/criteo-audiences/index.js +2 -3
- package/dist/destinations/criteo-audiences/index.js.map +1 -1
- package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/_tests_/index.test.d.ts +4 -0
- package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/_tests_/index.test.js +79 -0
- package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/_tests_/index.test.js.map +1 -0
- package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/generated-types.d.ts +3 -3
- package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/index.js +7 -7
- package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/index.js.map +1 -1
- package/dist/destinations/first-party-dv360/functions.d.ts +1 -1
- package/dist/destinations/first-party-dv360/functions.js +9 -21
- package/dist/destinations/first-party-dv360/functions.js.map +1 -1
- package/dist/destinations/first-party-dv360/properties.js.map +1 -1
- package/dist/destinations/first-party-dv360/removeFromAudMobileDeviceId/generated-types.d.ts +3 -3
- package/dist/destinations/first-party-dv360/removeFromAudMobileDeviceId/index.js +7 -7
- package/dist/destinations/first-party-dv360/removeFromAudMobileDeviceId/index.js.map +1 -1
- package/dist/destinations/friendbuy/index.js +2 -3
- package/dist/destinations/friendbuy/index.js.map +1 -1
- package/dist/destinations/kafka/index.js +2 -3
- package/dist/destinations/kafka/index.js.map +1 -1
- package/dist/destinations/kafka/utils.js +8 -2
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/koala/index.js +2 -3
- package/dist/destinations/koala/index.js.map +1 -1
- package/dist/destinations/metronome/index.js +2 -3
- package/dist/destinations/metronome/index.js.map +1 -1
- package/dist/destinations/moengage/index.js +2 -3
- package/dist/destinations/moengage/index.js.map +1 -1
- package/dist/destinations/pipedrive/index.js +2 -3
- package/dist/destinations/pipedrive/index.js.map +1 -1
- package/dist/destinations/qualtrics/index.js +2 -3
- package/dist/destinations/qualtrics/index.js.map +1 -1
- package/dist/destinations/reddit-conversions-api/index.js +2 -3
- package/dist/destinations/reddit-conversions-api/index.js.map +1 -1
- package/dist/destinations/salesforce/index.js +1 -2
- package/dist/destinations/salesforce/index.js.map +1 -1
- package/dist/destinations/taboola-actions/index.js +2 -3
- package/dist/destinations/taboola-actions/index.js.map +1 -1
- package/dist/destinations/the-trade-desk-crm/index.js +2 -3
- package/dist/destinations/the-trade-desk-crm/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions/index.js +1 -1
- package/dist/destinations/tiktok-conversions/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/index.js +2 -3
- package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
- package/dist/destinations/vibe-audience/constants.d.ts +2 -0
- package/dist/destinations/vibe-audience/constants.js +6 -0
- package/dist/destinations/vibe-audience/constants.js.map +1 -0
- package/dist/destinations/vibe-audience/functions.d.ts +4 -0
- package/dist/destinations/vibe-audience/functions.js +31 -0
- package/dist/destinations/vibe-audience/functions.js.map +1 -0
- package/dist/destinations/vibe-audience/generated-types.d.ts +4 -0
- package/dist/destinations/vibe-audience/generated-types.js +3 -0
- package/dist/destinations/vibe-audience/generated-types.js.map +1 -0
- package/dist/destinations/vibe-audience/index.d.ts +4 -0
- package/dist/destinations/vibe-audience/index.js +49 -0
- package/dist/destinations/vibe-audience/index.js.map +1 -0
- package/dist/destinations/vibe-audience/sync/generated-types.d.ts +16 -0
- package/dist/destinations/vibe-audience/sync/generated-types.js +3 -0
- package/dist/destinations/vibe-audience/sync/generated-types.js.map +1 -0
- package/dist/destinations/vibe-audience/sync/index.d.ts +5 -0
- package/dist/destinations/vibe-audience/sync/index.js +135 -0
- package/dist/destinations/vibe-audience/sync/index.js.map +1 -0
- package/dist/destinations/vibe-audience/types.d.ts +14 -0
- package/dist/destinations/vibe-audience/types.js +3 -0
- package/dist/destinations/vibe-audience/types.js.map +1 -0
- package/dist/destinations/webhook/index.js +2 -3
- package/dist/destinations/webhook/index.js.map +1 -1
- package/dist/destinations/webhook-extensible/index.js +2 -3
- package/dist/destinations/webhook-extensible/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -67,9 +67,8 @@ const destination = {
|
|
|
67
67
|
s3_access_key: {
|
|
68
68
|
label: 'S3 Access Key',
|
|
69
69
|
description: 'S3 Access Key for the S3 bucket.',
|
|
70
|
-
type: '
|
|
71
|
-
required: true
|
|
72
|
-
format: 'password'
|
|
70
|
+
type: 'password',
|
|
71
|
+
required: true
|
|
73
72
|
},
|
|
74
73
|
s3_secret: {
|
|
75
74
|
label: 'S3 Secret',
|
|
@@ -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,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,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,kCAAkC;gBAC/C,IAAI,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;QAC9B,OAAO,EAAE;YACP,GAAG,IAAA,4BAAa,EAAC,eAAa,CAAC,MAAM,CAAC;YACtC,iBAAiB,EAAE;gBACjB,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,IAAA,4BAAa,EAAC,eAAa,CAAC,MAAM,CAAC;YACtC,iBAAiB,EAAE;gBACjB,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,qFAAqF;IAClG,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,cAAc,EAAE;gBACd,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,8FAA8F;gBAC3G,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,eAAe;aACzB;YACD,2BAA2B,EAAE;gBAC3B,KAAK,EAAE,8BAA8B;gBACrC,WAAW,EAAE,yEAAyE;gBACtF,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,kCAAkC;gBAC/C,IAAI,EAAE,UAAU;gBAChB,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"}
|
|
@@ -20,8 +20,7 @@ const destination = {
|
|
|
20
20
|
bearer_token: {
|
|
21
21
|
label: 'Authentication Token',
|
|
22
22
|
description: "If you choose to require authentication for Adobe Target's Profile API, you will need to generate an authentication token. Tokens can be generated in your Adobe Target account under the Implementation Settings tab or via the [Adobe.IO Authentication Token API](https://developers.adobetarget.com/api/#authentication-tokens). Input the authentication token here. Note: Authentication tokens expire so a new token will need to be generated and updated here prior to expiration.",
|
|
23
|
-
type: '
|
|
24
|
-
format: 'password'
|
|
23
|
+
type: 'password'
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/adobe-target/index.ts"],"names":[],"mappings":";;;;;AAGA,oEAA2C;AAE3C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,WAAW,EAAE;gBACX,KAAK,EAAE,aAAa;gBACpB,WAAW,EACT,sLAAsL;gBACxL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EACT,6dAA6d;gBAC/d,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/adobe-target/index.ts"],"names":[],"mappings":";;;;;AAGA,oEAA2C;AAE3C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,WAAW,EAAE;gBACX,KAAK,EAAE,aAAa;gBACpB,WAAW,EACT,sLAAsL;gBACxL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EACT,6dAA6d;gBAC/d,IAAI,EAAE,UAAU;aACjB;SACF;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,IAAI,QAAQ,CAAC,YAAY,EAAE,CAAC;YAC1B,OAAO;gBACL,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,QAAQ,CAAC,YAAY,EAAE;iBACjD;aACF,CAAA;QACH,CAAC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -3,4 +3,3 @@ import type { Settings } from '../generated-types';
|
|
|
3
3
|
import type { Payload } from './generated-types';
|
|
4
4
|
export declare const conversionEvents: ActionDefinition<Settings, Payload>;
|
|
5
5
|
export declare const purchasePreset: Preset;
|
|
6
|
-
export declare const addToCartPreset: Preset;
|
|
@@ -1,153 +1,152 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.purchasePreset = exports.conversionEvents = void 0;
|
|
4
4
|
const actions_core_1 = require("@segment/actions-core");
|
|
5
5
|
const algolia_insight_api_1 = require("../algolia-insight-api");
|
|
6
6
|
const notUndef = (thing) => typeof thing !== 'undefined';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
description: 'Populates the ObjectIDs field in the Algolia Insights API. An array of objects representing the purchased items. Each object must contain a product_id field.',
|
|
22
|
-
type: 'object',
|
|
23
|
-
multiple: true,
|
|
24
|
-
defaultObjectUI: 'keyvalue',
|
|
25
|
-
properties: {
|
|
26
|
-
product_id: { label: 'product_id', type: 'string', required: true },
|
|
27
|
-
price: { label: 'price', type: 'number', required: false },
|
|
28
|
-
quantity: { label: 'quantity', type: 'number', required: false },
|
|
29
|
-
discount: { label: 'discount', type: 'number', required: false },
|
|
30
|
-
queryID: { label: 'queryID', type: 'string', required: false }
|
|
7
|
+
exports.conversionEvents = {
|
|
8
|
+
title: 'Conversion Events',
|
|
9
|
+
description: 'In ecommerce, conversions are purchase or add-to-cart events often but not always involving multiple products. Outside of ecommerce, a conversion can be any positive signal associated with an index record. Query ID is optional and indicates that the event is the result of a search query.',
|
|
10
|
+
fields: {
|
|
11
|
+
eventSubtype: {
|
|
12
|
+
label: 'Event Subtype',
|
|
13
|
+
description: 'Sub-type of the event, "purchase" or "addToCart".',
|
|
14
|
+
type: 'string',
|
|
15
|
+
required: false,
|
|
16
|
+
choices: [
|
|
17
|
+
{ value: 'purchase', label: 'Purchase' },
|
|
18
|
+
{ value: 'addToCart', label: 'Add To Cart' }
|
|
19
|
+
],
|
|
20
|
+
default: 'purchase'
|
|
31
21
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
22
|
+
products: {
|
|
23
|
+
label: 'Product Details',
|
|
24
|
+
description: 'Populates the ObjectIDs field in the Algolia Insights API. An array of objects representing the purchased items. Each object must contain a product_id field.',
|
|
25
|
+
type: 'object',
|
|
26
|
+
multiple: true,
|
|
27
|
+
defaultObjectUI: 'keyvalue',
|
|
28
|
+
properties: {
|
|
29
|
+
product_id: { label: 'product_id', type: 'string', required: true },
|
|
30
|
+
price: { label: 'price', type: 'number', required: false },
|
|
31
|
+
quantity: { label: 'quantity', type: 'number', required: false },
|
|
32
|
+
discount: { label: 'discount', type: 'number', required: false },
|
|
33
|
+
queryID: { label: 'queryID', type: 'string', required: false }
|
|
34
|
+
},
|
|
35
|
+
required: true,
|
|
36
|
+
default: {
|
|
37
|
+
'@arrayPath': [
|
|
38
|
+
'$.properties.products',
|
|
39
|
+
{
|
|
40
|
+
product_id: {
|
|
41
|
+
'@path': '$.product_id'
|
|
42
|
+
},
|
|
43
|
+
price: {
|
|
44
|
+
'@path': '$.price'
|
|
45
|
+
},
|
|
46
|
+
quantity: {
|
|
47
|
+
'@path': '$.quantity'
|
|
48
|
+
},
|
|
49
|
+
discount: {
|
|
50
|
+
'@path': '$.discount'
|
|
51
|
+
},
|
|
52
|
+
queryID: {
|
|
53
|
+
'@path': '$.queryID'
|
|
54
|
+
}
|
|
51
55
|
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
index: {
|
|
60
|
+
label: 'Index',
|
|
61
|
+
description: 'Name of the targeted search index.',
|
|
62
|
+
type: 'string',
|
|
63
|
+
required: true,
|
|
64
|
+
default: {
|
|
65
|
+
'@path': '$.properties.search_index'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
queryID: {
|
|
69
|
+
label: 'Query ID',
|
|
70
|
+
description: 'Query ID of the list on which the item was purchased.',
|
|
71
|
+
type: 'string',
|
|
72
|
+
required: false,
|
|
73
|
+
default: {
|
|
74
|
+
'@if': {
|
|
75
|
+
exists: { '@path': '$.properties.query_id' },
|
|
76
|
+
then: { '@path': '$.properties.query_id' },
|
|
77
|
+
else: { '@path': '$.integrations.Algolia Insights (Actions).query_id' }
|
|
52
78
|
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
index: {
|
|
57
|
-
label: 'Index',
|
|
58
|
-
description: 'Name of the targeted search index.',
|
|
59
|
-
type: 'string',
|
|
60
|
-
required: true,
|
|
61
|
-
default: {
|
|
62
|
-
'@path': '$.properties.search_index'
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
queryID: {
|
|
66
|
-
label: 'Query ID',
|
|
67
|
-
description: 'Query ID of the list on which the item was purchased.',
|
|
68
|
-
type: 'string',
|
|
69
|
-
required: false,
|
|
70
|
-
default: {
|
|
71
|
-
'@if': {
|
|
72
|
-
exists: { '@path': '$.properties.query_id' },
|
|
73
|
-
then: { '@path': '$.properties.query_id' },
|
|
74
|
-
else: { '@path': '$.integrations.Algolia Insights (Actions).query_id' }
|
|
75
79
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
},
|
|
81
|
+
userToken: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
required: true,
|
|
84
|
+
description: 'The ID associated with the user. If a user is authenticated, this should be set to the same value as the Authenticated User Token',
|
|
85
|
+
label: 'User Token',
|
|
86
|
+
default: {
|
|
87
|
+
'@if': {
|
|
88
|
+
exists: { '@path': '$.anonymousId' },
|
|
89
|
+
then: { '@path': '$.anonymousId' },
|
|
90
|
+
else: { '@path': '$.userId' }
|
|
91
|
+
}
|
|
88
92
|
}
|
|
93
|
+
},
|
|
94
|
+
authenticatedUserToken: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
description: 'The authenticated ID associated with the user.',
|
|
97
|
+
label: 'Authenticated User Token',
|
|
98
|
+
default: { '@path': '$.userId' }
|
|
99
|
+
},
|
|
100
|
+
timestamp: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
required: false,
|
|
103
|
+
description: 'The timestamp of the event.',
|
|
104
|
+
label: 'Timestamp',
|
|
105
|
+
default: { '@path': '$.timestamp' }
|
|
106
|
+
},
|
|
107
|
+
value: {
|
|
108
|
+
type: 'number',
|
|
109
|
+
required: false,
|
|
110
|
+
description: 'The value of the cart that is being converted.',
|
|
111
|
+
label: 'Value',
|
|
112
|
+
default: { '@path': '$.properties.value' }
|
|
113
|
+
},
|
|
114
|
+
currency: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
required: false,
|
|
117
|
+
description: 'Currency of the objects associated with the event in 3-letter ISO 4217 format. Required when `value` or `price` is set.',
|
|
118
|
+
label: 'Currency',
|
|
119
|
+
default: { '@path': '$.properties.currency' }
|
|
120
|
+
},
|
|
121
|
+
extraProperties: {
|
|
122
|
+
label: 'Extra Properties',
|
|
123
|
+
required: false,
|
|
124
|
+
description: 'Additional fields for this event. This field may be useful for Algolia Insights fields which are not mapped in Segment.',
|
|
125
|
+
type: 'object',
|
|
126
|
+
default: {
|
|
127
|
+
'@path': '$.properties'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
eventName: {
|
|
131
|
+
label: 'Event Name',
|
|
132
|
+
description: "The name of the event to send to Algolia. Defaults to 'Conversion Event'",
|
|
133
|
+
type: 'string',
|
|
134
|
+
required: false,
|
|
135
|
+
default: 'Conversion Event'
|
|
136
|
+
},
|
|
137
|
+
eventType: {
|
|
138
|
+
label: 'Event Type',
|
|
139
|
+
description: "The type of event to send to Algolia. Defaults to 'conversion'",
|
|
140
|
+
type: 'string',
|
|
141
|
+
required: false,
|
|
142
|
+
default: 'conversion',
|
|
143
|
+
choices: [
|
|
144
|
+
{ label: 'View', value: 'view' },
|
|
145
|
+
{ label: 'Conversion', value: 'conversion' },
|
|
146
|
+
{ label: 'Click', value: 'click' }
|
|
147
|
+
]
|
|
89
148
|
}
|
|
90
149
|
},
|
|
91
|
-
authenticatedUserToken: {
|
|
92
|
-
type: 'string',
|
|
93
|
-
description: 'The authenticated ID associated with the user.',
|
|
94
|
-
label: 'Authenticated User Token',
|
|
95
|
-
default: { '@path': '$.userId' }
|
|
96
|
-
},
|
|
97
|
-
timestamp: {
|
|
98
|
-
type: 'string',
|
|
99
|
-
required: false,
|
|
100
|
-
description: 'The timestamp of the event.',
|
|
101
|
-
label: 'Timestamp',
|
|
102
|
-
default: { '@path': '$.timestamp' }
|
|
103
|
-
},
|
|
104
|
-
value: {
|
|
105
|
-
type: 'number',
|
|
106
|
-
required: false,
|
|
107
|
-
description: 'The value of the cart that is being converted.',
|
|
108
|
-
label: 'Value',
|
|
109
|
-
default: { '@path': '$.properties.value' }
|
|
110
|
-
},
|
|
111
|
-
currency: {
|
|
112
|
-
type: 'string',
|
|
113
|
-
required: false,
|
|
114
|
-
description: 'Currency of the objects associated with the event in 3-letter ISO 4217 format. Required when `value` or `price` is set.',
|
|
115
|
-
label: 'Currency',
|
|
116
|
-
default: { '@path': '$.properties.currency' }
|
|
117
|
-
},
|
|
118
|
-
extraProperties: {
|
|
119
|
-
label: 'Extra Properties',
|
|
120
|
-
required: false,
|
|
121
|
-
description: 'Additional fields for this event. This field may be useful for Algolia Insights fields which are not mapped in Segment.',
|
|
122
|
-
type: 'object',
|
|
123
|
-
default: {
|
|
124
|
-
'@path': '$.properties'
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
eventName: {
|
|
128
|
-
label: 'Event Name',
|
|
129
|
-
description: "The name of the event to send to Algolia. Defaults to 'Conversion Event'",
|
|
130
|
-
type: 'string',
|
|
131
|
-
required: false,
|
|
132
|
-
default: 'Conversion Event'
|
|
133
|
-
},
|
|
134
|
-
eventType: {
|
|
135
|
-
label: 'Event Type',
|
|
136
|
-
description: "The type of event to send to Algolia. Defaults to 'conversion'",
|
|
137
|
-
type: 'string',
|
|
138
|
-
required: false,
|
|
139
|
-
default: 'conversion',
|
|
140
|
-
choices: [
|
|
141
|
-
{ label: 'View', value: 'view' },
|
|
142
|
-
{ label: 'Conversion', value: 'conversion' },
|
|
143
|
-
{ label: 'Click', value: 'click' }
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
exports.conversionEvents = {
|
|
148
|
-
title: 'Conversion Events',
|
|
149
|
-
description: 'In ecommerce, conversions are purchase or add-to-cart events often but not always involving multiple products. Outside of ecommerce, a conversion can be any positive signal associated with an index record. Query ID is optional and indicates that the event is the result of a search query.',
|
|
150
|
-
fields: getEventFields(),
|
|
151
150
|
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
152
151
|
perform: (request, data) => {
|
|
153
152
|
const objectData = data.payload.products.some(({ queryID, price, discount, quantity }) => {
|
|
@@ -189,11 +188,4 @@ exports.purchasePreset = {
|
|
|
189
188
|
mapping: (0, actions_core_1.defaultValues)(exports.conversionEvents.fields),
|
|
190
189
|
type: 'automatic'
|
|
191
190
|
};
|
|
192
|
-
exports.addToCartPreset = {
|
|
193
|
-
name: 'Send add-to-cart events to Algolia',
|
|
194
|
-
subscribe: 'type = "track" and event = "Product Added"',
|
|
195
|
-
partnerAction: 'conversionEvents',
|
|
196
|
-
mapping: (0, actions_core_1.defaultValues)(getEventFields('addToCart')),
|
|
197
|
-
type: 'automatic'
|
|
198
|
-
};
|
|
199
191
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/algolia-insights/conversionEvents/index.ts"],"names":[],"mappings":";;;AACA,wDAAqD;AACrD,gEAK+B;AAI/B,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/algolia-insights/conversionEvents/index.ts"],"names":[],"mappings":";;;AACA,wDAAqD;AACrD,gEAK+B;AAI/B,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,WAAW,CAAA;AAEpD,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACT,kSAAkS;IACpS,MAAM,EAAE;QACN,YAAY,EAAE;YACZ,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,mDAAmD;YAChE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;gBACxC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE;aAC7C;YACD,OAAO,EAAE,UAAU;SACpB;QACD,Q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AAE,wBAAgB,CAAC,mBAA6B;IACzD,aAAa,EAAE,kBAAkB;IACjC,OAAO,EAAE,IAAA,4BAAa,EAAC,wBAAgB,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,WAAW;CAClB,CAAA"}
|
|
@@ -56,7 +56,7 @@ const destination = {
|
|
|
56
56
|
},
|
|
57
57
|
productClickedEvents_1.productClickPresets,
|
|
58
58
|
conversionEvents_1.purchasePreset,
|
|
59
|
-
|
|
59
|
+
productAddedEvents_1.addToCartPreset,
|
|
60
60
|
productViewedEvents_1.productViewedPresets,
|
|
61
61
|
productListFilteredEvents_1.productListFilteredPresets,
|
|
62
62
|
productListViewedEvents_1.productListViewedPresets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/algolia-insights/index.ts"],"names":[],"mappings":";;;AAGA,iEAAkF;AAElF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/algolia-insights/index.ts"],"names":[],"mappings":";;;AAGA,iEAAkF;AAElF,yDAAqE;AAErE,+DAAiF;AACjF,+DAAuF;AAEvF,6DAA0E;AAE1E,2EAAmG;AACnG,uEAA6F;AAEhF,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,IAAA,8CAAwB,EAAC,QAAQ,CAAC,CAAC,CAAA;YAEzF,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBAC/C,OAAO,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAA;YACnD,CAAC;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;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,gBAAgB;YACtB,SAAS,EAAE,0FAA0F;YACrG,aAAa,EAAE,eAAe;YAC9B,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,WAAW;SAClB;QACD,0CAAmB;QACnB,iCAAc;QACd,oCAAe;QACf,0CAAoB;QACpB,sDAA0B;QAC1B,kDAAwB;KACzB;IACD,OAAO,EAAE;QACP,oBAAoB,EAApB,2CAAoB;QACpB,gBAAgB,EAAhB,mCAAgB;QAChB,mBAAmB,EAAnB,yCAAmB;QACnB,kBAAkB,EAAlB,uCAAkB;QAClB,yBAAyB,EAAzB,qDAAyB;QACzB,uBAAuB,EAAvB,iDAAuB;KACxB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ActionDefinition } from '@segment/actions-core';
|
|
2
|
+
import { Preset } from '@segment/actions-core';
|
|
2
3
|
import type { Settings } from '../generated-types';
|
|
3
4
|
import type { Payload } from './generated-types';
|
|
4
5
|
export declare const productAddedEvents: ActionDefinition<Settings, Payload>;
|
|
6
|
+
export declare const addToCartPreset: Preset;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.productAddedEvents = void 0;
|
|
3
|
+
exports.addToCartPreset = exports.productAddedEvents = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
5
|
const algolia_insight_api_1 = require("../algolia-insight-api");
|
|
5
6
|
exports.productAddedEvents = {
|
|
6
|
-
title: '
|
|
7
|
-
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.
|
|
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.',
|
|
8
9
|
fields: {
|
|
9
10
|
product: {
|
|
10
11
|
label: 'Product ID',
|
|
@@ -50,6 +51,12 @@ exports.productAddedEvents = {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
},
|
|
54
|
+
authenticatedUserToken: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'The authenticated ID associated with the user.',
|
|
57
|
+
label: 'Authenticated User Token',
|
|
58
|
+
default: { '@path': '$.userId' }
|
|
59
|
+
},
|
|
53
60
|
timestamp: {
|
|
54
61
|
type: 'string',
|
|
55
62
|
required: false,
|
|
@@ -92,10 +99,12 @@ exports.productAddedEvents = {
|
|
|
92
99
|
...data.payload.extraProperties,
|
|
93
100
|
eventName: data.payload.eventName ?? 'Add to cart',
|
|
94
101
|
eventType: data.payload.eventType ?? 'conversion',
|
|
102
|
+
eventSubtype: 'addToCart',
|
|
95
103
|
index: data.payload.index,
|
|
96
104
|
queryID: data.payload.queryID,
|
|
97
105
|
objectIDs: [data.payload.product],
|
|
98
106
|
userToken: data.payload.userToken,
|
|
107
|
+
authenticatedUserToken: data.payload.authenticatedUserToken,
|
|
99
108
|
timestamp: data.payload.timestamp ? new Date(data.payload.timestamp).valueOf() : undefined
|
|
100
109
|
};
|
|
101
110
|
const insightPayload = { events: [insightEvent] };
|
|
@@ -105,4 +114,11 @@ exports.productAddedEvents = {
|
|
|
105
114
|
});
|
|
106
115
|
}
|
|
107
116
|
};
|
|
117
|
+
exports.addToCartPreset = {
|
|
118
|
+
name: 'Send an add-to-cart event to Algolia',
|
|
119
|
+
subscribe: exports.productAddedEvents.defaultSubscription,
|
|
120
|
+
partnerAction: 'productAddedEvents',
|
|
121
|
+
mapping: (0, actions_core_1.defaultValues)(exports.productAddedEvents.fields),
|
|
122
|
+
type: 'automatic'
|
|
123
|
+
};
|
|
108
124
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/algolia-insights/productAddedEvents/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/algolia-insights/productAddedEvents/index.ts"],"names":[],"mappings":";;;AACA,wDAA6D;AAG7D,gEAAsG;AAEzF,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,QAA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AAC;CACF,CAAA;AAEY,QAAA,eAAe,GAAW;IACrC,IAAI,EAAE,sCAAsC;IAC5C,SAAS,EAAE,0BAAkB,CAAC,mBAA6B;IAC3D,aAAa,EAAE,oBAAoB;IACnC,OAAO,EAAE,IAAA,4BAAa,EAAC,0BAAkB,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,WAAW;CAClB,CAAA"}
|
|
@@ -57,9 +57,6 @@ function formatEcommEventJSON(payload) {
|
|
|
57
57
|
}
|
|
58
58
|
function formatCustomEventJSON(payload) {
|
|
59
59
|
const { externalEventId, type, properties, occurredAt, userIdentifiers } = payload;
|
|
60
|
-
if (Object.values(properties ?? {}).some((value) => Array.isArray(value))) {
|
|
61
|
-
throw new actions_core_1.PayloadValidationError('Properties cannot contain arrays.');
|
|
62
|
-
}
|
|
63
60
|
return {
|
|
64
61
|
type,
|
|
65
62
|
properties,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/attentive/functions.ts"],"names":[],"mappings":";;AAmBA,4BAQC;AAED,sDAKC;AAmCD,oDAMC;AAED,
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/attentive/functions.ts"],"names":[],"mappings":";;AAmBA,4BAQC;AAED,sDAKC;AAmCD,oDAMC;AAED,sDAUC;AAED,wEAWC;AAED,0DAYC;AAlHD,wDAA8D;AAmB9D,SAAgB,QAAQ,CAAC,OAA8E;IACrG,MAAM,EACJ,eAAe,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,iBAAiB,EAAE,EACtE,GAAG,OAAO,CAAA;IAEX,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrF,MAAM,IAAI,qCAAsB,CAAC,2CAA2C,CAAC,CAAA;IAC/E,C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C,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACvG,MAAM,IAAI,qCAAsB,CAAC,8CAA8C,CAAC,CAAA;IAClF,CAAC;IAED,OAAO;QACL,UAAU;QACV,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC;KAClC,CAAA;AACH,CAAC;AAED,SAAgB,uBAAuB,CAAC,OAA2B;IACjE,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,GAC3G,OAAO,CAAA;IACT,OAAO;QACL,eAAe;QACf,UAAU;QACV,gBAAgB,EAAE,gBAAoC;QACtD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,WAAW;QACX,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC;KAClC,CAAA;AACH,CAAC"}
|
|
@@ -23,9 +23,8 @@ const destination = {
|
|
|
23
23
|
client_secret: {
|
|
24
24
|
label: 'API Client Secret',
|
|
25
25
|
description: 'Your Criteo API client secret',
|
|
26
|
-
type: '
|
|
27
|
-
required: true
|
|
28
|
-
format: 'password'
|
|
26
|
+
type: 'password',
|
|
27
|
+
required: true
|
|
29
28
|
},
|
|
30
29
|
advertiser_id: {
|
|
31
30
|
label: 'Advertiser ID',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/criteo-audiences/index.ts"],"names":[],"mappings":";;;;;AAEA,4EAAmD;AACnD,sFAA6D;AAC7D,yDAAuD;AAGvD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/criteo-audiences/index.ts"],"names":[],"mappings":";;;;;AAEA,4EAAmD;AACnD,sFAA6D;AAC7D,yDAAuD;AAGvD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,gDAAgD;gBAC7D,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,IAAI;aACd;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,WAAW,GAAsB,MAAM,IAAA,qCAAkB,EAAC,OAAO,EAAE;gBACvE,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,aAAa,EAAE,QAAQ,CAAC,aAAa;aACtC,CAAC,CAAA;YACF,OAAO,WAAW,CAAC,YAAY,CAAA;QACjC,CAAC;KACF;IACD,OAAO,EAAE;QACP,iBAAiB,EAAjB,2BAAiB;QACjB,sBAAsB,EAAtB,gCAAsB;KACvB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.createBatchTestEvents = void 0;
|
|
7
|
+
const nock_1 = __importDefault(require("nock"));
|
|
8
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
9
|
+
const index_1 = __importDefault(require("../../index"));
|
|
10
|
+
const testDestination = (0, actions_core_1.createTestIntegration)(index_1.default);
|
|
11
|
+
const event = (0, actions_core_1.createTestEvent)({
|
|
12
|
+
event: 'Audience Entered',
|
|
13
|
+
type: 'track',
|
|
14
|
+
properties: {
|
|
15
|
+
audience_key: 'personas_test_audience'
|
|
16
|
+
},
|
|
17
|
+
context: {
|
|
18
|
+
device: {
|
|
19
|
+
advertisingId: '123'
|
|
20
|
+
},
|
|
21
|
+
traits: {
|
|
22
|
+
mobileDeviceIds: 'test-id'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
describe('First-Party-dv360.addToAudMobileDeviceId', () => {
|
|
27
|
+
it('should addToAudMobileDeviceId', async () => {
|
|
28
|
+
(0, nock_1.default)('https://displayvideo.googleapis.com/v3/firstAndThirdPartyAudiences')
|
|
29
|
+
.post('/1234567890:editCustomerMatchMembers')
|
|
30
|
+
.reply(200, { firstAndThirdPartyAudienceId: '1234567890' });
|
|
31
|
+
const responses = await testDestination.testAction('addToAudMobileDeviceId', {
|
|
32
|
+
event,
|
|
33
|
+
mapping: {
|
|
34
|
+
mobileDeviceIds: ['test-id'],
|
|
35
|
+
external_id: '1234567890',
|
|
36
|
+
advertiser_id: '1234567890',
|
|
37
|
+
enable_batching: false,
|
|
38
|
+
batch_size: 1
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
expect(responses[0].options.body).toMatchInlineSnapshot(`"{\\"advertiserId\\":\\"1234567890\\",\\"addedMobileDeviceIdList\\":{\\"mobileDeviceIds\\":[\\"test-id\\"],\\"consent\\":{\\"adUserData\\":\\"CONSENT_STATUS_GRANTED\\",\\"adPersonalization\\":\\"CONSENT_STATUS_GRANTED\\"}}}"`);
|
|
42
|
+
});
|
|
43
|
+
it('should batch multiple payloads into a single request when enable_batching is true', async () => {
|
|
44
|
+
(0, nock_1.default)('https://displayvideo.googleapis.com/v3/firstAndThirdPartyAudiences')
|
|
45
|
+
.post('/1234567890:editCustomerMatchMembers')
|
|
46
|
+
.reply(200, { firstAndThirdPartyAudienceId: '1234567890' });
|
|
47
|
+
const events = (0, exports.createBatchTestEvents)(createContactList);
|
|
48
|
+
const responses = await testDestination.testBatchAction('addToAudMobileDeviceId', {
|
|
49
|
+
events: events,
|
|
50
|
+
mapping: {
|
|
51
|
+
mobileDeviceIds: ['test-id'],
|
|
52
|
+
external_id: '1234567890',
|
|
53
|
+
advertiser_id: '1234567890',
|
|
54
|
+
enable_batching: true,
|
|
55
|
+
batch_size: 10
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const requestBody = JSON.parse(String(responses[0].options.body));
|
|
59
|
+
expect(requestBody.addedMobileDeviceIdList.mobileDeviceIds.length).toBe(2);
|
|
60
|
+
expect(requestBody.addedMobileDeviceIdList.mobileDeviceIds[0]).toBeDefined();
|
|
61
|
+
expect(requestBody.addedMobileDeviceIdList.mobileDeviceIds[1]).toBeDefined();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
const createBatchTestEvents = (batchContactList) => batchContactList.map((contact) => (0, actions_core_1.createTestEvent)({
|
|
65
|
+
type: 'identify',
|
|
66
|
+
traits: {
|
|
67
|
+
mobileDeviceIds: contact.mobileDeviceIds
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
exports.createBatchTestEvents = createBatchTestEvents;
|
|
71
|
+
const createContactList = [
|
|
72
|
+
{
|
|
73
|
+
mobileDeviceIds: 'test-id'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
mobileDeviceIds: 'test-id2'
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
//# sourceMappingURL=index.test.js.map
|