@segment/action-destinations 3.427.0 → 3.429.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 +1 -1
- package/dist/destinations/acoustic-s3tc/index.js.map +1 -1
- package/dist/destinations/adobe-target/index.js +1 -1
- 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 +1 -1
- 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 +3 -3
- 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 +6 -9
- 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 +3 -3
- package/dist/destinations/first-party-dv360/removeFromAudMobileDeviceId/index.js.map +1 -1
- package/dist/destinations/friendbuy/index.js +1 -1
- package/dist/destinations/friendbuy/index.js.map +1 -1
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/kafka/index.js +1 -1
- package/dist/destinations/kafka/index.js.map +1 -1
- package/dist/destinations/kafka/utils.js +11 -7
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/koala/index.js +1 -1
- package/dist/destinations/koala/index.js.map +1 -1
- package/dist/destinations/metronome/index.js +1 -1
- package/dist/destinations/metronome/index.js.map +1 -1
- package/dist/destinations/moengage/index.js +1 -1
- package/dist/destinations/moengage/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/constants.d.ts +5 -0
- package/dist/destinations/ms-bing-ads-audiences/constants.js +13 -0
- package/dist/destinations/ms-bing-ads-audiences/constants.js.map +1 -0
- package/dist/destinations/ms-bing-ads-audiences/generated-types.d.ts +3 -0
- package/dist/destinations/ms-bing-ads-audiences/index.d.ts +1 -1
- package/dist/destinations/ms-bing-ads-audiences/index.js +86 -3
- package/dist/destinations/ms-bing-ads-audiences/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/fields.d.ts +11 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/fields.js +123 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/fields.js.map +1 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/generated-types.d.ts +11 -0
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/index.d.ts +1 -1
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/index.js +58 -7
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/types.d.ts +48 -0
- package/dist/destinations/ms-bing-ads-audiences/types.js.map +1 -0
- package/dist/destinations/ms-bing-ads-audiences/utils.d.ts +9 -0
- package/dist/destinations/ms-bing-ads-audiences/utils.js +86 -0
- package/dist/destinations/ms-bing-ads-audiences/utils.js.map +1 -0
- package/dist/destinations/ms-bing-capi/generated-types.d.ts +1 -0
- package/dist/destinations/ms-bing-capi/index.d.ts +1 -1
- package/dist/destinations/ms-bing-capi/index.js +76 -5
- package/dist/destinations/ms-bing-capi/index.js.map +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/constants.js.map +1 -0
- package/dist/destinations/ms-bing-capi/{fields.d.ts → sendEvent/fields.d.ts} +3 -0
- package/dist/destinations/ms-bing-capi/{fields.js → sendEvent/fields.js} +51 -15
- package/dist/destinations/ms-bing-capi/sendEvent/fields.js.map +1 -0
- package/dist/destinations/ms-bing-capi/sendEvent/generated-types.d.ts +22 -22
- package/dist/destinations/ms-bing-capi/sendEvent/index.d.ts +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/index.js +68 -30
- package/dist/destinations/ms-bing-capi/sendEvent/index.js.map +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/types.d.ts +62 -10
- package/dist/destinations/ms-bing-capi/sendEvent/utils.js +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/utils.js.map +1 -1
- package/dist/destinations/pipedrive/index.js +1 -1
- package/dist/destinations/pipedrive/index.js.map +1 -1
- package/dist/destinations/qualtrics/index.js +1 -1
- package/dist/destinations/qualtrics/index.js.map +1 -1
- package/dist/destinations/reddit-conversions-api/index.js +1 -1
- package/dist/destinations/reddit-conversions-api/index.js.map +1 -1
- package/dist/destinations/salesforce/index.js +2 -2
- package/dist/destinations/salesforce/index.js.map +1 -1
- package/dist/destinations/taboola-actions/index.js +1 -1
- package/dist/destinations/taboola-actions/index.js.map +1 -1
- package/dist/destinations/the-trade-desk-crm/index.js +1 -1
- 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-conversions/reportWebEvent/constants.d.ts +4 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/constants.js +8 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/constants.js.map +1 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/common_fields.d.ts +2 -0
- package/dist/destinations/tiktok-conversions/{common_fields.js → reportWebEvent/fields/common_fields.js} +89 -21
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/common_fields.js.map +1 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/crm_fields.d.ts +2 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/crm_fields.js +48 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/crm_fields.js.map +1 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/travel_fields.d.ts +2 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/travel_fields.js +216 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/travel_fields.js.map +1 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/vehicle_fields.d.ts +2 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/vehicle_fields.js +261 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/fields/vehicle_fields.js.map +1 -0
- package/dist/destinations/tiktok-conversions/{formatter.js → reportWebEvent/formatter.js} +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +58 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +10 -4
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/types.d.ts +111 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/types.js +3 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/types.js.map +1 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/utils.d.ts +4 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/utils.js +170 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/utils.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/index.js +1 -1
- 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.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/{ms-bing-capi/pageLoad → vibe-audience/sync}/index.d.ts +1 -1
- 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 +1 -1
- package/dist/destinations/webhook/index.js.map +1 -1
- package/dist/destinations/webhook-extensible/index.js +1 -1
- package/dist/destinations/webhook-extensible/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/destinations/ms-bing-capi/constants.js.map +0 -1
- package/dist/destinations/ms-bing-capi/fields.js.map +0 -1
- package/dist/destinations/ms-bing-capi/pageLoad/generated-types.d.ts +0 -56
- package/dist/destinations/ms-bing-capi/pageLoad/generated-types.js.map +0 -1
- package/dist/destinations/ms-bing-capi/pageLoad/index.js +0 -44
- package/dist/destinations/ms-bing-capi/pageLoad/index.js.map +0 -1
- package/dist/destinations/tiktok-conversions/common_fields.d.ts +0 -2
- package/dist/destinations/tiktok-conversions/common_fields.js.map +0 -1
- package/dist/destinations/tiktok-conversions/formatter.js.map +0 -1
- package/dist/destinations/tiktok-conversions/types.d.ts +0 -55
- package/dist/destinations/tiktok-conversions/types.js.map +0 -1
- package/dist/destinations/tiktok-conversions/utils.d.ts +0 -4
- package/dist/destinations/tiktok-conversions/utils.js +0 -128
- package/dist/destinations/tiktok-conversions/utils.js.map +0 -1
- /package/dist/destinations/{tiktok-conversions → ms-bing-ads-audiences}/types.js +0 -0
- /package/dist/destinations/ms-bing-capi/{constants.d.ts → sendEvent/constants.d.ts} +0 -0
- /package/dist/destinations/ms-bing-capi/{constants.js → sendEvent/constants.js} +0 -0
- /package/dist/destinations/tiktok-conversions/{formatter.d.ts → reportWebEvent/formatter.d.ts} +0 -0
- /package/dist/destinations/{ms-bing-capi/pageLoad → vibe-audience}/generated-types.js +0 -0
|
@@ -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,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,
|
|
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,O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BACtF,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,7 +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: '
|
|
23
|
+
type: 'password'
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
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,QAAQ,EAAE;YACR,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,+JAA+J;YACjK,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,UAAU;YAC3B,UAAU,EAAE;gBACV,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACnE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,Q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,OAAO,CAAC,YAAoC,IAAI,UAAU;YAC9E,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;YACrE,UAAU;YACV,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;YACzB,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;YAC/B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,sBAAsB,EAAE,IAAI,CAAC,OAAO,CAAC,sBAAsB;YAC3D,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,cAAc,GAAW;IACpC,IAAI,EAAE,iCAAiC;IACvC,SAAS,EAAE,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,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;oBAC5C,IAAI,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;oBAC1C,IAAI,EAAE,EAAE,OAAO,EAAE,oDAAoD,EAAE;iBACxE;aACF;SACF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kCAAkC;YA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) {
|
|
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,0DAWC;AAjHD,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,CAAC;AACH,CAAC;AAED,SAAgB,qBAAqB,CAAC,OAA2B;IAC/D,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;IAC1C,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,qCAAsB,CAAC,6DAA6D,CAAC,CAAA;IACjG,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,eAAgC;I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AgB,uBAAuB,CAAC,OAA2B;IACjE,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;IACvH,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,CAAA,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,WAAW;QACX,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC;KAClC,CAAA;AACH,CAAC"}
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../../src/destinations/first-party-dv360/addToAudMobileDeviceId/_tests_/index.test.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,wDAA8E;AAC9E,wDAAqC;AAErC,MAAM,eAAe,GAAG,IAAA,oCAAqB,EAAC,eAAW,CAAC,CAAA;AAE1D,MAAM,KAAK,GAAG,IAAA,8BAAe,EAAC;IAC5B,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACV,YAAY,EAAE,wBAAwB;KACvC;IACD,OAAO,EAAE;QACP,MAAM,EAAE;YACN,aAAa,EAAE,KAAK;SACrB;QACD,MAAM,EAAE;YACN,eAAe,EAAE,SAAS;SAC3B;KACF;CACF,CAAC,CAAA;AAEF,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACxD,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC7C,IAAA,cAAI,EAAC,oEAAoE,CAAC;aACvE,IAAI,CAAC,sCAAsC,CAAC;aAC5C,KAAK,CAAC,GAAG,EAAE,EAAE,4BAA4B,EAAE,YAAY,EAAE,CAAC,CAAA;QAE7D,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,wBAAwB,EAAE;YAC3E,KAAK;YACL,OAAO,EAAE;gBACP,eAAe,EAAE,CAAC,SAAS,CAAC;gBAC5B,WAAW,EAAE,YAAY;gBACzB,aAAa,EAAE,YAAY;gBAC3B,eAAe,EAAE,KAAK;gBACtB,UAAU,EAAE,CAAC;aACd;SACF,CAAC,CAAA;QAEF,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,qBAAqB,CACrD,kOAAkO,CACnO,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mFAAmF,EAAE,KAAK,IAAI,EAAE;QACjG,IAAA,cAAI,EAAC,oEA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