leadconduit-trustedform 1.17.2 → 1.17.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/CHANGELOG.md +4 -0
- package/lib/claim.js +1 -0
- package/lib/consent.js +1 -0
- package/lib/data_service.js +2 -0
- package/lib/helpers.js +16 -8
- package/package.json +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org)
|
|
4
4
|
|
|
5
|
+
## [1.17.2] - 2021-12-21
|
|
6
|
+
### Added
|
|
7
|
+
- Added support for `scan_delimiter` parameter ([sc-34085](https://app.shortcut.com/active-prospect/story/34085/add-field-mapping-for-scan-delimiter-to-trustedform-integrations))
|
|
8
|
+
|
|
5
9
|
## [1.17.2] - 2021-12-21
|
|
6
10
|
### Fixed
|
|
7
11
|
- Fixed to use returned `reason` on 40x responses ([sc-33842](https://app.shortcut.com/active-prospect/story/33842/trustedform-consent-consent-data-return-incorrect-reason))
|
package/lib/claim.js
CHANGED
|
@@ -24,6 +24,7 @@ const requestVariables = () => [
|
|
|
24
24
|
{ name: 'lead.trustedform_cert_url', type: 'string', required: true, description: 'TrustedForm Certificate URL' },
|
|
25
25
|
{ name: 'trustedform.scan_required_text', type: 'array', required: false, description: 'Required text to search snapshot for' },
|
|
26
26
|
{ name: 'trustedform.scan_forbidden_text', type: 'array', required: false, description: 'Forbidden text to search snapshot for' },
|
|
27
|
+
{ name: 'trustedform.scan_delimiter', type: 'string', required: false, description: 'The character used to surround an asterisk and identify it as a wildcard (default: |)' },
|
|
27
28
|
{ name: 'trustedform.vendor', type: 'string', required: false, description: 'Lead vendor name sent to TrustedForm, defaults to the lead source name' },
|
|
28
29
|
{ name: 'trustedform.api_key', type: 'credential', required: false, description: 'Optional TrustedForm API key. Used for claiming certs that belong to another account' },
|
|
29
30
|
{ name: 'trustedform.custom_reference', type: 'string', required: false, description: 'Optional reference, defaults to the lead\'s url' },
|
package/lib/consent.js
CHANGED
|
@@ -28,6 +28,7 @@ const requestVariables = () => [
|
|
|
28
28
|
{ name: 'trustedform.vendor', type: 'string', required: false, description: 'Lead vendor name sent to TrustedForm, defaults to the lead source name' },
|
|
29
29
|
{ name: 'trustedform.api_key', type: 'credential', required: false, description: 'Optional TrustedForm API key. Used for claiming certs that belong to another account' },
|
|
30
30
|
{ name: 'trustedform.custom_reference', type: 'string', required: false, description: 'Optional reference, defaults to the lead\'s url' },
|
|
31
|
+
{ name: 'trustedform.scan_delimiter', type: 'string', required: false, description: 'The character used to surround an asterisk and identify it as a wildcard (default: |)' },
|
|
31
32
|
{ name: 'lead.email', type: 'string', required: false, description: 'Lead email that will be fingerprinted, defaults to the lead\'s "Email" field' },
|
|
32
33
|
{ name: 'lead.phone_1', type: 'string', required: false, description: 'Lead phone 1 that will be fingerprinted, defaults to the lead\'s "Phone 1" field' },
|
|
33
34
|
{ name: 'lead.phone_2', type: 'string', required: false, description: 'Lead phone 2 that will be fingerprinted, defaults to the lead\'s "Phone 2" field' },
|
package/lib/data_service.js
CHANGED
|
@@ -15,6 +15,7 @@ const request = (vars) => {
|
|
|
15
15
|
let body = {
|
|
16
16
|
'scan[]': get(trustedform, 'scan_required_text'),
|
|
17
17
|
'scan[]!': get(trustedform, 'scan_forbidden_text'),
|
|
18
|
+
scan_delimiter: get(trustedform, 'scan_delimiter', '|'),
|
|
18
19
|
phone_1: lead.phone_1,
|
|
19
20
|
phone_2: lead.phone_2,
|
|
20
21
|
phone_3: lead.phone_3,
|
|
@@ -41,6 +42,7 @@ request.variables = () => [
|
|
|
41
42
|
{ name: 'lead.trustedform_cert_url', type: 'string', required: true, description: 'TrustedForm Certificate URL' },
|
|
42
43
|
{ name: 'trustedform.scan_required_text', type: 'array', required: false, description: 'Required text to search snapshot for' },
|
|
43
44
|
{ name: 'trustedform.scan_forbidden_text', type: 'array', required: false, description: 'Forbidden text to search snapshot for' },
|
|
45
|
+
{ name: 'trustedform.scan_delimiter', type: 'string', required: false, description: 'The character used to surround an asterisk and identify it as a wildcard (default: |)' },
|
|
44
46
|
{ name: 'trustedform.vendor', type: 'string', required: false, description: 'Lead vendor name sent to TrustedForm, defaults to the lead source name' },
|
|
45
47
|
{ name: 'lead.email', type: 'string', required: false, description: 'Lead email that will be fingerprinted, defaults to the lead\'s "Email" field' },
|
|
46
48
|
{ name: 'lead.phone_1', type: 'string', required: false, description: 'Lead phone 1 that will be fingerprinted, defaults to the lead\'s "Phone 1" field' },
|
package/lib/helpers.js
CHANGED
|
@@ -89,16 +89,24 @@ const validate = (vars) => {
|
|
|
89
89
|
if (!productionValid && !stagingValid) return 'TrustedForm cert URL must be valid';
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
const
|
|
93
|
-
|
|
92
|
+
const getLeadConduitUrl = (env = process.env.NODE_ENV) => {
|
|
93
|
+
switch (env) {
|
|
94
|
+
case 'localhost': return 'http://leadconduit.localhost';
|
|
95
|
+
case 'development': return 'https://app.leadconduit-development.com';
|
|
96
|
+
case 'staging': return 'https://app.leadconduit-staging.com';
|
|
97
|
+
case 'production': return 'https://app.leadconduit.com';
|
|
98
|
+
default: return 'https://app.leadconduit.com';
|
|
99
|
+
}
|
|
100
|
+
};
|
|
94
101
|
|
|
95
|
-
|
|
102
|
+
const configureClaimOptions = (lead, trustedform = {}, sourceName) => {
|
|
96
103
|
return {
|
|
97
|
-
cert_url:
|
|
98
|
-
vendor: _.get(trustedform, 'vendor'
|
|
99
|
-
reference: trustedform
|
|
100
|
-
required_text: trustedform
|
|
101
|
-
forbidden_text: trustedform
|
|
104
|
+
cert_url: formatUrl(lead.trustedform_cert_url),
|
|
105
|
+
vendor: _.get(trustedform, 'vendor', sourceName),
|
|
106
|
+
reference: _.get(trustedform, 'custom_reference', `${getLeadConduitUrl()}/events/${lead.id}`),
|
|
107
|
+
required_text: _.get(trustedform, 'scan_required_text'),
|
|
108
|
+
forbidden_text: _.get(trustedform, 'scan_forbidden_text'),
|
|
109
|
+
scan_delimiter: _.get(trustedform, 'scan_delimiter', '|'),
|
|
102
110
|
email: lead.email,
|
|
103
111
|
phone_1: lead.phone_1,
|
|
104
112
|
phone_2: lead.phone_2,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leadconduit-trustedform",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.3",
|
|
4
4
|
"description": "LeadConduit integration with TrustedForm",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,14 +23,12 @@
|
|
|
23
23
|
"leadconduit-integration": "^0.4.1",
|
|
24
24
|
"leadconduit-integration-ui": "^1.1.4",
|
|
25
25
|
"lodash": "^4.17.20",
|
|
26
|
-
"trustedform-api-client": "^1.0.
|
|
26
|
+
"trustedform-api-client": "^1.0.7",
|
|
27
27
|
"vue": "^2.6.11",
|
|
28
28
|
"vue-router": "^3.1.6",
|
|
29
29
|
"vuex": "^3.1.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@activeprospect/integration-dev-dependencies": "^1.1.0"
|
|
33
|
-
"leadconduit-types": "^4",
|
|
34
|
-
"timekeeper": "^2.2.0"
|
|
32
|
+
"@activeprospect/integration-dev-dependencies": "^1.1.0"
|
|
35
33
|
}
|
|
36
34
|
}
|