Socket
Socket
Sign inDemoInstall

companies-house-api-es6

Package Overview
Dependencies
4
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.1 to 1.1.2

lib/CompaniesHouseGenericService.js

16

index.js

@@ -6,2 +6,3 @@ /**

const CHP = require('./lib/CompaniesHouseProfileService');
const CHG = require('./lib/CompaniesHouseGenericService');

@@ -120,4 +121,19 @@ class CompaniesHouseApi{

//#### Generic methods ####//
getLink(link){
return new Promise(
(resolve, reject) => {
if (!link)
reject('Please include a link to GET');
new CHG(this.apiKey).getLink(link).then(result => {
resolve(result);
}).catch(err => {
reject(err);
});
}
)
}
}
module.exports = CompaniesHouseApi;

9

lib/CompaniesHouseProfileService.js

@@ -23,7 +23,4 @@ /**

method:'get',
url: 'https://api.companieshouse.gov.uk/company',
params: {
company_number: companyNumber
},
auth:{
url: `https://api.companieshouse.gov.uk/company/${companyNumber}`,
auth: {
username: this.apiKey,

@@ -35,3 +32,3 @@ password: ''

case 200:
resolve(result);
resolve(result.data);
break;

@@ -38,0 +35,0 @@ case 404:

@@ -24,3 +24,4 @@ /**

params: {
q: id
q: id,
items_per_page: 1
},

@@ -37,3 +38,3 @@ auth:{

}
)
);
}

@@ -43,3 +44,3 @@

* This method queries the Companies House API for a generic query. Returns an array of companies which you can limit.
* @param id
* @param query
* @param itemCount

@@ -63,3 +64,3 @@ * @returns {Promise}

}).then(result => {
result.data.items.length > 0 ? resolve(result.data.items) : reject('Sorry no results match your search');
resolve(result.data.items);
}).catch(err => {

@@ -69,3 +70,3 @@ reject(err);

}
)
);
}

@@ -94,3 +95,3 @@

}).then(result => {
result.data.items.length > 0 ? resolve(result.data.items) : reject('Sorry no results match your search');
resolve(result.data.items);
}).catch(err => {

@@ -100,3 +101,3 @@ reject(err);

}
)
);
}

@@ -164,2 +165,2 @@

module.exports = CompaniesHouseSearchService;
module.exports = CompaniesHouseSearchService;
{
"name": "companies-house-api-es6",
"version": "1.1.1",
"version": "1.1.2",
"description": "This service will do a companies house lookup for a registered UK company",

@@ -20,4 +20,4 @@ "main": "index.js",

"dependencies": {
"axios": "^0.16.1"
"axios": "^0.19.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc