Skip to content

Commit 42fbc44

Browse files
Merge pull request #22 from Linkurious/develop
Release 1.0.4 [ci:run]
2 parents 1579f65 + f3e0125 commit 42fbc44

13 files changed

Lines changed: 153 additions & 42 deletions

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.0.3
2+
current_version = 1.0.4
33
commit = False
44
tag = False
55
serialize =

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.3
1+
1.0.4

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "third-party-data",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"pluginApiVersion": "1.0.0",
55
"publicRoute": "dist/frontend",
66
"singlePageAppIndex": "index.html",

package-lock.json

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@linkurious/lke-plugin-third-party-data",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "LKE Plugin - Third Party Data",
55
"homepage": "https://github.com/Linkurious/lke-plugin-third-party-data#readme",
66
"bugs": {
@@ -11,31 +11,26 @@
1111
"url": "https://github.com/Linkurious/lke-plugin-third-party-data"
1212
},
1313
"engines": {
14-
"node": "18.18.2"
14+
"node": "20.18.0"
1515
},
1616
"author": {
1717
"name": "David Rapin",
1818
"email": "david@linkurio.us"
1919
},
2020
"config": {},
2121
"scripts": {
22+
"start": "npm start -w=packages/frontend",
2223
"npm-package-name": "echo ${npm_package_name}-${npm_package_version}.tgz | sed -e 's/@//' -e 's/\\//-/'",
2324
"plugin-name": "echo ${npm_package_name} | sed -e 's/^@.*\\///' -e s/^lke-plugin-//",
2425
"artifact-name": "echo lke-plugin-$(npm run --silent plugin-name).lke",
25-
"clean": "rm -rf ./dist *.tgz *.lke",
26+
"clean": "rm -rf ./tmp ./dist *.tgz *.lke ./reports",
2627
"clean:modules": "rm -rf ./package-lock.json ./node_modules",
2728
"lint": "npm run lint -ws",
2829
"lint:fix": "npm run lint:fix -ws",
2930
"lint:ci": "eslint -f checkstyle -o reports/checkstyle.xml .",
3031
"build": "npm run build -ws",
32+
"test": "npm test -w=packages/backend",
3133
"postbuild": "mkdir -p tmp/github_release && npm pack && mv $(npm run --silent npm-package-name) $(npm run --silent artifact-name) && ln -sf $(pwd)/$(npm run --silent artifact-name) $(pwd)/tmp/github_release/lke-plugin-$(npm run --silent plugin-name)-v$(cat .version).lke",
32-
"//deploy:login": "curl -X POST $npm_config_deploy_url/api/auth/login --cookie-jar 'lke.cookie' -H 'Content-type: application/json' -d '{ \"usernameOrEmail\": \"'$npm_config_deploy_user'\", \"password\": \"'$npm_config_deploy_pass'\" }'",
33-
"//deploy:logout": "curl -X GET $npm_config_deploy_url/api/auth/logout --cookie 'lke.cookie' -H 'Content-type: application/json' && rm lke.cookie",
34-
"//predeploy:restart-plugins": "npm run deploy:login",
35-
"//deploy:restart-plugins": "curl -X POST $npm_config_deploy_url/api/admin/plugins/restart-all --cookie 'lke.cookie'",
36-
"//postdeploy:restart-plugins": "npm run deploy:logout",
37-
"//deploy": "cp $(npm run --silent artifact-name) $npm_config_deploy_plugin_folder",
38-
"//postdeploy": "npm run deploy:restart-plugins",
3934
"build-deploy": "npm run build && npm run deploy",
4035
"manual-upload": "gh release create \"v$(cat .version)\" $(npm run --silent artifact-name)",
4136
"bump:patch": "bump2version patch && npm version --no-git-tag-version patch",
@@ -50,7 +45,7 @@
5045
],
5146
"bundledDependencies": true,
5247
"dependencies": {
53-
"@linkurious/rest-client": "4.0.19",
48+
"@linkurious/rest-client": "4.1.6",
5449
"express": "4.17.3",
5550
"superagent": "8.1.2"
5651
},

