@segment/action-destinations 3.331.7-staging.1 → 3.331.8-staging
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/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/display-video-360/addToAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/addToAudience/index.js +3 -2
- package/dist/destinations/display-video-360/addToAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +5 -3
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/display-video-360/listManagement.d.ts +9 -0
- package/dist/destinations/display-video-360/listManagement.js +16 -0
- package/dist/destinations/display-video-360/listManagement.js.map +1 -0
- package/dist/destinations/display-video-360/properties.d.ts +1 -1
- package/dist/destinations/display-video-360/properties.js +14 -17
- package/dist/destinations/display-video-360/properties.js.map +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/index.js +3 -2
- package/dist/destinations/display-video-360/removeFromAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/shared.js +3 -3
- package/dist/destinations/display-video-360/shared.js.map +1 -1
- package/package.json +1 -1
- package/dist/destinations/absmartly/segment.d.ts +0 -11
- package/dist/destinations/absmartly/segment.js +0 -3
- package/dist/destinations/absmartly/segment.js.map +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/__snapshots__/snapshot.test.js.snap +0 -208
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +0 -184
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +0 -1
- package/dist/destinations/gleap/generated-types.d.ts +0 -3
- package/dist/destinations/gleap/generated-types.js +0 -3
- package/dist/destinations/gleap/generated-types.js.map +0 -1
- package/dist/destinations/gleap/identifyContact/generated-types.d.ts +0 -18
- package/dist/destinations/gleap/identifyContact/generated-types.js +0 -3
- package/dist/destinations/gleap/identifyContact/generated-types.js.map +0 -1
- package/dist/destinations/gleap/identifyContact/index.d.ts +0 -5
- package/dist/destinations/gleap/identifyContact/index.js +0 -155
- package/dist/destinations/gleap/identifyContact/index.js.map +0 -1
- package/dist/destinations/gleap/index.d.ts +0 -4
- package/dist/destinations/gleap/index.js +0 -52
- package/dist/destinations/gleap/index.js.map +0 -1
- package/dist/destinations/gleap/trackEvent/generated-types.d.ts +0 -10
- package/dist/destinations/gleap/trackEvent/generated-types.js +0 -3
- package/dist/destinations/gleap/trackEvent/generated-types.js.map +0 -1
- package/dist/destinations/gleap/trackEvent/index.d.ts +0 -5
- package/dist/destinations/gleap/trackEvent/index.js +0 -111
- package/dist/destinations/gleap/trackEvent/index.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -4
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +0 -3
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +0 -5
- package/dist/destinations/klaviyo/removeProfileToList/index.js +0 -41
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +0 -1
- package/dist/destinations/mixpanel/utils.d.ts +0 -13
- package/dist/destinations/mixpanel/utils.js +0 -117
- package/dist/destinations/mixpanel/utils.js.map +0 -1
- package/dist/destinations/trackey/identifyUser/generated-types.d.ts +0 -8
- package/dist/destinations/trackey/identifyUser/generated-types.js +0 -3
- package/dist/destinations/trackey/identifyUser/generated-types.js.map +0 -1
- package/dist/destinations/trackey/identifyUser/index.d.ts +0 -5
- package/dist/destinations/trackey/identifyUser/index.js +0 -52
- package/dist/destinations/trackey/identifyUser/index.js.map +0 -1
- package/dist/destinations/trackey/identifyUser.types.d.ts +0 -8
- package/dist/destinations/trackey/identifyUser.types.js +0 -3
- package/dist/destinations/trackey/identifyUser.types.js.map +0 -1
- package/dist/destinations/trackey/registerCompany/generated-types.d.ts +0 -9
- package/dist/destinations/trackey/registerCompany/generated-types.js +0 -3
- package/dist/destinations/trackey/registerCompany/generated-types.js.map +0 -1
- package/dist/destinations/trackey/registerCompany/index.d.ts +0 -5
- package/dist/destinations/trackey/registerCompany/index.js +0 -60
- package/dist/destinations/trackey/registerCompany/index.js.map +0 -1
- package/dist/destinations/trackey/registerCompany.types.d.ts +0 -9
- package/dist/destinations/trackey/registerCompany.types.js +0 -3
- package/dist/destinations/trackey/registerCompany.types.js.map +0 -1
- package/dist/destinations/trackey/trackEvent/generated-types.d.ts +0 -12
- package/dist/destinations/trackey/trackEvent/generated-types.js +0 -3
- package/dist/destinations/trackey/trackEvent/generated-types.js.map +0 -1
- package/dist/destinations/trackey/trackEvent/index.d.ts +0 -5
- package/dist/destinations/trackey/trackEvent/index.js +0 -68
- package/dist/destinations/trackey/trackEvent/index.js.map +0 -1
- package/dist/destinations/trackey/trackEvent.types.d.ts +0 -12
- package/dist/destinations/trackey/trackEvent.types.js +0 -3
- package/dist/destinations/trackey/trackEvent.types.js.map +0 -1
|
@@ -1,184 +0,0 @@
|
|
|
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 test_data_1 = require("../../../../lib/test-data");
|
|
8
|
-
const index_1 = __importDefault(require("../../index"));
|
|
9
|
-
const nock_1 = __importDefault(require("nock"));
|
|
10
|
-
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
11
|
-
const actionSlug = 'updateUserProfile';
|
|
12
|
-
const destinationSlug = 'Braze';
|
|
13
|
-
const seedName = `${destinationSlug}#${actionSlug}`;
|
|
14
|
-
const receivedAt = '2021-08-03T17:40:04.055Z';
|
|
15
|
-
const settings = {
|
|
16
|
-
app_id: 'my-app-id',
|
|
17
|
-
api_key: 'my-api-key',
|
|
18
|
-
endpoint: 'https://rest.iad-01.braze.com'
|
|
19
|
-
};
|
|
20
|
-
describe(`Testing snapshot for ${destinationSlug}'s ${actionSlug} destination action:`, () => {
|
|
21
|
-
it('required fields', async () => {
|
|
22
|
-
const action = index_1.default.actions[actionSlug];
|
|
23
|
-
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, true);
|
|
24
|
-
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
25
|
-
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
26
|
-
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
27
|
-
const event = actions_core_1.createTestEvent({
|
|
28
|
-
properties: eventData
|
|
29
|
-
});
|
|
30
|
-
const responses = await testDestination.testAction(actionSlug, {
|
|
31
|
-
event: event,
|
|
32
|
-
mapping: event.properties,
|
|
33
|
-
settings: settingsData,
|
|
34
|
-
auth: undefined
|
|
35
|
-
});
|
|
36
|
-
const request = responses[0].request;
|
|
37
|
-
const rawBody = await request.text();
|
|
38
|
-
try {
|
|
39
|
-
const json = JSON.parse(rawBody);
|
|
40
|
-
expect(json).toMatchSnapshot();
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
expect(rawBody).toMatchSnapshot();
|
|
45
|
-
}
|
|
46
|
-
expect(request.headers).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
it('all fields', async () => {
|
|
49
|
-
const action = index_1.default.actions[actionSlug];
|
|
50
|
-
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, false);
|
|
51
|
-
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
52
|
-
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
53
|
-
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
54
|
-
const event = actions_core_1.createTestEvent({
|
|
55
|
-
properties: eventData
|
|
56
|
-
});
|
|
57
|
-
const responses = await testDestination.testAction(actionSlug, {
|
|
58
|
-
event: event,
|
|
59
|
-
mapping: event.properties,
|
|
60
|
-
settings: settingsData,
|
|
61
|
-
auth: undefined
|
|
62
|
-
});
|
|
63
|
-
const request = responses[0].request;
|
|
64
|
-
const rawBody = await request.text();
|
|
65
|
-
try {
|
|
66
|
-
const json = JSON.parse(rawBody);
|
|
67
|
-
expect(json).toMatchSnapshot();
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
expect(rawBody).toMatchSnapshot();
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
it('it should work with batched events', async () => {
|
|
75
|
-
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
76
|
-
const events = [
|
|
77
|
-
actions_core_1.createTestEvent({
|
|
78
|
-
event: 'Test Event 1',
|
|
79
|
-
type: 'track',
|
|
80
|
-
receivedAt,
|
|
81
|
-
properties: {}
|
|
82
|
-
}),
|
|
83
|
-
actions_core_1.createTestEvent({
|
|
84
|
-
event: 'Test Event 2',
|
|
85
|
-
type: 'track',
|
|
86
|
-
receivedAt,
|
|
87
|
-
properties: {}
|
|
88
|
-
})
|
|
89
|
-
];
|
|
90
|
-
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
91
|
-
events,
|
|
92
|
-
useDefaultMappings: true,
|
|
93
|
-
mapping: {
|
|
94
|
-
external_id: {
|
|
95
|
-
'@path': '$.userId'
|
|
96
|
-
},
|
|
97
|
-
user_alias: {},
|
|
98
|
-
braze_id: {
|
|
99
|
-
'@path': '$.properties.braze_id'
|
|
100
|
-
},
|
|
101
|
-
name: {
|
|
102
|
-
'@path': '$.event'
|
|
103
|
-
},
|
|
104
|
-
time: {
|
|
105
|
-
'@path': '$.receivedAt'
|
|
106
|
-
},
|
|
107
|
-
properties: {
|
|
108
|
-
'@path': '$.properties'
|
|
109
|
-
},
|
|
110
|
-
products: {
|
|
111
|
-
'@path': '$.properties.products'
|
|
112
|
-
},
|
|
113
|
-
enable_batching: true,
|
|
114
|
-
_update_existing_only: true
|
|
115
|
-
},
|
|
116
|
-
settings: {
|
|
117
|
-
...settings
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
expect(responses.length).toBe(1);
|
|
121
|
-
expect(responses[0].status).toBe(200);
|
|
122
|
-
expect(responses[0].options.headers).toMatchSnapshot();
|
|
123
|
-
expect(responses[0].options.json).toMatchSnapshot();
|
|
124
|
-
});
|
|
125
|
-
it('it should work with a single batched events', async () => {
|
|
126
|
-
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
127
|
-
const events = [
|
|
128
|
-
actions_core_1.createTestEvent({
|
|
129
|
-
event: 'Test Event 1',
|
|
130
|
-
type: 'track',
|
|
131
|
-
receivedAt,
|
|
132
|
-
properties: {
|
|
133
|
-
products: [
|
|
134
|
-
{
|
|
135
|
-
quantity: 1,
|
|
136
|
-
product_id: 'Bowflex Treadmill 10',
|
|
137
|
-
price: 100
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
quantity: 2,
|
|
141
|
-
product_id: 'Bowflex Treadmill 20',
|
|
142
|
-
price: 200
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
];
|
|
148
|
-
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
149
|
-
events,
|
|
150
|
-
useDefaultMappings: true,
|
|
151
|
-
mapping: {
|
|
152
|
-
external_id: {
|
|
153
|
-
'@path': '$.userId'
|
|
154
|
-
},
|
|
155
|
-
user_alias: {},
|
|
156
|
-
braze_id: {
|
|
157
|
-
'@path': '$.properties.braze_id'
|
|
158
|
-
},
|
|
159
|
-
name: {
|
|
160
|
-
'@path': '$.event'
|
|
161
|
-
},
|
|
162
|
-
time: {
|
|
163
|
-
'@path': '$.receivedAt'
|
|
164
|
-
},
|
|
165
|
-
properties: {
|
|
166
|
-
'@path': '$.properties'
|
|
167
|
-
},
|
|
168
|
-
products: {
|
|
169
|
-
'@path': '$.properties.products'
|
|
170
|
-
},
|
|
171
|
-
enable_batching: true,
|
|
172
|
-
_update_existing_only: true
|
|
173
|
-
},
|
|
174
|
-
settings: {
|
|
175
|
-
...settings
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
expect(responses.length).toBe(1);
|
|
179
|
-
expect(responses[0].status).toBe(200);
|
|
180
|
-
expect(responses[0].options.headers).toMatchSnapshot();
|
|
181
|
-
expect(responses[0].options.json).toMatchSnapshot();
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
//# sourceMappingURL=snapshot.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.test.js","sourceRoot":"","sources":["../../../../../src/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4F;AAC5F,yDAA4D;AAC5D,wDAAqC;AACrC,gDAAuB;AAEvB,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW,CAAC,CAAA;AAC1D,MAAM,UAAU,GAAG,mBAAmB,CAAA;AACtC,MAAM,eAAe,GAAG,OAAO,CAAA;AAC/B,MAAM,QAAQ,GAAG,GAAG,eAAe,IAAI,UAAU,EAAE,CAAA;AACnD,MAAM,UAAU,GAAG,0BAA0B,CAAA;AAC7C,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,+BAAwC;CACnD,CAAA;AAED,QAAQ,CAAC,wBAAwB,eAAe,MAAM,UAAU,sBAAsB,EAAE,GAAG,EAAE;IAC3F,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG,eAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,4BAAgB,CAAC,QAAQ,EAAE,eAAW,EAAE,MAAM,EAAE,IAAI,CAAC,C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CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACrC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAA;QACtD,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/gleap/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
userId: string;
|
|
3
|
-
firstName?: string;
|
|
4
|
-
lastName?: string;
|
|
5
|
-
email?: string;
|
|
6
|
-
phone?: string;
|
|
7
|
-
companyName?: string;
|
|
8
|
-
companyId?: string;
|
|
9
|
-
lang?: string;
|
|
10
|
-
plan?: string;
|
|
11
|
-
value?: number;
|
|
12
|
-
lastPageView?: string;
|
|
13
|
-
createdAt?: string | number;
|
|
14
|
-
lastActivity?: string | number;
|
|
15
|
-
customAttributes?: {
|
|
16
|
-
[k: string]: unknown;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/gleap/identifyContact/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,155 +0,0 @@
|
|
|
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 action = {
|
|
9
|
-
title: 'Identify Contact',
|
|
10
|
-
description: 'Create or update a contact in Gleap',
|
|
11
|
-
defaultSubscription: 'type = "identify"',
|
|
12
|
-
fields: {
|
|
13
|
-
userId: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
required: true,
|
|
16
|
-
description: 'A unique identifier for the contact.',
|
|
17
|
-
label: 'User ID',
|
|
18
|
-
default: {
|
|
19
|
-
'@path': '$.userId'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
firstName: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
description: "The contact's first name.",
|
|
25
|
-
label: 'First name',
|
|
26
|
-
default: {
|
|
27
|
-
'@path': '$.properties.first_name'
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
lastName: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: "The contact's last name.",
|
|
33
|
-
label: 'Last name',
|
|
34
|
-
default: {
|
|
35
|
-
'@path': '$.properties.last_name'
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
email: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
description: "The contact's email address.",
|
|
41
|
-
label: 'Email Address',
|
|
42
|
-
format: 'email',
|
|
43
|
-
default: { '@path': '$.traits.email' }
|
|
44
|
-
},
|
|
45
|
-
phone: {
|
|
46
|
-
label: 'Phone Number',
|
|
47
|
-
description: "The contact's phone number.",
|
|
48
|
-
type: 'string',
|
|
49
|
-
default: {
|
|
50
|
-
'@path': '$.traits.phone'
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
companyName: {
|
|
54
|
-
label: 'Company Name',
|
|
55
|
-
description: "The contact's company name.",
|
|
56
|
-
type: 'string',
|
|
57
|
-
default: {
|
|
58
|
-
'@path': '$.traits.company.name'
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
companyId: {
|
|
62
|
-
label: 'Company ID',
|
|
63
|
-
description: "The contact's compan ID",
|
|
64
|
-
type: 'string',
|
|
65
|
-
default: {
|
|
66
|
-
'@path': '$.traits.company.id'
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
lang: {
|
|
70
|
-
label: 'Language',
|
|
71
|
-
description: "The user's language.",
|
|
72
|
-
type: 'string',
|
|
73
|
-
required: false,
|
|
74
|
-
default: { '@path': '$.context.locale' }
|
|
75
|
-
},
|
|
76
|
-
plan: {
|
|
77
|
-
label: 'Subscription Plan',
|
|
78
|
-
description: "The user's subscription plan.",
|
|
79
|
-
type: 'string',
|
|
80
|
-
required: false,
|
|
81
|
-
default: { '@path': '$.traits.plan' }
|
|
82
|
-
},
|
|
83
|
-
value: {
|
|
84
|
-
label: 'User Value',
|
|
85
|
-
description: "The user's value.",
|
|
86
|
-
type: 'number',
|
|
87
|
-
required: false
|
|
88
|
-
},
|
|
89
|
-
lastPageView: {
|
|
90
|
-
label: 'Last Page View',
|
|
91
|
-
type: 'string',
|
|
92
|
-
description: 'The page where the contact was last seen.',
|
|
93
|
-
default: {
|
|
94
|
-
'@path': '$.context.page.url'
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
createdAt: {
|
|
98
|
-
label: 'Signed Up Timestamp',
|
|
99
|
-
type: 'datetime',
|
|
100
|
-
description: 'The time specified for when a contact signed up.'
|
|
101
|
-
},
|
|
102
|
-
lastActivity: {
|
|
103
|
-
label: 'Last Seen Timestamp',
|
|
104
|
-
type: 'datetime',
|
|
105
|
-
description: 'The time when the contact was last seen.',
|
|
106
|
-
default: {
|
|
107
|
-
'@path': '$.timestamp'
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
customAttributes: {
|
|
111
|
-
label: 'Custom Attributes',
|
|
112
|
-
description: 'The custom attributes which are set for the contact.',
|
|
113
|
-
type: 'object',
|
|
114
|
-
defaultObjectUI: 'keyvalue',
|
|
115
|
-
default: {
|
|
116
|
-
'@path': '$.traits'
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
perform: async (request, { payload }) => {
|
|
121
|
-
const defaultUserFields = [
|
|
122
|
-
'userId',
|
|
123
|
-
'email',
|
|
124
|
-
'phone',
|
|
125
|
-
'companyName',
|
|
126
|
-
'companyId',
|
|
127
|
-
'lang',
|
|
128
|
-
'plan',
|
|
129
|
-
'value',
|
|
130
|
-
'createdAt',
|
|
131
|
-
'lastActivity'
|
|
132
|
-
];
|
|
133
|
-
const identifyPayload = {
|
|
134
|
-
...(payload.firstName || payload.lastName
|
|
135
|
-
? {
|
|
136
|
-
name: `${payload.firstName} ${payload.lastName}`.trim()
|
|
137
|
-
}
|
|
138
|
-
: {}),
|
|
139
|
-
...pick_1.default(payload, defaultUserFields),
|
|
140
|
-
...omit_1.default(payload.customAttributes, [...defaultUserFields, 'firstName', 'lastName'])
|
|
141
|
-
};
|
|
142
|
-
if (payload.lastPageView) {
|
|
143
|
-
identifyPayload.lastPageView = {
|
|
144
|
-
page: payload.lastPageView,
|
|
145
|
-
date: payload.lastActivity
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
return request('https://api.gleap.io/admin/identify', {
|
|
149
|
-
method: 'POST',
|
|
150
|
-
json: identifyPayload
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
exports.default = action;
|
|
155
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/gleap/identifyContact/index.ts"],"names":[],"mappings":";;;;;AAGA,uDAA8B;AAC9B,uDAA8B;AAE9B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,qCAAqC;IAClD,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,sCAAsC;YACnD,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,SAAS,EAAE;YACT,IAAI,E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,gBAAgB,EAAE,CAAC,GAAG,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;SACnF,CAAA;QAGD,IAAI,OAAO,CAAC,YAAY,EAAE;YACxB,eAAe,CAAC,YAAY,GAAG;gBAC7B,IAAI,EAAE,OAAO,CAAC,YAAY;gBAC1B,IAAI,EAAE,OAAO,CAAC,YAAY;aAC3B,CAAA;SACF;QAED,OAAO,OAAO,CAAC,qCAAqC,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,eAAe;SACtB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,52 +0,0 @@
|
|
|
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 identifyContact_1 = __importDefault(require("./identifyContact"));
|
|
8
|
-
const trackEvent_1 = __importDefault(require("./trackEvent"));
|
|
9
|
-
const destination = {
|
|
10
|
-
name: 'Gleap (Action)',
|
|
11
|
-
slug: 'gleap-cloud-actions',
|
|
12
|
-
description: 'Send Segment analytics events and user profile data to Gleap',
|
|
13
|
-
mode: 'cloud',
|
|
14
|
-
authentication: {
|
|
15
|
-
scheme: 'custom',
|
|
16
|
-
fields: {
|
|
17
|
-
apiToken: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
label: 'Secret API token',
|
|
20
|
-
description: 'Found in `Project settings` -> `Secret API token`.',
|
|
21
|
-
required: true
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
testAuthentication: async (request) => {
|
|
25
|
-
return await request('https://api.gleap.io/admin/auth');
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
extendRequest({ settings }) {
|
|
29
|
-
return {
|
|
30
|
-
headers: {
|
|
31
|
-
'Api-Token': settings.apiToken
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
onDelete: async (request, { payload }) => {
|
|
36
|
-
const userId = payload.userId;
|
|
37
|
-
if (userId) {
|
|
38
|
-
return request(`https://api.gleap.io/admin/contacts/${userId}`, {
|
|
39
|
-
method: 'DELETE'
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
throw new actions_core_1.IntegrationError('No unique contact found', 'Contact not found', 404);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
actions: {
|
|
47
|
-
identifyContact: identifyContact_1.default,
|
|
48
|
-
trackEvent: trackEvent_1.default
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
exports.default = destination;
|
|
52
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/gleap/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+E;AAE/E,wEAA+C;AAC/C,8DAAqC;AAErC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,8DAA8D;IAC3E,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EAAE,oDAAoD;gBACjE,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAIpC,OAAO,MAAM,OAAO,CAAC,iCAAiC,CAAC,CAAA;QACzD,CAAC;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,WAAW,EAAE,QAAQ,CAAC,QAAQ;aAC/B;SACF,CAAA;IACH,CAAC;IAKD,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACvC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAgB,CAAA;QACvC,IAAI,MAAM,EAAE;YACV,OAAO,OAAO,CAAC,uCAAuC,MAAM,EAAE,EAAE;gBAC9D,MAAM,EAAE,QAAQ;aACjB,CAAC,CAAA;SACH;aAAM;YACL,MAAM,IAAI,+BAAgB,CAAC,yBAAyB,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAA;SAChF;IACH,CAAC;IAED,OAAO,EAAE;QACP,eAAe,EAAf,yBAAe;QACf,UAAU,EAAV,oBAAU;KACX;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/gleap/trackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const preparePayload = (payload) => {
|
|
4
|
-
const event = {
|
|
5
|
-
name: payload.eventName,
|
|
6
|
-
date: payload.date,
|
|
7
|
-
data: payload.data,
|
|
8
|
-
userId: payload.userId
|
|
9
|
-
};
|
|
10
|
-
if (payload.type === 'page') {
|
|
11
|
-
event.name = 'pageView';
|
|
12
|
-
event.data = {
|
|
13
|
-
page: payload.pageUrl ?? payload.eventName
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
else if (payload.type === 'screen') {
|
|
17
|
-
event.name = 'pageView';
|
|
18
|
-
event.data = {
|
|
19
|
-
page: payload.eventName
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return event;
|
|
23
|
-
};
|
|
24
|
-
const sendEvents = async (request, events) => {
|
|
25
|
-
return request('https://api.gleap.io/admin/track', {
|
|
26
|
-
method: 'POST',
|
|
27
|
-
json: {
|
|
28
|
-
events: events
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
const action = {
|
|
33
|
-
title: 'Track Event',
|
|
34
|
-
description: 'Submit an event to Gleap.',
|
|
35
|
-
defaultSubscription: 'type = "track" or type = "page" or type = "screen"',
|
|
36
|
-
fields: {
|
|
37
|
-
eventName: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
required: false,
|
|
40
|
-
description: 'The name of the event that occurred. Names are treated as case insensitive. Periods and dollar signs in event names are replaced with hyphens.',
|
|
41
|
-
label: 'Event Name',
|
|
42
|
-
default: {
|
|
43
|
-
'@if': {
|
|
44
|
-
exists: { '@path': '$.event' },
|
|
45
|
-
then: { '@path': '$.event' },
|
|
46
|
-
else: { '@path': '$.name' }
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
type: {
|
|
51
|
-
type: 'string',
|
|
52
|
-
unsafe_hidden: true,
|
|
53
|
-
required: true,
|
|
54
|
-
description: 'The type of the Segment event',
|
|
55
|
-
label: 'Event Type',
|
|
56
|
-
choices: [
|
|
57
|
-
{ label: 'track', value: 'track' },
|
|
58
|
-
{ label: 'page', value: 'page' },
|
|
59
|
-
{ label: 'screen', value: 'screen' }
|
|
60
|
-
],
|
|
61
|
-
default: {
|
|
62
|
-
'@path': '$.type'
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
pageUrl: {
|
|
66
|
-
label: 'Event Page URL',
|
|
67
|
-
description: 'The associated page url of the Segment event',
|
|
68
|
-
type: 'string',
|
|
69
|
-
format: 'uri',
|
|
70
|
-
required: false,
|
|
71
|
-
unsafe_hidden: true,
|
|
72
|
-
default: { '@path': '$.context.page.url' }
|
|
73
|
-
},
|
|
74
|
-
date: {
|
|
75
|
-
type: 'datetime',
|
|
76
|
-
required: true,
|
|
77
|
-
description: 'The time the event took place in ISO 8601 format. Segment will convert to Unix before sending to Gleap.',
|
|
78
|
-
label: 'Event Timestamp',
|
|
79
|
-
default: {
|
|
80
|
-
'@path': '$.timestamp'
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
userId: {
|
|
84
|
-
type: 'string',
|
|
85
|
-
required: true,
|
|
86
|
-
description: 'Your identifier for the user who performed the event. User ID is required.',
|
|
87
|
-
label: 'User ID',
|
|
88
|
-
default: {
|
|
89
|
-
'@path': '$.userId'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
data: {
|
|
93
|
-
type: 'object',
|
|
94
|
-
description: 'Optional metadata describing the event. Each event can contain up to ten metadata key-value pairs. If you send more than ten keys, Gleap will ignore the rest.',
|
|
95
|
-
label: 'Event Metadata',
|
|
96
|
-
default: {
|
|
97
|
-
'@path': '$.properties'
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
perform: async (request, { payload }) => {
|
|
102
|
-
const event = preparePayload(payload);
|
|
103
|
-
return sendEvents(request, [event]);
|
|
104
|
-
},
|
|
105
|
-
performBatch: async (request, { payload }) => {
|
|
106
|
-
const events = payload.map(preparePayload);
|
|
107
|
-
return sendEvents(request, events);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
exports.default = action;
|
|
111
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/gleap/trackEvent/index.ts"],"names":[],"mappings":";;AAIA,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC1C,MAAM,KAAK,GAAG;QACZ,IAAI,EAAE,OAAO,CAAC,SAAS;QACvB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAA;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;QAC3B,KAAK,CAAC,IAAI,GAAG,UAAU,CAAA;QACvB,KAAK,CAAC,IAAI,GAAG;YACX,IAAI,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AED,kBAAe,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/generated-types.ts"],"names":[],"mappings":""}
|