leadconduit-trustedform 2.7.0 → 2.7.2

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.
@@ -7,33 +7,12 @@ on:
7
7
  description: "version | patch | minor | major"
8
8
  required: true
9
9
  default: "patch"
10
+
10
11
  jobs:
11
12
  publish:
12
- environment: release
13
- runs-on: ubuntu-latest
14
- name: 'Bump version and publish'
15
- env:
16
- VERSION: ${{ github.event.inputs.version }}
17
- NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
18
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
19
- steps:
20
- - uses: actions/checkout@v3
21
- with:
22
- token: ${{ secrets.GH_TOKEN }}
23
- - name: Install Node.js
24
- uses: actions/setup-node@v3
25
- with:
26
- node-version: 18
27
- - name: Install packages
28
- run: npm install
29
- env:
30
- NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
31
- - name: version and publish
32
- run: |
33
- git stash
34
- git config user.name $GITHUB_ACTOR
35
- git config user.email gh-actions-${GITHUB_ACTOR}@github.com
36
- git remote add gh-origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
37
- npm version $VERSION -m "Version %s"
38
- npm publish
39
- git push gh-origin $GITHUB_REF --tags
13
+ uses: activeprospect/github-action-workflows/.github/workflows/release.yml@master
14
+ with:
15
+ version: ${{ github.event.inputs.version }}
16
+ secrets:
17
+ NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
18
+
@@ -2,18 +2,6 @@ name: Node.js CI
2
2
  on: push
3
3
  jobs:
4
4
  test:
5
- runs-on: ubuntu-latest
6
- strategy:
7
- matrix:
8
- node-version: [18.x, 20.x, latest]
9
- env:
5
+ uses: activeprospect/github-action-workflows/.github/workflows/test.yml@master
6
+ secrets:
10
7
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11
- steps:
12
- - uses: actions/checkout@v3
13
- - name: Use Node.js ${{ matrix.node-version }}
14
- uses: actions/setup-node@v3
15
- with:
16
- node-version: ${{ matrix.node-version }}
17
- - run: npm install
18
- - name: Run tests
19
- run: npx nyc@latest --reporter=lcov npm test
package/docs/index.md CHANGED
@@ -2,5 +2,6 @@
2
2
  provider: ActiveProspect
3
3
  name: TrustedForm
4
4
  link: https://activeprospect.com/products/trustedform/
5
+ account_access: paid
5
6
  ---
6
7
  Independently verify the origin of Internet leads with a real-time replay of the web form as seen by the consumer.
@@ -1,16 +1,16 @@
1
- const request = require('request');
1
+ const request = require('@activeprospect/request-capture/request');
2
2
 
3
3
  module.exports = (req, res) => {
4
4
  const { apiKey } = req.query;
5
5
  if (!apiKey) return res.status(422).send({ error: 'missing required field: apiKey' });
6
6
 
7
7
  const trustedFormUrl = {
8
- 'production': 'https://app.trustedform.com/account',
9
- 'staging': 'https://app.staging.trustedform.com/account',
10
- 'test': 'https://app.staging.trustedform.com/account',
11
- 'development': 'https://app.trustedform-dev.com/account',
8
+ production: 'https://app.trustedform.com/account',
9
+ staging: 'https://app.staging.trustedform.com/account',
10
+ test: 'https://app.staging.trustedform.com/account',
11
+ development: 'https://app.trustedform-dev.com/account'
12
12
  };
13
- const url = trustedFormUrl[process?.env.NODE_ENV] || trustedFormUrl['development'];
13
+ const url = trustedFormUrl[process?.env.NODE_ENV] || trustedFormUrl.development;
14
14
 
15
15
  const options = {
16
16
  url,
@@ -18,7 +18,7 @@ module.exports = (req, res) => {
18
18
  headers: {
19
19
  accept: 'application/json',
20
20
  authorization: `Basic ${Buffer.from(`X:${apiKey}`).toString('base64')}`
21
- },
21
+ }
22
22
  };
23
23
 
24
24
  request(options, (err, response, body) => {
@@ -27,13 +27,11 @@ module.exports = (req, res) => {
27
27
  let message = '';
28
28
  try {
29
29
  message = JSON.parse(body).error;
30
- }
31
- catch (e) {
30
+ } catch (e) {
32
31
  message = `Error (${response.statusCode}); unable to parse response from TrustedForm`;
33
32
  }
34
33
  return res.status(response.statusCode).send({ error: message });
35
- }
36
- else {
34
+ } else {
37
35
  res.status(200).send(body);
38
36
  }
39
37
  });
@@ -1,7 +1,7 @@
1
1
  import { createStore } from 'vuex';
2
2
  import fieldData from './fieldData';
3
3
  import v4FieldsDefault from './v4fields';
4
- import axios from 'axios';
4
+ import axios from '@activeprospect/request-capture/client-browser';
5
5
  import { castArray, get, includes } from 'lodash';
6
6
  import { toRaw } from 'vue';
7
7