leadconduit-trustedform 2.4.1 → 2.4.3
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/lib/trustedform.js +20 -9
- package/lib/ui/public/app/config/Page1.vue +3 -1
- package/lib/ui/public/app/config/Page4.vue +12 -2
- package/lib/ui/public/app/config/Page5.vue +10 -3
- package/lib/ui/public/app/config/Page6.vue +11 -3
- package/lib/ui/public/app/config/Page7.vue +62 -0
- package/lib/ui/public/app/router.js +6 -0
- package/lib/ui/public/app/store.js +61 -11
- package/lib/ui/public/dist/index.js +1 -1
- package/lib/ui/public/dist/index.js.LICENSE.txt +7 -1
- package/package.json +1 -1
package/lib/trustedform.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
const { get } = require('lodash');
|
|
2
1
|
const helpers = require('./helpers');
|
|
3
|
-
const { compact, pickBy, isUndefined } = require('lodash');
|
|
2
|
+
const { compact, get, pickBy, isUndefined } = require('lodash');
|
|
4
3
|
|
|
5
4
|
const request = (vars) => {
|
|
6
5
|
const { lead, trustedform, insights } = vars;
|
|
@@ -29,8 +28,10 @@ const request = (vars) => {
|
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
}
|
|
31
|
+
|
|
32
32
|
if (trustedform.verify?.valueOf()) {
|
|
33
|
-
|
|
33
|
+
const advertiserName = trustedform?.advertiser_name;
|
|
34
|
+
body.verify = pickBy({ advertiser_name: advertiserName }, (v) => { return !isUndefined(v); });
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
return {
|
|
@@ -108,7 +109,8 @@ request.variables = () => [
|
|
|
108
109
|
{ name: 'trustedform.scan_forbidden_text', type: 'array', required: false, description: 'A list of forbidden text to scan for. TrustedForm will then perform a case and whitespace insensitive search for the string.' },
|
|
109
110
|
{ name: 'trustedform.scan_delimiter', type: 'string', required: false, description: 'Use this parameter to designate a delimiter when wrapping wildcards or template variables; defaults to |.' },
|
|
110
111
|
|
|
111
|
-
{ name: 'trustedform.verify', type: 'boolean', required: true, description: 'If true, a request to the Verify product will be made'}
|
|
112
|
+
{ name: 'trustedform.verify', type: 'boolean', required: true, description: 'If true, a request to the Verify product will be made'},
|
|
113
|
+
{ name: 'trustedform.advertiser_name', type: 'string', required: false, description: 'The name of the legal entity for an advertiser that will be used to determine if they were given consent in a one to one manner. This value will be normalized to be case insensitive, ignore redundant white space and omit non ascii characters. Both \'Acme Inc.\' and \'acme inc\' would result in the same processed value.' }
|
|
112
114
|
];
|
|
113
115
|
|
|
114
116
|
const validate = (vars) => {
|
|
@@ -125,13 +127,23 @@ const insightsEnabled = (vars) => vars.trustedform?.insights?.valueOf();
|
|
|
125
127
|
const verifyEnabled = (vars) => vars.trustedform?.verify?.valueOf();
|
|
126
128
|
const hasRequiredRetainProps = (vars) => !!(vars.lead.email || vars.lead.phone_1);
|
|
127
129
|
const hasAtLeastOneInsightsProp = (vars) => formatProperties(vars.insights).length > 0 || vars.insights?.page_scan?.valueOf();
|
|
128
|
-
|
|
130
|
+
const hasVerifyData = (data) => {
|
|
131
|
+
return data.verify?.languages || data.verify?.result?.language_approved || data.verify?.result?.success || data.verify?.result?.one_to_one;
|
|
132
|
+
};
|
|
129
133
|
|
|
130
134
|
const response = (vars, req, res) => {
|
|
131
135
|
if (res.status < 500) {
|
|
132
136
|
try {
|
|
133
137
|
const parsed = JSON.parse(res.body);
|
|
134
138
|
if (res.status === 200) {
|
|
139
|
+
const verify = hasVerifyData(parsed)
|
|
140
|
+
? pickBy({
|
|
141
|
+
languages: parsed.verify.languages.map(lang => lang.text),
|
|
142
|
+
language_approved: parsed.verify.result.language_approved,
|
|
143
|
+
success: parsed.verify.result.success,
|
|
144
|
+
}, (v) => !isUndefined(v))
|
|
145
|
+
: undefined;
|
|
146
|
+
|
|
135
147
|
const appended = pickBy({
|
|
136
148
|
outcome: parsed.outcome,
|
|
137
149
|
reason: parsed.reason,
|
|
@@ -179,10 +191,8 @@ const response = (vars, req, res) => {
|
|
|
179
191
|
os_name: parsed.insights?.properties?.os?.name,
|
|
180
192
|
page_url: parsed.insights?.properties?.page_url,
|
|
181
193
|
parent_page_url: parsed.insights?.properties?.parent_page_url,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
language_approved: parsed.verify?.result?.language_approved,
|
|
185
|
-
success: parsed.verify?.result?.success,
|
|
194
|
+
one_to_one: parsed.verify?.result?.one_to_one,
|
|
195
|
+
verify
|
|
186
196
|
}, (v) => { return !isUndefined(v); });
|
|
187
197
|
// only include this property if page scan was selected
|
|
188
198
|
if (vars.insights?.page_scan?.valueOf()) {
|
|
@@ -256,6 +266,7 @@ response.variables = () => [
|
|
|
256
266
|
{ name: 'os_name', type: 'string', description: 'Operating system name' },
|
|
257
267
|
{ name: 'page_url', type: 'string', description: 'The URL of the page hosting TrustedForm Certify.' },
|
|
258
268
|
{ name: 'parent_page_url', type: 'string', description: 'The parent URL of the page hosting TrustedForm Certify, if framed.' },
|
|
269
|
+
{ name: 'one_to_one', type: 'boolean', description: 'A boolean indicating if the cert structure satisfied the requirements for 1:1 consent.' },
|
|
259
270
|
{ name: 'verify.languages', type: 'array', description: 'A list of the consent languages detected within the certificate' },
|
|
260
271
|
{ name: 'verify.language_approved', type: 'boolean', description: 'A boolean indicating if any of the consent languages found have been approved in your account\'s consent language manager.' },
|
|
261
272
|
{ name: 'verify.success', type: 'boolean', description: 'A boolean indicating if any of the consent languages found meet the success criteria defined for your account.' },
|
|
@@ -62,7 +62,9 @@ export default {
|
|
|
62
62
|
},
|
|
63
63
|
mounted () {
|
|
64
64
|
const { integration } = this.$store.state.config;
|
|
65
|
-
if (integration.includes('outbound.trustedform'))
|
|
65
|
+
if (integration.includes('outbound.trustedform')) {
|
|
66
|
+
this.$router.push('/4');
|
|
67
|
+
}
|
|
66
68
|
else if (!integration.includes('insights')) {
|
|
67
69
|
this.isDataService = false;
|
|
68
70
|
}
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
:showPrevious="false"
|
|
44
44
|
:onConfirm="confirm"
|
|
45
45
|
:disableConfirm="!products.retain.selected && !products.insights.selected && !products.verify.selected"
|
|
46
|
+
:navHistory="navHistory"
|
|
46
47
|
/>
|
|
47
48
|
</div>
|
|
48
49
|
</template>
|
|
@@ -54,7 +55,8 @@ export default {
|
|
|
54
55
|
return {
|
|
55
56
|
loading: true,
|
|
56
57
|
products: this.$store.getters.getProducts,
|
|
57
|
-
errors: this.$store.getters.getErrors
|
|
58
|
+
errors: this.$store.getters.getErrors,
|
|
59
|
+
navHistory: this.$store.getters.getNavHistory
|
|
58
60
|
};
|
|
59
61
|
},
|
|
60
62
|
components: {
|
|
@@ -67,9 +69,17 @@ export default {
|
|
|
67
69
|
},
|
|
68
70
|
methods: {
|
|
69
71
|
confirm () {
|
|
72
|
+
this.$store.commit('resetNavHistory');
|
|
73
|
+
this.$store.commit('setNavHistory', '/4');
|
|
70
74
|
this.$store.state.products = this.products;
|
|
71
|
-
if (this.products.insights.selected) {
|
|
75
|
+
if (this.products.insights.selected && this.products.verify.selected) {
|
|
76
|
+
this.$router.push('/5');
|
|
77
|
+
this.$store.commit('setShouldConfigVerify', true);
|
|
78
|
+
} else if (this.products.insights.selected) {
|
|
79
|
+
this.$store.commit('setShouldConfigVerify', false);
|
|
72
80
|
this.$router.push('/5');
|
|
81
|
+
} else if (this.products.verify.selected) {
|
|
82
|
+
this.$router.push('/7');
|
|
73
83
|
} else {
|
|
74
84
|
this.$store.dispatch('confirm');
|
|
75
85
|
}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
<Navigation
|
|
35
35
|
:onConfirm="confirm"
|
|
36
36
|
:disableConfirm="selected === 'none'"
|
|
37
|
+
:navHistory="navHistory"
|
|
37
38
|
/>
|
|
38
39
|
</div>
|
|
39
40
|
</template>
|
|
@@ -46,7 +47,8 @@ export default {
|
|
|
46
47
|
return {
|
|
47
48
|
fields: this.$store.state.v4Fields,
|
|
48
49
|
header: false,
|
|
49
|
-
selected: 'none'
|
|
50
|
+
selected: 'none',
|
|
51
|
+
navHistory: this.$store.getters.getNavHistory
|
|
50
52
|
};
|
|
51
53
|
},
|
|
52
54
|
components: {
|
|
@@ -74,10 +76,15 @@ export default {
|
|
|
74
76
|
this.header = this.selected === 'all';
|
|
75
77
|
},
|
|
76
78
|
confirm () {
|
|
79
|
+
this.$store.commit('setNavHistory', '/5');
|
|
80
|
+
const shouldConfigVerify = this.$store.getters.getShouldConfigVerify;
|
|
77
81
|
this.$store.state.v4Fields = this.fields;
|
|
78
82
|
if (this.fields.page_scan?.selected) {
|
|
79
|
-
this.$router.push('/6')
|
|
80
|
-
return
|
|
83
|
+
this.$router.push('/6');
|
|
84
|
+
return;
|
|
85
|
+
} else if (shouldConfigVerify) {
|
|
86
|
+
this.$router.push('/7');
|
|
87
|
+
return;
|
|
81
88
|
}
|
|
82
89
|
this.$store.dispatch('confirm');
|
|
83
90
|
}
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
<Navigation
|
|
36
36
|
:onConfirm="confirm"
|
|
37
37
|
:disableConfirm="false"
|
|
38
|
+
:navHistory="navHistory"
|
|
38
39
|
/>
|
|
39
40
|
</div>
|
|
40
41
|
</template>
|
|
@@ -59,7 +60,9 @@ export default {
|
|
|
59
60
|
forbiddenTags: [],
|
|
60
61
|
/** @type {string[]} */
|
|
61
62
|
forbiddenOptions: [],
|
|
62
|
-
|
|
63
|
+
/** @type {string[]} */
|
|
64
|
+
navHistory: this.$store.getters.getNavHistory
|
|
65
|
+
};
|
|
63
66
|
},
|
|
64
67
|
methods: {
|
|
65
68
|
handleRequiredTag(tag) {
|
|
@@ -71,14 +74,19 @@ export default {
|
|
|
71
74
|
this.forbiddenOptions.push(tag);
|
|
72
75
|
},
|
|
73
76
|
confirm() {
|
|
77
|
+
this.$store.commit('setNavHistory', '/6')
|
|
74
78
|
this.$store.commit('setPageScan', {
|
|
75
79
|
required: this.requiredTags,
|
|
76
80
|
forbidden: this.forbiddenTags
|
|
77
81
|
});
|
|
78
|
-
this.$store.
|
|
82
|
+
if (this.$store.getters.getShouldConfigVerify) {
|
|
83
|
+
this.$router.push('/7');
|
|
84
|
+
} else {
|
|
85
|
+
this.$store.dispatch('confirm');
|
|
86
|
+
}
|
|
79
87
|
},
|
|
80
88
|
}
|
|
81
|
-
}
|
|
89
|
+
};
|
|
82
90
|
</script>
|
|
83
91
|
|
|
84
92
|
<style scoped>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<header>
|
|
4
|
+
Configure TrustedForm Verify
|
|
5
|
+
</header>
|
|
6
|
+
<section>
|
|
7
|
+
<p>
|
|
8
|
+
Enter the name of the legal entity for an advertiser that will be used to determine if they
|
|
9
|
+
were given consent in a one to one manner.
|
|
10
|
+
</p>
|
|
11
|
+
<Form :actions="false">
|
|
12
|
+
<input
|
|
13
|
+
v-model="advertiserName"
|
|
14
|
+
type="text"
|
|
15
|
+
placeholder="(optional) keep empty if you don't need to check one-to-one consent"
|
|
16
|
+
></input>
|
|
17
|
+
</Form>
|
|
18
|
+
</section>
|
|
19
|
+
<Navigation
|
|
20
|
+
:onConfirm="confirm"
|
|
21
|
+
:disableConfirm="false"
|
|
22
|
+
:navHistory="navHistory"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
import { Navigation } from '@activeprospect/integration-components';
|
|
29
|
+
import { TextField, Form } from '@activeprospect/ui-components';
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
components: {
|
|
33
|
+
Navigation,
|
|
34
|
+
TextField,
|
|
35
|
+
Form
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
/** @type {string} */
|
|
40
|
+
advertiserName: "",
|
|
41
|
+
/** @type {string[]} */
|
|
42
|
+
navHistory: this.$store.getters.getNavHistory
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
confirm() {
|
|
47
|
+
this.$store.commit('setAdvertiserName', {
|
|
48
|
+
advertiserName: this.advertiserName
|
|
49
|
+
});
|
|
50
|
+
this.$store.dispatch('confirm');
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style scoped>
|
|
57
|
+
|
|
58
|
+
input {
|
|
59
|
+
width: 65%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
</style>
|
|
@@ -6,6 +6,7 @@ import PageThree from './config/Page3.vue';
|
|
|
6
6
|
import PageFour from './config/Page4.vue';
|
|
7
7
|
import PageFive from './config/Page5.vue';
|
|
8
8
|
import PageSix from './config/Page6.vue';
|
|
9
|
+
import PageSeven from './config/Page7.vue';
|
|
9
10
|
|
|
10
11
|
export default createRouter({
|
|
11
12
|
history: createMemoryHistory(),
|
|
@@ -45,6 +46,11 @@ export default createRouter({
|
|
|
45
46
|
path: '6',
|
|
46
47
|
name: 'PageSix',
|
|
47
48
|
component: PageSix
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
path: '7',
|
|
52
|
+
name: 'PageSeven',
|
|
53
|
+
component: PageSeven
|
|
48
54
|
}
|
|
49
55
|
]
|
|
50
56
|
}
|
|
@@ -2,7 +2,7 @@ import { createStore } from 'vuex';
|
|
|
2
2
|
import fieldData from './fieldData';
|
|
3
3
|
import v4Fields from './v4fields';
|
|
4
4
|
import axios from 'axios';
|
|
5
|
-
import { castArray, get } from 'lodash';
|
|
5
|
+
import { castArray, get, includes, set, uniq } from 'lodash';
|
|
6
6
|
import { toRaw } from 'vue';
|
|
7
7
|
|
|
8
8
|
const initStore = (config, ui) => createStore({
|
|
@@ -23,6 +23,9 @@ const initStore = (config, ui) => createStore({
|
|
|
23
23
|
filters: [],
|
|
24
24
|
pageScanForbidden: [],
|
|
25
25
|
pageScanRequired: [],
|
|
26
|
+
advertiserName: undefined,
|
|
27
|
+
shouldConfigVerify: false,
|
|
28
|
+
navHistory: []
|
|
26
29
|
},
|
|
27
30
|
mutations: {
|
|
28
31
|
setErrors (state, errors) {
|
|
@@ -37,6 +40,20 @@ const initStore = (config, ui) => createStore({
|
|
|
37
40
|
setPageScan(state, { required, forbidden }) {
|
|
38
41
|
state.pageScanRequired = required;
|
|
39
42
|
state.pageScanForbidden = forbidden;
|
|
43
|
+
},
|
|
44
|
+
setAdvertiserName(state, {advertiserName}) {
|
|
45
|
+
state.advertiserName = advertiserName;
|
|
46
|
+
},
|
|
47
|
+
setShouldConfigVerify(state, shouldConfigVerify) {
|
|
48
|
+
state.shouldConfigVerify = shouldConfigVerify;
|
|
49
|
+
},
|
|
50
|
+
setNavHistory(state, navHistory) {
|
|
51
|
+
if (!includes(state.navHistory, navHistory)) {
|
|
52
|
+
state.navHistory.push(navHistory);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
resetNavHistory(state) {
|
|
56
|
+
state.navHistory = [];
|
|
40
57
|
}
|
|
41
58
|
},
|
|
42
59
|
getters: {
|
|
@@ -45,6 +62,12 @@ const initStore = (config, ui) => createStore({
|
|
|
45
62
|
},
|
|
46
63
|
getErrors: (state) => {
|
|
47
64
|
return state.errors;
|
|
65
|
+
},
|
|
66
|
+
getShouldConfigVerify: (state) => {
|
|
67
|
+
return state.shouldConfigVerify;
|
|
68
|
+
},
|
|
69
|
+
getNavHistory: (state) => {
|
|
70
|
+
return state.navHistory
|
|
48
71
|
}
|
|
49
72
|
},
|
|
50
73
|
actions: {
|
|
@@ -77,17 +100,21 @@ const initStore = (config, ui) => createStore({
|
|
|
77
100
|
});
|
|
78
101
|
},
|
|
79
102
|
createFilter(context, filterConfig) {
|
|
103
|
+
const rules = filterConfig.rules.map(rule => {
|
|
104
|
+
return {
|
|
105
|
+
op: rule.rulesOp,
|
|
106
|
+
lhv: rule.lhv,
|
|
107
|
+
rhv: rule.rhv
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
|
|
80
111
|
const filter = {
|
|
81
112
|
type: 'filter',
|
|
82
113
|
reason: filterConfig.reason,
|
|
83
114
|
outcome: filterConfig.outcome,
|
|
84
115
|
rule_set: {
|
|
85
116
|
op: 'and',
|
|
86
|
-
rules
|
|
87
|
-
op: filterConfig.rulesOp,
|
|
88
|
-
lhv: filterConfig.lhv,
|
|
89
|
-
rhv: filterConfig.rhv
|
|
90
|
-
}]
|
|
117
|
+
rules
|
|
91
118
|
},
|
|
92
119
|
description: filterConfig.description,
|
|
93
120
|
enabled: true
|
|
@@ -95,7 +122,7 @@ const initStore = (config, ui) => createStore({
|
|
|
95
122
|
context.commit('setFilters', [...context.state.filters, filter]);
|
|
96
123
|
},
|
|
97
124
|
async confirm (context) {
|
|
98
|
-
const { products, v4Fields, pageScanForbidden, pageScanRequired } = context.state;
|
|
125
|
+
const { products, v4Fields, pageScanForbidden, pageScanRequired, advertiserName } = context.state;
|
|
99
126
|
const flow = {
|
|
100
127
|
steps: [{
|
|
101
128
|
type: 'recipient',
|
|
@@ -142,14 +169,37 @@ const initStore = (config, ui) => createStore({
|
|
|
142
169
|
}
|
|
143
170
|
|
|
144
171
|
if (products.verify.selected) {
|
|
145
|
-
|
|
146
|
-
|
|
172
|
+
|
|
173
|
+
if(advertiserName) {
|
|
174
|
+
flow.steps[0].integration.mappings.push({
|
|
175
|
+
property: 'trustedform.advertiser_name',
|
|
176
|
+
value: advertiserName
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const verifyRules = {
|
|
147
181
|
rulesOp: 'is not equal to',
|
|
148
182
|
lhv: 'trustedform.outcome',
|
|
149
183
|
rhv: 'success',
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const oneToOneRules = [
|
|
187
|
+
{ ...verifyRules },
|
|
188
|
+
{
|
|
189
|
+
rulesOp: 'is false',
|
|
190
|
+
lhv: 'trustedform.one_to_one',
|
|
191
|
+
}
|
|
192
|
+
];
|
|
193
|
+
|
|
194
|
+
const rules = advertiserName ? oneToOneRules : [verifyRules];
|
|
195
|
+
|
|
196
|
+
const filterConfig = {
|
|
197
|
+
reason: '{{trustedform.reason}}',
|
|
150
198
|
outcome: 'failure',
|
|
151
|
-
description: 'Filter leads that fail on Trustedform Verify check'
|
|
199
|
+
description: 'Filter leads that fail on Trustedform Verify check',
|
|
200
|
+
rules
|
|
152
201
|
};
|
|
202
|
+
|
|
153
203
|
await context.dispatch('createFilter', filterConfig);
|
|
154
204
|
}
|
|
155
205
|
context.state.filters.forEach(filter => {
|
|
@@ -159,7 +209,7 @@ const initStore = (config, ui) => createStore({
|
|
|
159
209
|
});
|
|
160
210
|
}
|
|
161
211
|
context.state.ui.create({ flow });
|
|
162
|
-
}
|
|
212
|
+
},
|
|
163
213
|
}
|
|
164
214
|
});
|
|
165
215
|
|