leadconduit-trustedform 2.3.6 → 2.4.1

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 CHANGED
@@ -2,6 +2,14 @@
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
+ ## [2.4.1] - 2024-08-12
6
+ ### Added
7
+ - added "|" to be the default scan delimiter for TF version 4
8
+
9
+ ## [2.4.0] - 2024-04-10
10
+ ### Added
11
+ - v4 integration now supports optional api key mapping
12
+
5
13
  ## [2.3.6] - 2024-03-12
6
14
  ### Fixed
7
15
  - v4 integration now appends `masked_cert_url` when present
@@ -1,3 +1,4 @@
1
+ const { get } = require('lodash');
1
2
  const helpers = require('./helpers');
2
3
  const { compact, pickBy, isUndefined } = require('lodash');
3
4
 
@@ -24,7 +25,7 @@ const request = (vars) => {
24
25
  body.insights.scans = {
25
26
  required: trustedform.scan_required_text,
26
27
  forbidden: trustedform.scan_forbidden_text,
27
- delimiter: trustedform.scan_delimiter
28
+ delimiter: get(trustedform, 'scan_delimiter', '|'),
28
29
  };
29
30
  }
30
31
  }
@@ -39,7 +40,7 @@ const request = (vars) => {
39
40
  headers: {
40
41
  'Content-Type': 'application/json',
41
42
  'api-version': '4.0',
42
- Authorization: `Basic ${Buffer.from(`X:${vars.activeprospect.api_key}`).toString('base64')}`
43
+ Authorization: `Basic ${Buffer.from(`X:${trustedform.api_key || vars.activeprospect.api_key}`).toString('base64')}`
43
44
  }
44
45
  };
45
46
  };
@@ -77,6 +78,7 @@ request.variables = () => [
77
78
  { name: 'lead.trustedform_cert_url', type: 'trustedform_url', required: true, description: 'TrustedForm Certificate URL' },
78
79
  { name: 'lead.email', type: 'string', required: false, description: `The email of the consumer you believe was recorded in the certificate; defaults to the lead's "Email" field.` },
79
80
  { name: 'lead.phone_1', type: 'string', required: false, description: `The phone number of the consumer you believe was recorded in the certificate; defaults to the lead's "Phone 1" field.`},
81
+ { name: 'trustedform.api_key', type: 'string', required: false, description: 'Optional TrustedForm API key. Used for claiming certs that belong to another account' },
80
82
 
81
83
  { name: 'trustedform.retain', type: 'boolean', required: true, description: 'If true, a request to the Retain product will be made' },
82
84
  { name: 'trustedform.custom_reference', type: 'string', required: false, description: `Any text that may help you identify the lead associated with the certificate, such as a unique lead identifier or URL pointing to the lead in another system; defaults to the lead's url.` },
@@ -178,8 +180,8 @@ const response = (vars, req, res) => {
178
180
  page_url: parsed.insights?.properties?.page_url,
179
181
  parent_page_url: parsed.insights?.properties?.parent_page_url,
180
182
 
181
- languages: parsed.insights?.properties?.languages,
182
- language_approved: parsed.insights?.properties?.language_approved,
183
+ languages: parsed.verify?.languages.map(lang => lang.text),
184
+ language_approved: parsed.verify?.result?.language_approved,
183
185
  success: parsed.verify?.result?.success,
184
186
  }, (v) => { return !isUndefined(v); });
185
187
  // only include this property if page scan was selected
@@ -255,7 +257,7 @@ response.variables = () => [
255
257
  { name: 'page_url', type: 'string', description: 'The URL of the page hosting TrustedForm Certify.' },
256
258
  { name: 'parent_page_url', type: 'string', description: 'The parent URL of the page hosting TrustedForm Certify, if framed.' },
257
259
  { name: 'verify.languages', type: 'array', description: 'A list of the consent languages detected within the certificate' },
258
- { name: 'verify.language_approved', type: 'string', description: 'A boolean indicating if any of the consent languages found have been approved in your account\'s consent language manager.' },
260
+ { 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.' },
259
261
  { name: 'verify.success', type: 'boolean', description: 'A boolean indicating if any of the consent languages found meet the success criteria defined for your account.' },
260
262
  ];
261
263