leadconduit-trustedform 2.0.2 → 2.1.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/CHANGELOG.md +4 -0
- package/docs/outbound.decision_service_ping.md +1 -1
- package/docs/outbound.decision_service_post.md +1 -1
- package/docs/outbound.insights.md +1 -1
- package/docs/outbound.trustedform.md +7 -0
- package/index.js +2 -1
- package/lib/consent.js +1 -1
- package/lib/helpers.js +1 -0
- package/lib/insights.js +33 -32
- package/lib/trustedform.js +236 -0
- package/lib/ui/api/account.js +35 -0
- package/lib/ui/api/index.js +8 -0
- package/lib/ui/index.js +10 -1
- package/lib/ui/public/app/config/Page1.vue +1 -0
- package/lib/ui/public/app/config/Page4.vue +62 -0
- package/lib/ui/public/app/config/Page5.vue +80 -0
- package/lib/ui/public/app/router.js +12 -0
- package/lib/ui/public/app/store.js +68 -1
- package/lib/ui/public/app/v4fields.js +97 -0
- package/lib/ui/public/dist/index.js +1 -1
- package/lib/ui/public/dist/index.js.LICENSE.txt +9 -0
- package/package.json +4 -1
|
@@ -1,20 +1,70 @@
|
|
|
1
1
|
import Vuex from 'vuex';
|
|
2
2
|
import fieldData from './fieldData';
|
|
3
|
+
import v4Fields from './v4fields';
|
|
4
|
+
import axios from 'axios';
|
|
5
|
+
import { get } from 'lodash';
|
|
3
6
|
|
|
4
7
|
const initStore = (config, ui) => new Vuex.Store({
|
|
5
8
|
state: {
|
|
6
9
|
// field descriptions
|
|
7
10
|
fieldData,
|
|
11
|
+
v4Fields,
|
|
8
12
|
|
|
9
13
|
// integration state
|
|
10
14
|
ui,
|
|
11
|
-
config
|
|
15
|
+
config,
|
|
16
|
+
errors: undefined,
|
|
17
|
+
products: {
|
|
18
|
+
retain: { enabled: false, selected: false },
|
|
19
|
+
insights: { enabled: false, selected: false }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
mutations: {
|
|
23
|
+
setErrors (state, errors) {
|
|
24
|
+
state.errors = errors;
|
|
25
|
+
},
|
|
26
|
+
setProduct (state, { product, value }) {
|
|
27
|
+
state.products[product] = value;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
getters: {
|
|
31
|
+
getProducts: (state) => {
|
|
32
|
+
return state.products;
|
|
33
|
+
},
|
|
34
|
+
getErrors: (state) => {
|
|
35
|
+
return state.errors;
|
|
36
|
+
}
|
|
12
37
|
},
|
|
13
38
|
actions: {
|
|
14
39
|
cancel (context) {
|
|
15
40
|
context.state.ui.cancel();
|
|
16
41
|
},
|
|
42
|
+
getProducts (context) {
|
|
43
|
+
axios
|
|
44
|
+
.get(`account?apiKey=${config.credential.token}`)
|
|
45
|
+
.then(function (response) {
|
|
46
|
+
const availableProducts = [
|
|
47
|
+
'retain',
|
|
48
|
+
'insights'
|
|
49
|
+
]
|
|
50
|
+
const products = get(response, 'data.product_components');
|
|
51
|
+
availableProducts.forEach(function (product) {
|
|
52
|
+
context.commit('setProduct', { product, value: {
|
|
53
|
+
enabled: products.includes(product),
|
|
54
|
+
selected: false
|
|
55
|
+
}});
|
|
56
|
+
});
|
|
57
|
+
})
|
|
58
|
+
.catch(function (error) {
|
|
59
|
+
if (get(error, 'response.status') === 401) {
|
|
60
|
+
context.commit('setErrors', 'no TrustedForm account found for this API key');
|
|
61
|
+
} else {
|
|
62
|
+
context.commit('setErrors', get(error, 'response.data') || error.message);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
},
|
|
17
66
|
finish (context) {
|
|
67
|
+
const { products, v4Fields } = context.state;
|
|
18
68
|
const flow = {
|
|
19
69
|
steps: [{
|
|
20
70
|
type: 'recipient',
|
|
@@ -28,6 +78,23 @@ const initStore = (config, ui) => new Vuex.Store({
|
|
|
28
78
|
}
|
|
29
79
|
}]
|
|
30
80
|
};
|
|
81
|
+
if (config.integration === 'leadconduit-trustedform.outbound.trustedform') {
|
|
82
|
+
Object.keys(products).forEach((product) => {
|
|
83
|
+
flow.steps[0].integration.mappings.push({
|
|
84
|
+
property: `trustedform.${product}`,
|
|
85
|
+
value: products[product].selected ? 'true' : 'false'
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
if (products.insights.selected) {
|
|
90
|
+
Object.keys(v4Fields).forEach((field) => {
|
|
91
|
+
flow.steps[0].integration.mappings.push({
|
|
92
|
+
property: `insights.${field}`,
|
|
93
|
+
value: v4Fields[field].selected ? 'true' : 'false'
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
31
98
|
context.state.ui.create({ flow });
|
|
32
99
|
}
|
|
33
100
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
age: {
|
|
3
|
+
name: 'Age',
|
|
4
|
+
description: 'The amount of time, in seconds, since the TrustedForm certificate was created. Serves as an approximation of lead age.',
|
|
5
|
+
enabled: false
|
|
6
|
+
},
|
|
7
|
+
browser: {
|
|
8
|
+
name: 'Browser',
|
|
9
|
+
description: 'The name and version of the browser used during the lead event.',
|
|
10
|
+
enabled: false
|
|
11
|
+
},
|
|
12
|
+
created_timestamp: {
|
|
13
|
+
name: 'Created Timestamp',
|
|
14
|
+
description: 'Timestamp of the creation of the TrustedForm certificate, in ISO 8601 format.',
|
|
15
|
+
enabled: false
|
|
16
|
+
},
|
|
17
|
+
domain: {
|
|
18
|
+
name: 'Domain',
|
|
19
|
+
description: 'The name of the website the lead event took place on.',
|
|
20
|
+
enabled: false
|
|
21
|
+
},
|
|
22
|
+
expiration_timestamp: {
|
|
23
|
+
name: 'Expiration Timestamp',
|
|
24
|
+
description: 'A timestamp indicating when this certificate will no longer be available for API requests.',
|
|
25
|
+
enabled: false
|
|
26
|
+
},
|
|
27
|
+
framed: {
|
|
28
|
+
name: 'Framed',
|
|
29
|
+
description: 'Whether or not the lead event took place inside of an iframe. <a href="https://www.techtarget.com/whatis/definition/IFrame-Inline-Frame" target="_blank">Learn More.</a>',
|
|
30
|
+
enabled: false
|
|
31
|
+
},
|
|
32
|
+
form_input_method: {
|
|
33
|
+
name: 'Form Input Method',
|
|
34
|
+
description: 'A list of ways the consumer input their data onto the form including one or more of the following: typing, paste, autofill.',
|
|
35
|
+
enabled: false
|
|
36
|
+
},
|
|
37
|
+
form_input_kpm: {
|
|
38
|
+
name: 'Form Input KPM',
|
|
39
|
+
description: 'The consumer’s typing speed on the form, in keystrokes per minute.',
|
|
40
|
+
enabled: false
|
|
41
|
+
},
|
|
42
|
+
form_input_wpm: {
|
|
43
|
+
name: 'Form Input WPM',
|
|
44
|
+
description: 'The consumer’s approximate typing speed on the form, in words per minute. This is calculated by using the Form Input KPM and assuming five characters represent a word.',
|
|
45
|
+
enabled: false
|
|
46
|
+
},
|
|
47
|
+
ip_address: {
|
|
48
|
+
name: 'IP Address',
|
|
49
|
+
description: 'The public IP address of the consumer during the lead event.',
|
|
50
|
+
enabled: false
|
|
51
|
+
},
|
|
52
|
+
location: {
|
|
53
|
+
name: 'Location',
|
|
54
|
+
description: 'The city, state, postal code, country, timezone, latitude and longitude of the consumer\'s location during the lead event based on IP address.',
|
|
55
|
+
enabled: false
|
|
56
|
+
},
|
|
57
|
+
masked: {
|
|
58
|
+
name: 'Masked',
|
|
59
|
+
description: 'Whether or not the TrustedForm certificate is masked.',
|
|
60
|
+
enabled: false
|
|
61
|
+
},
|
|
62
|
+
sensitive_content: {
|
|
63
|
+
name: 'Sensitive Content',
|
|
64
|
+
description: 'Count of how many content elements (e.g. input, textarea) are marked sensitive and hidden from the session replay.',
|
|
65
|
+
enabled: false
|
|
66
|
+
},
|
|
67
|
+
sensitive_form_fields: {
|
|
68
|
+
name: 'Sensitive Form Fields',
|
|
69
|
+
description: 'Count of how many form fields (e.g. input, textarea) are marked sensitive and hidden from the session replay.',
|
|
70
|
+
enabled: false
|
|
71
|
+
},
|
|
72
|
+
operating_system: {
|
|
73
|
+
name: 'Operating System',
|
|
74
|
+
description: 'The name and version of the operating system for the device used during the lead event.',
|
|
75
|
+
enabled: false
|
|
76
|
+
},
|
|
77
|
+
page_scan: {
|
|
78
|
+
name: 'Page Scan',
|
|
79
|
+
description: 'Results indicating whether specified text was found on the web page that created the certificate. <a href="https://community.activeprospect.com/posts/4078890-trustedform-page-scan" target="_blank">Learn more.</a>',
|
|
80
|
+
enabled: false
|
|
81
|
+
},
|
|
82
|
+
page_url: {
|
|
83
|
+
name: 'Page URL',
|
|
84
|
+
description: 'The URL of the page where the lead event took place.',
|
|
85
|
+
enabled: false
|
|
86
|
+
},
|
|
87
|
+
parent_page_url: {
|
|
88
|
+
name: 'Parent Page URL',
|
|
89
|
+
description: 'The URL displayed in the consumer\'s browser if the Page URL was displayed in an iframe. <a href="https://www.techtarget.com/whatis/definition/IFrame-Inline-Frame" target="_blank">Learn more.</a>',
|
|
90
|
+
enabled: false
|
|
91
|
+
},
|
|
92
|
+
time_on_page: {
|
|
93
|
+
name: 'Time On Page',
|
|
94
|
+
description: 'The amount of time, in seconds, that the consumer spent on the page during the lead event.',
|
|
95
|
+
enabled: false
|
|
96
|
+
}
|
|
97
|
+
}
|