@segment/action-destinations 3.45.0 → 3.46.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/friendbuy/cloudUtil.d.ts +4 -4
- package/dist/destinations/friendbuy/cloudUtil.js +31 -15
- package/dist/destinations/friendbuy/cloudUtil.js.map +1 -1
- package/dist/destinations/friendbuy/index.js +2 -2
- package/dist/destinations/friendbuy/index.js.map +1 -1
- package/dist/destinations/friendbuy/trackCustomEvent/generated-types.d.ts +1 -0
- package/dist/destinations/friendbuy/trackCustomEvent/index.js +8 -5
- package/dist/destinations/friendbuy/trackCustomEvent/index.js.map +1 -1
- package/dist/destinations/friendbuy/trackCustomer/index.js +4 -3
- package/dist/destinations/friendbuy/trackCustomer/index.js.map +1 -1
- package/dist/destinations/friendbuy/trackPurchase/generated-types.d.ts +2 -0
- package/dist/destinations/friendbuy/trackPurchase/index.js +29 -29
- package/dist/destinations/friendbuy/trackPurchase/index.js.map +1 -1
- package/dist/destinations/friendbuy/trackSignUp/generated-types.d.ts +3 -0
- package/dist/destinations/friendbuy/trackSignUp/index.js +7 -3
- package/dist/destinations/friendbuy/trackSignUp/index.js.map +1 -1
- package/dist/destinations/gainsight-px-cloud-action/common-fields.d.ts +2 -0
- package/dist/destinations/gainsight-px-cloud-action/common-fields.js +277 -0
- package/dist/destinations/gainsight-px-cloud-action/common-fields.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/generated-types.d.ts +4 -0
- package/dist/destinations/gainsight-px-cloud-action/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/generated-types.d.ts +60 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/index.d.ts +5 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/index.js +38 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/index.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/generated-types.d.ts +59 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/index.d.ts +5 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/index.js +29 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/index.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/index.d.ts +4 -0
- package/dist/destinations/gainsight-px-cloud-action/index.js +100 -0
- package/dist/destinations/gainsight-px-cloud-action/index.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.d.ts +12 -0
- package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.js +19 -0
- package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/generated-types.d.ts +60 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/index.d.ts +5 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/index.js +37 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/index.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/generated-types.d.ts +63 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/index.d.ts +5 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/index.js +60 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/index.js.map +1 -0
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/package.json +4 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/gainsight-px-cloud-action/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
groupId: string;
|
|
3
|
+
traits: {
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
anonymousId?: string | null;
|
|
7
|
+
context: {
|
|
8
|
+
campaign?: {
|
|
9
|
+
source?: string;
|
|
10
|
+
medium?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
term?: string;
|
|
13
|
+
content?: string;
|
|
14
|
+
};
|
|
15
|
+
location?: {
|
|
16
|
+
city?: string;
|
|
17
|
+
country?: string;
|
|
18
|
+
latitude?: number;
|
|
19
|
+
longitude?: number;
|
|
20
|
+
region?: string;
|
|
21
|
+
speed?: number;
|
|
22
|
+
};
|
|
23
|
+
page?: {
|
|
24
|
+
path?: string;
|
|
25
|
+
referrer?: string;
|
|
26
|
+
search?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
url?: string;
|
|
29
|
+
};
|
|
30
|
+
screen?: {
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
};
|
|
34
|
+
app?: {
|
|
35
|
+
name?: string;
|
|
36
|
+
version?: string;
|
|
37
|
+
build?: string;
|
|
38
|
+
};
|
|
39
|
+
device?: {
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
network?: {
|
|
43
|
+
[k: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
library?: {
|
|
46
|
+
name?: string;
|
|
47
|
+
version?: string;
|
|
48
|
+
};
|
|
49
|
+
ip?: string;
|
|
50
|
+
locale?: string;
|
|
51
|
+
userAgent?: string;
|
|
52
|
+
};
|
|
53
|
+
messageId: string;
|
|
54
|
+
receivedAt: string | number;
|
|
55
|
+
sentAt: string | number;
|
|
56
|
+
timestamp: string | number;
|
|
57
|
+
userId: string | null;
|
|
58
|
+
type: string;
|
|
59
|
+
version?: number | null;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/gainsight-px-cloud-action/groupIdentify/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const regional_endpoints_1 = require("../regional-endpoints");
|
|
4
|
+
const common_fields_1 = require("../common-fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Group Identify User',
|
|
7
|
+
description: 'Updates or adds properties to an account. The account is created if it does not exist.',
|
|
8
|
+
defaultSubscription: 'type = "group"',
|
|
9
|
+
fields: {
|
|
10
|
+
groupId: {
|
|
11
|
+
label: 'Account ID',
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: 'The unique identifier of the account.',
|
|
14
|
+
required: true,
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.groupId'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
traits: {
|
|
20
|
+
label: 'User Properties',
|
|
21
|
+
type: 'object',
|
|
22
|
+
description: 'Properties to set on the user profile',
|
|
23
|
+
required: true,
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.traits'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
...common_fields_1.commonFields
|
|
29
|
+
},
|
|
30
|
+
perform: (request, { payload, settings }) => {
|
|
31
|
+
return request(regional_endpoints_1.getEndpointByRegion('track', settings.dataCenter), {
|
|
32
|
+
method: 'post',
|
|
33
|
+
json: payload
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.default = action;
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/gainsight-px-cloud-action/groupIdentify/index.ts"],"names":[],"mappings":";;AAGA,8DAA2D;AAC3D,oDAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,wFAAwF;IACrG,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,GAAG,4BAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAE1C,OAAO,OAAO,CAAC,wCAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE;YAChE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
traits: {
|
|
3
|
+
[k: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
anonymousId?: string | null;
|
|
6
|
+
context: {
|
|
7
|
+
campaign?: {
|
|
8
|
+
source?: string;
|
|
9
|
+
medium?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
term?: string;
|
|
12
|
+
content?: string;
|
|
13
|
+
};
|
|
14
|
+
location?: {
|
|
15
|
+
city?: string;
|
|
16
|
+
country?: string;
|
|
17
|
+
latitude?: number;
|
|
18
|
+
longitude?: number;
|
|
19
|
+
region?: string;
|
|
20
|
+
speed?: number;
|
|
21
|
+
};
|
|
22
|
+
page?: {
|
|
23
|
+
path?: string;
|
|
24
|
+
referrer?: string;
|
|
25
|
+
search?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
url?: string;
|
|
28
|
+
};
|
|
29
|
+
screen?: {
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
};
|
|
33
|
+
app?: {
|
|
34
|
+
name?: string;
|
|
35
|
+
version?: string;
|
|
36
|
+
build?: string;
|
|
37
|
+
};
|
|
38
|
+
device?: {
|
|
39
|
+
[k: string]: unknown;
|
|
40
|
+
};
|
|
41
|
+
network?: {
|
|
42
|
+
[k: string]: unknown;
|
|
43
|
+
};
|
|
44
|
+
library?: {
|
|
45
|
+
name?: string;
|
|
46
|
+
version?: string;
|
|
47
|
+
};
|
|
48
|
+
ip?: string;
|
|
49
|
+
locale?: string;
|
|
50
|
+
userAgent?: string;
|
|
51
|
+
};
|
|
52
|
+
messageId: string;
|
|
53
|
+
receivedAt: string | number;
|
|
54
|
+
sentAt: string | number;
|
|
55
|
+
timestamp: string | number;
|
|
56
|
+
userId: string | null;
|
|
57
|
+
type: string;
|
|
58
|
+
version?: number | null;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/gainsight-px-cloud-action/identifyUser/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const regional_endpoints_1 = require("../regional-endpoints");
|
|
4
|
+
const common_fields_1 = require("../common-fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Identify User',
|
|
7
|
+
description: 'Set the user ID for a particular device ID or update user properties',
|
|
8
|
+
defaultSubscription: 'type = "identify"',
|
|
9
|
+
fields: {
|
|
10
|
+
traits: {
|
|
11
|
+
label: 'User Properties',
|
|
12
|
+
type: 'object',
|
|
13
|
+
description: 'Properties to set on the user profile',
|
|
14
|
+
required: true,
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.traits'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
...common_fields_1.commonFields
|
|
20
|
+
},
|
|
21
|
+
perform: (request, { payload, settings }) => {
|
|
22
|
+
return request(regional_endpoints_1.getEndpointByRegion('track', settings.dataCenter), {
|
|
23
|
+
method: 'post',
|
|
24
|
+
json: payload
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.default = action;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/gainsight-px-cloud-action/identifyUser/index.ts"],"names":[],"mappings":";;AAGA,8DAA2D;AAC3D,oDAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,sEAAsE;IACnF,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,GAAG,4BAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAE1C,OAAO,OAAO,CAAC,wCAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE;YAChE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
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 actions_core_2 = require("@segment/actions-core");
|
|
8
|
+
const regional_endpoints_1 = require("./regional-endpoints");
|
|
9
|
+
const identifyUser_1 = __importDefault(require("./identifyUser"));
|
|
10
|
+
const groupIdentify_1 = __importDefault(require("./groupIdentify"));
|
|
11
|
+
const trackEvent_1 = __importDefault(require("./trackEvent"));
|
|
12
|
+
const trackPageView_1 = __importDefault(require("./trackPageView"));
|
|
13
|
+
const presets = [
|
|
14
|
+
{
|
|
15
|
+
name: 'Identify User',
|
|
16
|
+
subscribe: 'type = "identify"',
|
|
17
|
+
partnerAction: 'identifyUser',
|
|
18
|
+
mapping: actions_core_2.defaultValues(identifyUser_1.default.fields)
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Group User',
|
|
22
|
+
subscribe: 'type = "group"',
|
|
23
|
+
partnerAction: 'groupIdentify',
|
|
24
|
+
mapping: actions_core_2.defaultValues(groupIdentify_1.default.fields)
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Track Event',
|
|
28
|
+
subscribe: 'type = "track"',
|
|
29
|
+
partnerAction: 'trackEvent',
|
|
30
|
+
mapping: actions_core_2.defaultValues(trackEvent_1.default.fields)
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Track Page View',
|
|
34
|
+
subscribe: 'type = "page"',
|
|
35
|
+
partnerAction: 'trackPageView',
|
|
36
|
+
mapping: actions_core_2.defaultValues(trackPageView_1.default.fields)
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
const destination = {
|
|
40
|
+
name: 'Gainsight Px Cloud (Actions)',
|
|
41
|
+
slug: 'actions-gainsight-px-cloud',
|
|
42
|
+
mode: 'cloud',
|
|
43
|
+
authentication: {
|
|
44
|
+
scheme: 'basic',
|
|
45
|
+
fields: {
|
|
46
|
+
apiKey: {
|
|
47
|
+
label: 'API Key',
|
|
48
|
+
description: 'Gainsight PX API key. You can find this key in the "Administration/Products" screen.',
|
|
49
|
+
type: 'string',
|
|
50
|
+
required: true
|
|
51
|
+
},
|
|
52
|
+
dataCenter: {
|
|
53
|
+
label: 'Data center',
|
|
54
|
+
description: 'The PX data center where your PX subscription is hosted.',
|
|
55
|
+
type: 'string',
|
|
56
|
+
format: 'text',
|
|
57
|
+
required: true,
|
|
58
|
+
choices: [
|
|
59
|
+
{
|
|
60
|
+
label: 'North America',
|
|
61
|
+
value: 'north_america'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'Europe',
|
|
65
|
+
value: 'europe'
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
testAuthentication: async (request, { settings }) => {
|
|
71
|
+
const endpoint = regional_endpoints_1.getEndpointByRegion('track', settings.dataCenter);
|
|
72
|
+
const response = await request(endpoint, {
|
|
73
|
+
method: 'post',
|
|
74
|
+
username: settings.apiKey,
|
|
75
|
+
password: '',
|
|
76
|
+
json: [],
|
|
77
|
+
throwHttpErrors: false
|
|
78
|
+
});
|
|
79
|
+
if (response.status === 400) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
throw new actions_core_1.IntegrationError('Invalid API key', 'Invalid API Key', 401);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
extendRequest({ settings }) {
|
|
86
|
+
return {
|
|
87
|
+
username: settings.apiKey,
|
|
88
|
+
password: ''
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
presets,
|
|
92
|
+
actions: {
|
|
93
|
+
identifyUser: identifyUser_1.default,
|
|
94
|
+
groupIdentify: groupIdentify_1.default,
|
|
95
|
+
trackEvent: trackEvent_1.default,
|
|
96
|
+
trackPageView: trackPageView_1.default
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
exports.default = destination;
|
|
100
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/gainsight-px-cloud-action/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAwD;AAExD,wDAAqD;AAErD,6DAA0D;AAC1D,kEAAyC;AACzC,oEAA2C;AAC3C,8DAAqC;AACrC,oEAA2C;AAG3C,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,mBAAmB;QAC9B,aAAa,EAAE,cAAc;QAC7B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;KAC5C;IACD;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,eAAe;QAC9B,OAAO,EAAE,4BAAa,CAAC,uBAAa,CAAC,MAAM,CAAC;KAC7C;IACD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,eAAe;QAC9B,OAAO,EAAE,4BAAa,CAAC,uBAAa,CAAC,MAAM,CAAC;KAC7C;CACF,CAAA;AAED,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,sFAAsF;gBACnG,IAAI,EAAE,QAAQ;gBACd,Q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
2
|
+
track: {
|
|
3
|
+
north_america: string;
|
|
4
|
+
europe: string;
|
|
5
|
+
};
|
|
6
|
+
batch: {
|
|
7
|
+
north_america: string;
|
|
8
|
+
europe: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function getEndpointByRegion(endpoint: keyof typeof endpoints, region?: string): string;
|
|
12
|
+
export default endpoints;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEndpointByRegion = exports.endpoints = void 0;
|
|
4
|
+
exports.endpoints = {
|
|
5
|
+
track: {
|
|
6
|
+
north_america: 'https://segment-esp.aptrinsic.com/rte/segmentio/v1/push',
|
|
7
|
+
europe: 'https://segment-esp-eu.aptrinsic.com/rte/segmentio/v1/push'
|
|
8
|
+
},
|
|
9
|
+
batch: {
|
|
10
|
+
north_america: 'https://segment-esp.aptrinsic.com/rte/segmentio/v1/batch',
|
|
11
|
+
europe: 'https://segment-esp-eu.aptrinsic.com/rte/segmentio/v1/batch'
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
function getEndpointByRegion(endpoint, region) {
|
|
15
|
+
return exports.endpoints[endpoint][region] ?? exports.endpoints[endpoint]['north_america'];
|
|
16
|
+
}
|
|
17
|
+
exports.getEndpointByRegion = getEndpointByRegion;
|
|
18
|
+
exports.default = exports.endpoints;
|
|
19
|
+
//# sourceMappingURL=regional-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regional-endpoints.js","sourceRoot":"","sources":["../../../src/destinations/gainsight-px-cloud-action/regional-endpoints.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE;QACL,aAAa,EAAE,yDAAyD;QACxE,MAAM,EAAE,4DAA4D;KACrE;IACD,KAAK,EAAE;QACL,aAAa,EAAE,0DAA0D;QACzE,MAAM,EAAE,6DAA6D;KACtE;CACF,CAAA;AAYD,SAAgB,mBAAmB,CAAC,QAAgC,EAAE,MAAe;IACnF,OAAO,iBAAS,CAAC,QAAQ,CAAC,CAAC,MAAgB,CAAC,IAAI,iBAAS,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAA;AACtF,CAAC;AAFD,kDAEC;AAED,kBAAe,iBAAS,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event: string;
|
|
3
|
+
properties?: {
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
anonymousId?: string | null;
|
|
7
|
+
context: {
|
|
8
|
+
campaign?: {
|
|
9
|
+
source?: string;
|
|
10
|
+
medium?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
term?: string;
|
|
13
|
+
content?: string;
|
|
14
|
+
};
|
|
15
|
+
location?: {
|
|
16
|
+
city?: string;
|
|
17
|
+
country?: string;
|
|
18
|
+
latitude?: number;
|
|
19
|
+
longitude?: number;
|
|
20
|
+
region?: string;
|
|
21
|
+
speed?: number;
|
|
22
|
+
};
|
|
23
|
+
page?: {
|
|
24
|
+
path?: string;
|
|
25
|
+
referrer?: string;
|
|
26
|
+
search?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
url?: string;
|
|
29
|
+
};
|
|
30
|
+
screen?: {
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
};
|
|
34
|
+
app?: {
|
|
35
|
+
name?: string;
|
|
36
|
+
version?: string;
|
|
37
|
+
build?: string;
|
|
38
|
+
};
|
|
39
|
+
device?: {
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
network?: {
|
|
43
|
+
[k: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
library?: {
|
|
46
|
+
name?: string;
|
|
47
|
+
version?: string;
|
|
48
|
+
};
|
|
49
|
+
ip?: string;
|
|
50
|
+
locale?: string;
|
|
51
|
+
userAgent?: string;
|
|
52
|
+
};
|
|
53
|
+
messageId: string;
|
|
54
|
+
receivedAt: string | number;
|
|
55
|
+
sentAt: string | number;
|
|
56
|
+
timestamp: string | number;
|
|
57
|
+
userId: string | null;
|
|
58
|
+
type: string;
|
|
59
|
+
version?: number | null;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/gainsight-px-cloud-action/trackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const regional_endpoints_1 = require("../regional-endpoints");
|
|
4
|
+
const common_fields_1 = require("../common-fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Track Event',
|
|
7
|
+
description: 'Send an event to Gainsight PX',
|
|
8
|
+
defaultSubscription: 'type = "track"',
|
|
9
|
+
fields: {
|
|
10
|
+
event: {
|
|
11
|
+
label: 'Event Name',
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: 'A unique identifier for your event.',
|
|
14
|
+
required: true,
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.event'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
properties: {
|
|
20
|
+
label: 'Event Properties',
|
|
21
|
+
type: 'object',
|
|
22
|
+
description: 'An object of key-value pairs that represent additional data to be sent along with the event.',
|
|
23
|
+
default: {
|
|
24
|
+
'@path': '$.properties'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
...common_fields_1.commonFields
|
|
28
|
+
},
|
|
29
|
+
perform: (request, { payload, settings }) => {
|
|
30
|
+
return request(regional_endpoints_1.getEndpointByRegion('track', settings.dataCenter), {
|
|
31
|
+
method: 'post',
|
|
32
|
+
json: 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/gainsight-px-cloud-action/trackEvent/index.ts"],"names":[],"mappings":";;AAGA,8DAA2D;AAC3D,oDAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,+BAA+B;IAC5C,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,8FAA8F;YAC3G,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;QACD,GAAG,4BAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAE1C,OAAO,OAAO,CAAC,wCAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE;YAChE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
name: string | null;
|
|
3
|
+
properties: {
|
|
4
|
+
url?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
referrer?: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
};
|
|
9
|
+
anonymousId?: string | null;
|
|
10
|
+
context: {
|
|
11
|
+
campaign?: {
|
|
12
|
+
source?: string;
|
|
13
|
+
medium?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
term?: string;
|
|
16
|
+
content?: string;
|
|
17
|
+
};
|
|
18
|
+
location?: {
|
|
19
|
+
city?: string;
|
|
20
|
+
country?: string;
|
|
21
|
+
latitude?: number;
|
|
22
|
+
longitude?: number;
|
|
23
|
+
region?: string;
|
|
24
|
+
speed?: number;
|
|
25
|
+
};
|
|
26
|
+
page?: {
|
|
27
|
+
path?: string;
|
|
28
|
+
referrer?: string;
|
|
29
|
+
search?: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
url?: string;
|
|
32
|
+
};
|
|
33
|
+
screen?: {
|
|
34
|
+
width?: number;
|
|
35
|
+
height?: number;
|
|
36
|
+
};
|
|
37
|
+
app?: {
|
|
38
|
+
name?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
build?: string;
|
|
41
|
+
};
|
|
42
|
+
device?: {
|
|
43
|
+
[k: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
network?: {
|
|
46
|
+
[k: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
library?: {
|
|
49
|
+
name?: string;
|
|
50
|
+
version?: string;
|
|
51
|
+
};
|
|
52
|
+
ip?: string;
|
|
53
|
+
locale?: string;
|
|
54
|
+
userAgent?: string;
|
|
55
|
+
};
|
|
56
|
+
messageId: string;
|
|
57
|
+
receivedAt: string | number;
|
|
58
|
+
sentAt: string | number;
|
|
59
|
+
timestamp: string | number;
|
|
60
|
+
userId: string | null;
|
|
61
|
+
type: string;
|
|
62
|
+
version?: number | null;
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/gainsight-px-cloud-action/trackPageView/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const regional_endpoints_1 = require("../regional-endpoints");
|
|
4
|
+
const common_fields_1 = require("../common-fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Track Page View',
|
|
7
|
+
description: 'Send a page view event to Gainsight PX',
|
|
8
|
+
defaultSubscription: 'type = "page"',
|
|
9
|
+
fields: {
|
|
10
|
+
name: {
|
|
11
|
+
label: 'Page Name',
|
|
12
|
+
type: 'string',
|
|
13
|
+
allowNull: true,
|
|
14
|
+
required: true,
|
|
15
|
+
description: 'The name of the page',
|
|
16
|
+
default: {
|
|
17
|
+
'@path': '$.name'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
properties: {
|
|
21
|
+
label: 'Page Properties',
|
|
22
|
+
type: 'object',
|
|
23
|
+
description: 'Page Properties',
|
|
24
|
+
required: true,
|
|
25
|
+
properties: {
|
|
26
|
+
url: {
|
|
27
|
+
label: 'Page Url',
|
|
28
|
+
type: 'string'
|
|
29
|
+
},
|
|
30
|
+
title: {
|
|
31
|
+
label: 'Page Title',
|
|
32
|
+
type: 'string'
|
|
33
|
+
},
|
|
34
|
+
referrer: {
|
|
35
|
+
label: 'Page Referrer',
|
|
36
|
+
type: 'string'
|
|
37
|
+
},
|
|
38
|
+
path: {
|
|
39
|
+
label: 'Path portion of the current page URL',
|
|
40
|
+
type: 'string'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
default: {
|
|
44
|
+
url: { '@path': '$.properties.url' },
|
|
45
|
+
title: { '@path': '$.properties.title' },
|
|
46
|
+
referrer: { '@path': '$.properties.referrer' },
|
|
47
|
+
path: { '@path': '$.properties.path' }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
...common_fields_1.commonFields
|
|
51
|
+
},
|
|
52
|
+
perform: (request, { payload, settings }) => {
|
|
53
|
+
return request(regional_endpoints_1.getEndpointByRegion('track', settings.dataCenter), {
|
|
54
|
+
method: 'post',
|
|
55
|
+
json: payload
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.default = action;
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","source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