leadconduit-trustedform 2.7.1 → 2.7.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.
@@ -1,19 +1,13 @@
1
1
  name: Node.js CI
2
+
2
3
  on: push
4
+
3
5
  jobs:
4
6
  test:
5
- runs-on: ubuntu-latest
6
- strategy:
7
- matrix:
8
- node-version: [18.x, 20.x, latest]
9
- env:
7
+ uses: activeprospect/github-action-workflows/.github/workflows/test.yml@master
8
+ with:
9
+ install_command: npm ci
10
+ codecov: true
11
+ secrets:
10
12
  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
13
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -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,14 +27,12 @@ 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 {
37
- res.status(200).send(body);
34
+ } else {
35
+ res.status(200).type('json').send(body);
38
36
  }
39
37
  });
40
38
  };
@@ -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