packages/backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"start": "node ../../dist/backend/src/dev/server.js",
66
"build": "tsc -b tsconfig.json",
7+
"test": "node --test ../../dist/backend/src/test/*.js",
78
"lint": "eslint ./src ../shared --ext .ts",
89
"lint:fix": "eslint ./src ../shared --ext .ts --fix"
910
},

packages/backend/src/models/detailsOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class DetailsOptions {
66
public readonly integrationId: string;
77
public readonly searchResultId: string;
88

9-
private constructor(params: {integrationId: string; searchResultId: string}) {
9+
constructor(params: {integrationId: string; searchResultId: string}) {
1010
this.integrationId = params.integrationId;
1111
this.searchResultId = params.searchResultId;
1212
}

packages/backend/src/services/vendor/driver/annuaireEntreprisesDriver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class AnnuaireEntreprisesDriver extends BaseSearchDriver<
3030
url.searchParams.set('page', '1');
3131
url.searchParams.set('per_page', `${maxResults}`);
3232

33-
const r = await this.client.get(url.toString()).set('accept', 'json');
33+
const r = await this.client.get(url.toString()).set('accept', 'application/json');
3434
if (r.status !== 200) {
3535
throw new Error(`Failed to get search results: ${(r.body as ResponseBody).erreur}`);
3636
}

packages/backend/src/services/vendor/driver/companyHouseUkDriver.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {Response} from 'superagent';
2+
13
import {VendorResult} from '../../../../../shared/api/response';
24
import {BaseDetailsSearchDriver, flattenJson} from '../baseSearchDriver';
35
import {VendorIntegration} from '../../../../../shared/integration/vendorIntegration';
@@ -37,14 +39,16 @@ export class CompanyHouseUkDriver extends BaseDetailsSearchDriver<
3739
const r = await this.client
3840
.get(url.toString())
3941
.auth(integration.getAdminSettings('apiKey'), '', {type: 'basic'})
40-
.set('accept', 'json');
42+
.set('accept', 'application/json');
4143
if (r.status === 401) {
4244
throw new Error(`Invalid API key`);
4345
}
4446
if (r.status !== 200) {
4547
throw new Error(`Failed to get search results: ${JSON.stringify(r.body)}`);
4648
}
4749
return (r.body as SearchResponseBody).items.map((company) => {
50+
delete company.kind;
51+
delete company.snippet;
4852
delete company.address_snippet;
4953
delete company.matches;
5054
return {
@@ -64,10 +68,18 @@ export class CompanyHouseUkDriver extends BaseDetailsSearchDriver<
6468
const url = new URL(
6569
`https://api.company-information.service.gov.uk/company/${detailsOptions.searchResultId}`
6670
);
67-
const r = await this.client
68-
.get(url.toString())
69-
.auth(integration.getAdminSettings('apiKey'), '', {type: 'basic'})
70-
.set('accept', 'json');
71+
let r: Response;
72+
try {
73+
r = await this.client
74+
.get(url.toString())
75+
.auth(integration.getAdminSettings('apiKey'), '', {type: 'basic'})
76+
.set('accept', 'application/json');
77+
} catch (e) {
78+
if (process.env.DEBUG) {
79+
console.log('HTTP error: ' + JSON.stringify(e));
80+
}
81+
throw e;
82+
}
7183
if (r.status === 401) {
7284
throw new Error(`Invalid API key`);
7385
}

packages/backend/src/services/vendor/driver/dnbPeopleLookupDriver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class DnbPeopleLookupDriver extends BaseSearchDriver<
4444
const r = await this.client
4545
.get(url.toString())
4646
.auth(token, {type: 'bearer'})
47-
.set('accept', 'json');
47+
.set('accept', 'application/json');
4848
if (r.status !== 200) {
4949
throw new Error(`Failed to get search results (http ${r.status})`);
5050
}

0 commit comments

Comments
 (0)