@segment/action-destinations 3.145.0 → 3.148.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/README.md +1 -0
- package/dist/destinations/acoustic/index.js +8 -12
- package/dist/destinations/acoustic/index.js.map +1 -1
- package/dist/destinations/blend-ai/generated-types.d.ts +3 -0
- package/dist/destinations/blend-ai/generated-types.js +3 -0
- package/dist/destinations/blend-ai/generated-types.js.map +1 -0
- package/dist/destinations/blend-ai/index.d.ts +4 -0
- package/dist/destinations/blend-ai/index.js +54 -0
- package/dist/destinations/blend-ai/index.js.map +1 -0
- package/dist/destinations/blend-ai/sendData/generated-types.d.ts +2 -0
- package/dist/destinations/blend-ai/sendData/generated-types.js +3 -0
- package/dist/destinations/blend-ai/sendData/generated-types.js.map +1 -0
- package/dist/destinations/blend-ai/sendData/index.d.ts +5 -0
- package/dist/destinations/blend-ai/sendData/index.js +16 -0
- package/dist/destinations/blend-ai/sendData/index.js.map +1 -0
- package/dist/destinations/encharge/addTag/generated-types.d.ts +6 -0
- package/dist/destinations/encharge/addTag/generated-types.js +3 -0
- package/dist/destinations/encharge/addTag/generated-types.js.map +1 -0
- package/dist/destinations/encharge/addTag/index.d.ts +5 -0
- package/dist/destinations/encharge/addTag/index.js +37 -0
- package/dist/destinations/encharge/addTag/index.js.map +1 -0
- package/dist/destinations/encharge/aliasUser/generated-types.d.ts +6 -0
- package/dist/destinations/encharge/aliasUser/generated-types.js +3 -0
- package/dist/destinations/encharge/aliasUser/generated-types.js.map +1 -0
- package/dist/destinations/encharge/aliasUser/index.d.ts +5 -0
- package/dist/destinations/encharge/aliasUser/index.js +42 -0
- package/dist/destinations/encharge/aliasUser/index.js.map +1 -0
- package/dist/destinations/encharge/common-definitions.d.ts +5 -0
- package/dist/destinations/encharge/common-definitions.js +206 -0
- package/dist/destinations/encharge/common-definitions.js.map +1 -0
- package/dist/destinations/encharge/createUpdateObject/generated-types.d.ts +10 -0
- package/dist/destinations/encharge/createUpdateObject/generated-types.js +3 -0
- package/dist/destinations/encharge/createUpdateObject/generated-types.js.map +1 -0
- package/dist/destinations/encharge/createUpdateObject/getCustomObjects.d.ts +2 -0
- package/dist/destinations/encharge/createUpdateObject/getCustomObjects.js +29 -0
- package/dist/destinations/encharge/createUpdateObject/getCustomObjects.js.map +1 -0
- package/dist/destinations/encharge/createUpdateObject/index.d.ts +5 -0
- package/dist/destinations/encharge/createUpdateObject/index.js +75 -0
- package/dist/destinations/encharge/createUpdateObject/index.js.map +1 -0
- package/dist/destinations/encharge/deleteUser.d.ts +3 -0
- package/dist/destinations/encharge/deleteUser.js +23 -0
- package/dist/destinations/encharge/deleteUser.js.map +1 -0
- package/dist/destinations/encharge/generated-types.d.ts +3 -0
- package/dist/destinations/encharge/generated-types.js +3 -0
- package/dist/destinations/encharge/generated-types.js.map +1 -0
- package/dist/destinations/encharge/identifyUser/generated-types.d.ts +33 -0
- package/dist/destinations/encharge/identifyUser/generated-types.js +3 -0
- package/dist/destinations/encharge/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/encharge/identifyUser/index.d.ts +5 -0
- package/dist/destinations/encharge/identifyUser/index.js +42 -0
- package/dist/destinations/encharge/identifyUser/index.js.map +1 -0
- package/dist/destinations/encharge/index.d.ts +4 -0
- package/dist/destinations/encharge/index.js +88 -0
- package/dist/destinations/encharge/index.js.map +1 -0
- package/dist/destinations/encharge/removeTag/generated-types.d.ts +6 -0
- package/dist/destinations/encharge/removeTag/generated-types.js +3 -0
- package/dist/destinations/encharge/removeTag/generated-types.js.map +1 -0
- package/dist/destinations/encharge/removeTag/index.d.ts +5 -0
- package/dist/destinations/encharge/removeTag/index.js +37 -0
- package/dist/destinations/encharge/removeTag/index.js.map +1 -0
- package/dist/destinations/encharge/trackEvent/generated-types.d.ts +37 -0
- package/dist/destinations/encharge/trackEvent/generated-types.js +3 -0
- package/dist/destinations/encharge/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/encharge/trackEvent/index.d.ts +5 -0
- package/dist/destinations/encharge/trackEvent/index.js +44 -0
- package/dist/destinations/encharge/trackEvent/index.js.map +1 -0
- package/dist/destinations/encharge/trackPageView/generated-types.d.ts +36 -0
- package/dist/destinations/encharge/trackPageView/generated-types.js +3 -0
- package/dist/destinations/encharge/trackPageView/generated-types.js.map +1 -0
- package/dist/destinations/encharge/trackPageView/index.d.ts +5 -0
- package/dist/destinations/encharge/trackPageView/index.js +41 -0
- package/dist/destinations/encharge/trackPageView/index.js.map +1 -0
- package/dist/destinations/encharge/utils.d.ts +3 -0
- package/dist/destinations/encharge/utils.js +7 -0
- package/dist/destinations/encharge/utils.js.map +1 -0
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/june/index.js +9 -4
- package/dist/destinations/june/index.js.map +1 -1
- package/dist/destinations/launchdarkly/aliasUser/index.js +1 -1
- package/dist/destinations/launchdarkly/aliasUser/index.js.map +1 -1
- package/dist/destinations/launchdarkly/index.js +2 -2
- package/dist/destinations/launchdarkly/trackEvent/generated-types.d.ts +4 -0
- package/dist/destinations/launchdarkly/trackEvent/index.js +33 -8
- package/dist/destinations/launchdarkly/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/identifyUser/index.js +12 -2
- package/dist/destinations/mixpanel/identifyUser/index.js.map +1 -1
- package/dist/destinations/mixpanel/mixpanel-types.d.ts +17 -0
- package/dist/destinations/pinterest-conversions/constants.d.ts +14 -0
- package/dist/destinations/pinterest-conversions/constants.js +18 -0
- package/dist/destinations/pinterest-conversions/constants.js.map +1 -0
- package/dist/destinations/pinterest-conversions/index.d.ts +1 -1
- package/dist/destinations/pinterest-conversions/index.js +98 -1
- package/dist/destinations/pinterest-conversions/index.js.map +1 -1
- package/dist/destinations/pinterest-conversions/pinterest-capi-custom-data.d.ts +2 -0
- package/dist/destinations/pinterest-conversions/pinterest-capi-custom-data.js +83 -0
- package/dist/destinations/pinterest-conversions/pinterest-capi-custom-data.js.map +1 -0
- package/dist/destinations/pinterest-conversions/pinterset-capi-user-data.d.ts +7 -0
- package/dist/destinations/pinterest-conversions/pinterset-capi-user-data.js +195 -0
- package/dist/destinations/pinterest-conversions/pinterset-capi-user-data.js.map +1 -0
- package/dist/destinations/pinterest-conversions/reportConversionEvent/generated-types.d.ts +45 -0
- package/dist/destinations/pinterest-conversions/reportConversionEvent/index.js +202 -2
- package/dist/destinations/pinterest-conversions/reportConversionEvent/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/addUser/generated-types.d.ts +1 -2
- package/dist/destinations/tiktok-audiences/addUser/index.js +2 -3
- package/dist/destinations/tiktok-audiences/addUser/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/api/index.d.ts +1 -3
- package/dist/destinations/tiktok-audiences/api/index.js +0 -10
- package/dist/destinations/tiktok-audiences/api/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/functions.d.ts +1 -5
- package/dist/destinations/tiktok-audiences/functions.js +8 -44
- package/dist/destinations/tiktok-audiences/functions.js.map +1 -1
- package/dist/destinations/tiktok-audiences/properties.d.ts +2 -2
- package/dist/destinations/tiktok-audiences/properties.js +16 -12
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
- package/dist/destinations/tiktok-audiences/removeUser/generated-types.d.ts +1 -2
- package/dist/destinations/tiktok-audiences/removeUser/index.js +2 -3
- package/dist/destinations/tiktok-audiences/removeUser/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/types.d.ts +0 -5
- package/dist/destinations/webhook/send/generated-types.d.ts +1 -0
- package/dist/destinations/webhook/send/index.js +7 -0
- package/dist/destinations/webhook/send/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const getCustomObjects_1 = require("./getCustomObjects");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Create or Update Object',
|
|
7
|
+
description: 'Create or Update a Custom Object (including Companies) in Encharge. If email or user ID are provided, the user will be associated with the object. A new user will be created if the email or user ID do not exist in Encharge.',
|
|
8
|
+
defaultSubscription: 'type = "group"',
|
|
9
|
+
fields: {
|
|
10
|
+
objectType: {
|
|
11
|
+
label: 'Object Type',
|
|
12
|
+
description: 'The type of Encharge object to create or update.',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true,
|
|
15
|
+
dynamic: true,
|
|
16
|
+
default: 'company'
|
|
17
|
+
},
|
|
18
|
+
externalId: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: false,
|
|
21
|
+
label: 'External Object ID',
|
|
22
|
+
description: 'An ID from your app/database that is used to uniquely identify the object in Encharge.',
|
|
23
|
+
default: { '@path': '$.groupId' }
|
|
24
|
+
},
|
|
25
|
+
id: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: false,
|
|
28
|
+
description: 'The Encharge ID of the object. Usually, you want to omit this and use External ID.',
|
|
29
|
+
label: 'Object ID'
|
|
30
|
+
},
|
|
31
|
+
objectData: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
label: 'Object Fields',
|
|
34
|
+
description: 'Data for the Object fields to associate with the user in Encharge. Any unexisting fields will be ignored.',
|
|
35
|
+
required: false,
|
|
36
|
+
default: { '@path': '$.traits' }
|
|
37
|
+
},
|
|
38
|
+
userId: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'The User ID of the user to associate with the object. If no email or user ID is provided, no user will be created and associated.',
|
|
41
|
+
label: 'User ID',
|
|
42
|
+
default: { '@path': '$.userId' }
|
|
43
|
+
},
|
|
44
|
+
email: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'The email of the user to associate with the object. If no email or user ID is provided, no user will be created and associated.',
|
|
47
|
+
label: 'Email',
|
|
48
|
+
default: { '@path': '$.email' }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
dynamicFields: {
|
|
52
|
+
objectType: getCustomObjects_1.getCustomObjects
|
|
53
|
+
},
|
|
54
|
+
perform: (request, data) => {
|
|
55
|
+
const payload = {
|
|
56
|
+
type: 'group',
|
|
57
|
+
objectType: data.payload.objectType,
|
|
58
|
+
properties: {
|
|
59
|
+
...(data.payload.objectData || {}),
|
|
60
|
+
externalId: data.payload.externalId,
|
|
61
|
+
id: data.payload.id
|
|
62
|
+
},
|
|
63
|
+
user: {
|
|
64
|
+
email: data.payload.email,
|
|
65
|
+
userId: data.payload.userId
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return request(utils_1.enchargeIngestAPIURL, {
|
|
69
|
+
method: 'post',
|
|
70
|
+
json: payload
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.default = action;
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/createUpdateObject/index.ts"],"names":[],"mappings":";;AAGA,oCAA+C;AAC/C,yDAAqD;AAErD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,iOAAiO;IACnO,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,SAAS;SACnB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,wFAAwF;YACrG,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;SAClC;QACD,EAAE,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,oFAAoF;YACjG,KAAK,EAAE,WAAW;SACnB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,WAAW,EACT,2GAA2G;YAC7G,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mIAAmI;YACrI,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,iIAAiI;YACnI,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SAChC;KACF;IACD,aAAa,EAAE;QACb,UAAU,EAAE,mCAAgB;KAC7B;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;YACnC,UAAU,EAAE;gBACV,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;gBAClC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;gBACnC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;aACpB;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;gBACzB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;aAC5B;SACF,CAAA;QACD,OAAO,OAAO,CAAC,4BAAoB,EAAE;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteUser = void 0;
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
const deleteUser = async (request, { payload }) => {
|
|
6
|
+
const userId = payload.userId;
|
|
7
|
+
const segmentAnonymousId = payload.anonymousId;
|
|
8
|
+
let query = '';
|
|
9
|
+
if (userId) {
|
|
10
|
+
query = `people[0][userId]=${userId}`;
|
|
11
|
+
}
|
|
12
|
+
else if (segmentAnonymousId) {
|
|
13
|
+
query = `people[0][segmentAnonymousId]=${segmentAnonymousId}`;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return request(`${utils_1.enchargeRestAPIBase}/v1/people?${query}`, {
|
|
19
|
+
method: 'DELETE'
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.deleteUser = deleteUser;
|
|
23
|
+
//# sourceMappingURL=deleteUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteUser.js","sourceRoot":"","sources":["../../../src/destinations/encharge/deleteUser.ts"],"names":[],"mappings":";;;AACA,mCAA6C;AAGtC,MAAM,UAAU,GAAgD,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IAGpG,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC7B,MAAM,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAA;IAC9C,IAAI,KAAK,GAAG,EAAE,CAAA;IACd,IAAI,MAAM,EAAE;QACV,KAAK,GAAG,qBAAqB,MAAM,EAAE,CAAA;KACtC;SAAM,IAAI,kBAAkB,EAAE;QAC7B,KAAK,GAAG,iCAAiC,kBAAkB,EAAE,CAAA;KAC9D;SAAM;QAEL,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,OAAO,CAAC,GAAG,2BAAmB,cAAc,KAAK,EAAE,EAAE;QAC1D,MAAM,EAAE,QAAQ;KACjB,CAAC,CAAA;AACJ,CAAC,CAAA;AAjBY,QAAA,UAAU,cAiBtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/encharge/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
user?: {
|
|
3
|
+
[k: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
type: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
segmentAnonymousId?: string;
|
|
8
|
+
userId?: string;
|
|
9
|
+
groupId?: string;
|
|
10
|
+
timestamp?: string;
|
|
11
|
+
messageId?: string;
|
|
12
|
+
ip?: string;
|
|
13
|
+
userAgent?: string;
|
|
14
|
+
campaign?: {
|
|
15
|
+
name?: string;
|
|
16
|
+
source?: string;
|
|
17
|
+
medium?: string;
|
|
18
|
+
term?: string;
|
|
19
|
+
content?: string;
|
|
20
|
+
};
|
|
21
|
+
page?: {
|
|
22
|
+
url?: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
referrer?: string;
|
|
25
|
+
path?: string;
|
|
26
|
+
search?: string;
|
|
27
|
+
};
|
|
28
|
+
location?: {
|
|
29
|
+
city?: string;
|
|
30
|
+
region?: string;
|
|
31
|
+
country?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/identifyUser/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
7
|
+
const pick_1 = __importDefault(require("lodash/pick"));
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const common_definitions_1 = require("../common-definitions");
|
|
10
|
+
const action = {
|
|
11
|
+
title: 'Identify User',
|
|
12
|
+
description: 'Identify a user in Encharge. This will create a new user if the user does not exist in Encharge.',
|
|
13
|
+
fields: {
|
|
14
|
+
user: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
label: 'User Fields',
|
|
17
|
+
description: 'Fields to associate with the user in Encharge. Any unexisting fields will be automatically created in Encharge.',
|
|
18
|
+
required: false,
|
|
19
|
+
default: { '@path': '$.traits' }
|
|
20
|
+
},
|
|
21
|
+
...common_definitions_1.commonFields
|
|
22
|
+
},
|
|
23
|
+
defaultSubscription: 'type = "identify"',
|
|
24
|
+
perform: (request, data) => {
|
|
25
|
+
const payload = {
|
|
26
|
+
...omit_1.default(data.payload, ['ip', 'userAgent', 'campaign', 'page', 'location', 'user', 'groupId']),
|
|
27
|
+
context: pick_1.default(data.payload, ['ip', 'userAgent', 'campaign', 'page', 'location', 'groupId']),
|
|
28
|
+
user: {
|
|
29
|
+
email: data.payload.email,
|
|
30
|
+
userId: data.payload.userId,
|
|
31
|
+
segmentAnonymousId: data.payload.segmentAnonymousId,
|
|
32
|
+
...(data.payload.user || {})
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return request(utils_1.enchargeIngestAPIURL, {
|
|
36
|
+
method: 'post',
|
|
37
|
+
json: payload
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.default = action;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/identifyUser/index.ts"],"names":[],"mappings":";;;;;AAGA,uDAA8B;AAC9B,uDAA8B;AAC9B,oCAA+C;AAC/C,8DAAoD;AAEpD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kGAAkG;IAC/G,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,aAAa;YACpB,WAAW,EACT,iHAAiH;YACnH,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,GAAG,iCAAY;KAChB;IACD,mBAAmB,EAAE,mBAAmB;IACxC,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG;YACd,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;YAC7F,OAAO,EAAE,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YAC3F,IAAI,EAAE;gBACJ,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;gBACzB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;gBAC3B,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB;gBACnD,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;aAC7B;SACF,CAAA;QACD,OAAO,OAAO,CAAC,4BAAoB,EAAE;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const deleteUser_1 = require("./deleteUser");
|
|
9
|
+
const trackEvent_1 = __importDefault(require("./trackEvent"));
|
|
10
|
+
const identifyUser_1 = __importDefault(require("./identifyUser"));
|
|
11
|
+
const trackPageView_1 = __importDefault(require("./trackPageView"));
|
|
12
|
+
const aliasUser_1 = __importDefault(require("./aliasUser"));
|
|
13
|
+
const createUpdateObject_1 = __importDefault(require("./createUpdateObject"));
|
|
14
|
+
const addTag_1 = __importDefault(require("./addTag"));
|
|
15
|
+
const removeTag_1 = __importDefault(require("./removeTag"));
|
|
16
|
+
const destination = {
|
|
17
|
+
name: 'Encharge Cloud (Actions)',
|
|
18
|
+
slug: 'encharge-cloud-actions',
|
|
19
|
+
mode: 'cloud',
|
|
20
|
+
authentication: {
|
|
21
|
+
scheme: 'custom',
|
|
22
|
+
fields: {
|
|
23
|
+
apiKey: {
|
|
24
|
+
description: 'Encharge.io API Key. This can be found on your [Account page](https://app.encharge.io/settings/api-keys).',
|
|
25
|
+
label: 'API Key',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
testAuthentication: (request) => {
|
|
31
|
+
return request(`${utils_1.enchargeRestAPIBase}/v1/accounts/info`);
|
|
32
|
+
},
|
|
33
|
+
extendRequest: ({ settings }) => {
|
|
34
|
+
return {
|
|
35
|
+
headers: {
|
|
36
|
+
'X-Encharge-Token': settings.apiKey,
|
|
37
|
+
'Content-Type': 'application/json',
|
|
38
|
+
'X-Segment-Actions': '1'
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
onDelete: deleteUser_1.deleteUser,
|
|
44
|
+
description: 'Encharge is a marketing automation platform that enables B2B SaaS companies to automate their marketing processes to increase customer engagement, retention, and revenue.',
|
|
45
|
+
presets: [
|
|
46
|
+
{
|
|
47
|
+
partnerAction: 'trackEvent',
|
|
48
|
+
name: 'Track Event',
|
|
49
|
+
subscribe: 'type = "track"',
|
|
50
|
+
mapping: actions_core_1.defaultValues(trackEvent_1.default.fields)
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
partnerAction: 'identifyUser',
|
|
54
|
+
name: 'Identify User',
|
|
55
|
+
subscribe: 'type = "identify"',
|
|
56
|
+
mapping: actions_core_1.defaultValues(identifyUser_1.default.fields)
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
partnerAction: 'trackPageView',
|
|
60
|
+
name: 'Track Page View',
|
|
61
|
+
subscribe: 'type = "page"',
|
|
62
|
+
mapping: actions_core_1.defaultValues(trackPageView_1.default.fields)
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
partnerAction: 'aliasUser',
|
|
66
|
+
name: 'Alias User',
|
|
67
|
+
subscribe: 'type = "alias"',
|
|
68
|
+
mapping: actions_core_1.defaultValues(aliasUser_1.default.fields)
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
partnerAction: 'createUpdateObject',
|
|
72
|
+
name: 'Create or Update Object',
|
|
73
|
+
subscribe: 'type = "group"',
|
|
74
|
+
mapping: actions_core_1.defaultValues(createUpdateObject_1.default.fields)
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
actions: {
|
|
78
|
+
trackEvent: trackEvent_1.default,
|
|
79
|
+
identifyUser: identifyUser_1.default,
|
|
80
|
+
trackPageView: trackPageView_1.default,
|
|
81
|
+
aliasUser: aliasUser_1.default,
|
|
82
|
+
createUpdateObject: createUpdateObject_1.default,
|
|
83
|
+
addTag: addTag_1.default,
|
|
84
|
+
removeTag: removeTag_1.default
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
exports.default = destination;
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/encharge/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAG5E,mCAA6C;AAC7C,6CAAyC;AAEzC,8DAAqC;AACrC,kEAAyC;AACzC,oEAA2C;AAC3C,4DAAmC;AACnC,8EAAqD;AAErD,sDAA6B;AAE7B,4DAAmC;AAEnC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QAEd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,WAAW,EACT,2GAA2G;gBAC7G,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,GAAG,2BAAmB,mBAAmB,CAAC,CAAA;QAC3D,CAAC;QACD,aAAa,EAAE,CAAC,EAAE,QAAQ,EAA0B,EAAE,EAAE;YACtD,OAAO;gBACL,OAAO,EAAE;oBACP,kBAAkB,EAAE,QAAQ,CAAC,MAAM;oBACnC,cAAc,EAAE,kBAAkB;oBAClC,mBAAmB,EAAE,GAAG;iBACzB;aACF,CAAA;QACH,CAAC;KACF;IAED,QAAQ,EAAE,uBAAU;IACpB,WAAW,EACT,4KAA4K;IAC9K,OAAO,EAAE;QACP;YACE,aAAa,EAAE,YAAY;YAC3B,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,gBAAgB;YAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;SAC1C;QACD;YACE,aAAa,EAAE,cAAc;YAC7B,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,mBAAmB;YAC9B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;SAC5C;QACD;YACE,aAAa,EAAE,eAAe;YAC9B,IAAI,EAAE,iBAAiB;YACvB,SAAS,EAAE,eAAe;YAC1B,OAAO,EAAE,4BAAa,CAAC,uBAAa,CAAC,MAAM,CAAC;SAC7C;QACD;YACE,aAAa,EAAE,WAAW;YAC1B,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,gBAAgB;YAC3B,OAAO,EAAE,4BAAa,CAAC,mBAAS,CAAC,MAAM,CAAC;SACzC;QACD;YACE,aAAa,EAAE,oBAAoB;YACnC,IAAI,EAAE,yBAAyB;YAC/B,SAAS,EAAE,gBAAgB;YAC3B,OAAO,EAAE,4BAAa,CAAC,4BAAkB,CAAC,MAAM,CAAC;SAClD;KACF;IAED,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;QACZ,aAAa,EAAb,uBAAa;QACb,SAAS,EAAT,mBAAS;QACT,kBAAkB,EAAlB,4BAAkB;QAClB,MAAM,EAAN,gBAAM;QACN,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/removeTag/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const pick_1 = __importDefault(require("lodash/pick"));
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const common_definitions_1 = require("../common-definitions");
|
|
10
|
+
const action = {
|
|
11
|
+
title: 'Untag User',
|
|
12
|
+
description: 'Remove tags from a user in Encharge.',
|
|
13
|
+
fields: {
|
|
14
|
+
tag: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'The tags to remove, separated by commas.',
|
|
18
|
+
label: 'Tag',
|
|
19
|
+
default: { '@path': '$.traits.tag' }
|
|
20
|
+
},
|
|
21
|
+
...pick_1.default(common_definitions_1.commonFields, ['email', 'userId', 'segmentAnonymousId'])
|
|
22
|
+
},
|
|
23
|
+
perform: (request, data) => {
|
|
24
|
+
if (!data.payload.email && !data.payload.userId && !data.payload.segmentAnonymousId) {
|
|
25
|
+
throw new actions_core_1.PayloadValidationError('No user ID, email, or anonymous ID provided.');
|
|
26
|
+
}
|
|
27
|
+
if (!data.payload.tag?.length) {
|
|
28
|
+
throw new actions_core_1.PayloadValidationError('Missing tag.');
|
|
29
|
+
}
|
|
30
|
+
return request(`${utils_1.enchargeRestAPIBase}/v1/tags`, {
|
|
31
|
+
method: 'delete',
|
|
32
|
+
json: data.payload
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.default = action;
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/removeTag/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgF;AAIhF,uDAA8B;AAC9B,oCAA8C;AAC9C,8DAAoD;AAEpD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,sCAAsC;IACnD,MAAM,EAAE;QACN,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,0CAA0C;YACvD,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;QACD,GAAG,cAAI,CAAC,iCAAY,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC;KACjE;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE;YACnF,MAAM,IAAI,qCAAsB,CAAC,8CAA8C,CAAC,CAAA;SACjF;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE;YAC7B,MAAM,IAAI,qCAAsB,CAAC,cAAc,CAAC,CAAA;SACjD;QACD,OAAO,OAAO,CAAC,GAAG,2BAAmB,UAAU,EAAE;YAC/C,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,IAAI,CAAC,OAAO;SACnB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event: string;
|
|
3
|
+
properties?: {
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
userFields?: {
|
|
7
|
+
[k: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
type: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
segmentAnonymousId?: string;
|
|
12
|
+
userId?: string;
|
|
13
|
+
groupId?: string;
|
|
14
|
+
timestamp?: string;
|
|
15
|
+
messageId?: string;
|
|
16
|
+
ip?: string;
|
|
17
|
+
userAgent?: string;
|
|
18
|
+
campaign?: {
|
|
19
|
+
name?: string;
|
|
20
|
+
source?: string;
|
|
21
|
+
medium?: string;
|
|
22
|
+
term?: string;
|
|
23
|
+
content?: string;
|
|
24
|
+
};
|
|
25
|
+
page?: {
|
|
26
|
+
url?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
referrer?: string;
|
|
29
|
+
path?: string;
|
|
30
|
+
search?: string;
|
|
31
|
+
};
|
|
32
|
+
location?: {
|
|
33
|
+
city?: string;
|
|
34
|
+
region?: string;
|
|
35
|
+
country?: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/trackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
7
|
+
const pick_1 = __importDefault(require("lodash/pick"));
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const common_definitions_1 = require("../common-definitions");
|
|
10
|
+
const action = {
|
|
11
|
+
title: 'Track Event',
|
|
12
|
+
description: 'Track an event in Encharge for a known or anonymous person.',
|
|
13
|
+
defaultSubscription: 'type = "track"',
|
|
14
|
+
fields: {
|
|
15
|
+
event: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'The name of the event.',
|
|
19
|
+
label: 'Event Name',
|
|
20
|
+
default: { '@path': '$.event' }
|
|
21
|
+
},
|
|
22
|
+
...common_definitions_1.propertiesDefinition,
|
|
23
|
+
...common_definitions_1.userFieldsDefinition,
|
|
24
|
+
...common_definitions_1.commonFields
|
|
25
|
+
},
|
|
26
|
+
perform: (request, data) => {
|
|
27
|
+
const payload = {
|
|
28
|
+
...omit_1.default(data.payload, ['ip', 'userAgent', 'campaign', 'page', 'location', 'user', 'groupId']),
|
|
29
|
+
context: pick_1.default(data.payload, ['ip', 'userAgent', 'campaign', 'page', 'location', 'groupId']),
|
|
30
|
+
user: {
|
|
31
|
+
email: data.payload.email,
|
|
32
|
+
userId: data.payload.userId,
|
|
33
|
+
segmentAnonymousId: data.payload.segmentAnonymousId,
|
|
34
|
+
...(data.payload.userFields || {})
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return request(utils_1.enchargeIngestAPIURL, {
|
|
38
|
+
method: 'post',
|
|
39
|
+
json: payload
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.default = action;
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAIA,uDAA8B;AAC9B,uDAA8B;AAC9B,oCAA+C;AAC/C,8DAAgG;AAEhG,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,6DAA6D;IAC1E,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wBAAwB;YACrC,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SAChC;QACD,GAAG,yCAAoB;QACvB,GAAG,yCAAoB;QACvB,GAAG,iCAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG;YACd,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;YAC7F,OAAO,EAAE,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YAC3F,IAAI,EAAE;gBACJ,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;gBACzB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;gBAC3B,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB;gBACnD,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;aACnC;SACF,CAAA;QACD,OAAO,OAAO,CAAC,4BAAoB,EAAE;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
properties?: {
|
|
3
|
+
[k: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
userFields?: {
|
|
6
|
+
[k: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
type: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
segmentAnonymousId?: string;
|
|
11
|
+
userId?: string;
|
|
12
|
+
groupId?: string;
|
|
13
|
+
timestamp?: string;
|
|
14
|
+
messageId?: string;
|
|
15
|
+
ip?: string;
|
|
16
|
+
userAgent?: string;
|
|
17
|
+
campaign?: {
|
|
18
|
+
name?: string;
|
|
19
|
+
source?: string;
|
|
20
|
+
medium?: string;
|
|
21
|
+
term?: string;
|
|
22
|
+
content?: string;
|
|
23
|
+
};
|
|
24
|
+
page?: {
|
|
25
|
+
url?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
referrer?: string;
|
|
28
|
+
path?: string;
|
|
29
|
+
search?: string;
|
|
30
|
+
};
|
|
31
|
+
location?: {
|
|
32
|
+
city?: string;
|
|
33
|
+
region?: string;
|
|
34
|
+
country?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/trackPageView/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
7
|
+
const pick_1 = __importDefault(require("lodash/pick"));
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const common_definitions_1 = require("../common-definitions");
|
|
10
|
+
const action = {
|
|
11
|
+
title: 'Track Page View',
|
|
12
|
+
description: 'Track a website page visit.',
|
|
13
|
+
defaultSubscription: 'type = "page"',
|
|
14
|
+
fields: {
|
|
15
|
+
properties: {
|
|
16
|
+
...common_definitions_1.propertiesDefinition.properties,
|
|
17
|
+
description: "Custom properties to send with the pageview. Please note that URL, title, refererrer, path and search are automatically collected and don't have to be mapped here.",
|
|
18
|
+
label: 'Page View Properties'
|
|
19
|
+
},
|
|
20
|
+
...common_definitions_1.userFieldsDefinition,
|
|
21
|
+
...common_definitions_1.commonFields
|
|
22
|
+
},
|
|
23
|
+
perform: (request, data) => {
|
|
24
|
+
const payload = {
|
|
25
|
+
...omit_1.default(data.payload, ['ip', 'userAgent', 'campaign', 'page', 'location', 'user', 'groupId']),
|
|
26
|
+
context: pick_1.default(data.payload, ['ip', 'userAgent', 'campaign', 'page', 'location', 'groupId']),
|
|
27
|
+
user: {
|
|
28
|
+
email: data.payload.email,
|
|
29
|
+
userId: data.payload.userId,
|
|
30
|
+
segmentAnonymousId: data.payload.segmentAnonymousId,
|
|
31
|
+
...(data.payload.userFields || {})
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return request(utils_1.enchargeIngestAPIURL, {
|
|
35
|
+
method: 'post',
|
|
36
|
+
json: payload
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.default = action;
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/encharge/trackPageView/index.ts"],"names":[],"mappings":";;;;;AAGA,uDAA8B;AAC9B,uDAA8B;AAC9B,oCAA+C;AAC/C,8DAAgG;AAEhG,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,6BAA6B;IAC1C,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,UAAU,EAAE;YACV,GAAG,yCAAoB,CAAC,UAAU;YAClC,WAAW,EACT,qKAAqK;YACvK,KAAK,EAAE,sBAAsB;SAC9B;QACD,GAAG,yCAAoB;QACvB,GAAG,iCAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG;YACd,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;YAC7F,OAAO,EAAE,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YAC3F,IAAI,EAAE;gBACJ,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;gBACzB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;gBAC3B,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB;gBACnD,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;aACnC;SACF,CAAA;QACD,OAAO,OAAO,CAAC,4BAAoB,EAAE;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enchargeRestAPIBase = exports.enchargeIngestAPIURL = exports.enchargeIngestAPIBase = void 0;
|
|
4
|
+
exports.enchargeIngestAPIBase = process.env.NODE_ENV === 'development' ? 'https://localhost:3005' : 'https://ingest.encharge.io';
|
|
5
|
+
exports.enchargeIngestAPIURL = `${exports.enchargeIngestAPIBase}/v1`;
|
|
6
|
+
exports.enchargeRestAPIBase = 'https://api.encharge.io';
|
|
7
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/encharge/utils.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,4BAA4B,CAAA;AAErF,QAAA,oBAAoB,GAAG,GAAG,6BAAqB,KAAK,CAAA;AAEpD,QAAA,mBAAmB,GAAG,yBAAyB,CAAA"}
|
|
@@ -92,6 +92,8 @@ register('6411f979382d3759292d739f', './gwen');
|
|
|
92
92
|
register('6419fbec071f03f0e4887a7f', './acoustic');
|
|
93
93
|
register('6419fc9da58e84c112de12c3', './revend');
|
|
94
94
|
register('6419fce5b6e12cf44efbd34c', './june');
|
|
95
|
+
register('642440d46b66b3eeac42b581', './encharge');
|
|
96
|
+
register('64244158b33d1380a79dc85c', './blend-ai');
|
|
95
97
|
function register(id, destinationPath) {
|
|
96
98
|
const definition = require(destinationPath).default;
|
|
97
99
|
const resolvedPath = require.resolve(destinationPath);
|