leadconduit-trustedform 2.7.2 → 2.7.4

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.
@@ -1,7 +1,13 @@
1
1
  name: Node.js CI
2
+
2
3
  on: push
4
+
3
5
  jobs:
4
6
  test:
5
7
  uses: activeprospect/github-action-workflows/.github/workflows/test.yml@master
8
+ with:
9
+ install_command: npm ci
10
+ codecov: true
6
11
  secrets:
7
12
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
13
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
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.8.0] - 2026-11-19
6
+ ### Added
7
+ - v4 Retain now sends the vendor's ActiveProspect account ID as `retain.vendor_account_id` ([TF-148](https://leadid.atlassian.net/browse/TF-148)).
8
+ It comes from the new `trustedform.vendor_account_id` mapping, or from `source.sso_id` when that mapping is blank.
9
+ - v4 Retain now appends `vendor_account_id`, the value TrustedForm accepted
10
+
5
11
  ## [2.6.0] - 2025-05-05
6
12
  ### Added
7
13
  - v4 Verify now appends `opt_in_type`, based on `opt_in_types_satisfied` ([sc-90678](https://app.shortcut.com/active-prospect/story/90678/trustedform-v4-verify-include-opt-in-types-satisfied-as-an-appended-field))
@@ -16,6 +16,10 @@ const request = (vars) => {
16
16
  reference: trustedform.custom_reference || `${helpers.getLeadConduitUrl()}/events/${lead.id}`,
17
17
  vendor: trustedform.vendor || vars.source.name
18
18
  };
19
+ const vendorAccountId = trustedform.vendor_account_id?.toString().trim() || vars.source.sso_id?.toString().trim();
20
+ if (vendorAccountId) {
21
+ body.retain.vendor_account_id = vendorAccountId;
22
+ }
19
23
  }
20
24
 
21
25
  if (trustedform.insights.valueOf()) {
@@ -101,6 +105,7 @@ request.variables = () => [
101
105
  { name: 'trustedform.retain', type: 'boolean', required: true, description: 'If true, a request to the Retain product will be made' },
102
106
  { 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.` },
103
107
  { name: 'trustedform.vendor', type: 'string', required: false, description: `The name of the company that provided the lead associated with the certificate; defaults to the lead source's name.` },
108
+ { name: 'trustedform.vendor_account_id', type: 'string', required: false, description: `The ActiveProspect account ID of the company that provided the lead associated with the certificate. It must be a 24-character hexadecimal ActiveProspect account ID; other values are ignored by TrustedForm. Defaults to the ActiveProspect account ID of the lead source's company, when known.` },
104
109
 
105
110
  { name: 'trustedform.insights', type: 'boolean', required: true, description: 'If true, a request to the Insights product will be made' },
106
111
  { name: 'insights.age', type: 'boolean', required: false, description: 'Request TrustedForm Insights age data?' },
@@ -181,6 +186,7 @@ const response = (vars, req, res) => {
181
186
 
182
187
  reference_code: parsed.retain?.reference,
183
188
  vendor: parsed.retain?.vendor,
189
+ vendor_account_id: parsed.retain?.vendor_account_id,
184
190
  previously_retained: parsed.retain?.results?.previously_retained,
185
191
  masked_cert_url: parsed.retain?.results?.masked_cert_url,
186
192
  share_url: parsed.retain?.results?.share_url,
@@ -258,6 +264,7 @@ response.variables = () => [
258
264
  { name: 'phone_fingerprint_matched', type: 'boolean', description: 'A boolean indicating if any phone matches were found during the lead matching operation. A null value indicates that no phone numbers were provided.' },
259
265
  { name: 'reference_code', type: 'string', description: 'The parameter provided in the request, intended to be a reference to help you identify the lead associated with the certificate.' },
260
266
  { name: 'vendor', type: 'string', description: 'The parameter provided in the request, intended to be the name of the company that provided the lead associated with the certificate.' },
267
+ { name: 'vendor_account_id', type: 'string', description: 'The ActiveProspect account ID of the company that provided the lead, as accepted by TrustedForm. Empty when TrustedForm did not accept it.' },
261
268
  { name: 'previously_retained', type: 'boolean', description: 'A boolean indicating whether your account had already retained this certificate.' },
262
269
  { name: 'expires_at', type: 'time', description: 'The UTC ISO8601 formatted date and time when this certificate will no longer be available for API requests.' },
263
270
  { name: 'masked_cert_url', type: 'url', description: 'The certificate url that masks the lead source url and snapshot' },
@@ -32,7 +32,7 @@ module.exports = (req, res) => {
32
32
  }
33
33
  return res.status(response.statusCode).send({ error: message });
34
34
  } else {
35
- res.status(200).send(body);
35
+ res.status(200).type('json').send(body);
36
36
  }
37
37
  });
38
38
  };