companies-house-rest 1.0.0 → 1.2.0
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.
- checksums.yaml +4 -4
- data/README.md +116 -49
- data/companies-house-rest.gemspec +1 -8
- data/lib/companies_house/client.rb +80 -2
- data/lib/companies_house/request.rb +2 -2
- data/lib/companies_house/version.rb +1 -1
- metadata +3 -110
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c519f46e0ee9de3687b83ef95b31323737c3de14ac741e1139006de81d7f3cf
|
4
|
+
data.tar.gz: 695dcbe9e2dcb2851fa8867233e3d775931c58096cc6d89e12522a03f2eb3cbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3243b83878ad086bae547477f867a226400a1cd83dc6d86816267d261a2c819938e6f9113dbe396285284d80aef1dd0b01e96e6cbd0d1a1072b6087512aa3f6
|
7
|
+
data.tar.gz: d135ebad3158e1b5fc87c18e67f8e32ab47e03ff6511aa3c6815e2621aac4b911b632e6a5d16b24748fd4efdba1015007e71f641934d2f083fed09c6aa40c943
|
data/README.md
CHANGED
@@ -4,9 +4,8 @@
|
|
4
4
|
|
5
5
|
This Gem implements an API client for the Companies House REST API. It can be
|
6
6
|
used to look up information about companies registered in the United Kingdom.
|
7
|
-
As of July 2016, this API is described by Companies House as a "beta service."
|
8
7
|
More information about this free API can be found
|
9
|
-
[on the Companies House API website](https://developer.
|
8
|
+
[on the Companies House API website](https://developer.company-information.service.gov.uk/).
|
10
9
|
|
11
10
|
To interact the older [CompaniesHouse XML-based API](http://xmlgw.companieshouse.gov.uk/),
|
12
11
|
see the gem [companies-house-gateway](https://github.com/gocardless/companies-house-gateway-ruby).
|
@@ -14,19 +13,19 @@ see the gem [companies-house-gateway](https://github.com/gocardless/companies-ho
|
|
14
13
|
|
15
14
|
Quick start:
|
16
15
|
|
17
|
-
|
18
|
-
[on the CompaniesHouse Developers website](https://developer.
|
19
|
-
|
20
|
-
|
16
|
+
- Register an account via the `Sign In / Register` link
|
17
|
+
[on the CompaniesHouse Developers website](https://developer.company-information.service.gov.uk/)
|
18
|
+
- Register an API key at [Your Applications](https://developer.company-information.service.gov.uk/manage-applications)
|
19
|
+
- Put your API key in an environment variable (not in your code):
|
21
20
|
|
22
|
-
```
|
21
|
+
```shell
|
23
22
|
export COMPANIES_HOUSE_API_KEY=YOUR_API_KEY_HERE
|
24
23
|
```
|
25
24
|
|
26
|
-
|
27
|
-
|
25
|
+
- Install `companies-house-rest` through [RubyGems](https://rubygems.org/gems/companies-house-rest)
|
26
|
+
- Create and use a client:
|
28
27
|
|
29
|
-
```
|
28
|
+
```ruby
|
30
29
|
require 'companies_house/client'
|
31
30
|
client = CompaniesHouse::Client.new(api_key: ENV['COMPANIES_HOUSE_API_KEY'])
|
32
31
|
profile = client.company('07495895')
|
@@ -45,18 +44,18 @@ alphabetic characters such as `NI` or `SC`.
|
|
45
44
|
## Authentication
|
46
45
|
|
47
46
|
Using the Companies House REST API requires you to register an account
|
48
|
-
[on the CompaniesHouse Developers website](https://developer.
|
49
|
-
and [configure an API key](https://developer.
|
47
|
+
[on the CompaniesHouse Developers website](https://developer.company-information.service.gov.uk/)
|
48
|
+
and [configure an API key](https://developer.company-information.service.gov.uk/manage-applications).
|
50
49
|
Developers should read
|
51
|
-
[the Companies House developer guidelines](https://developer.
|
50
|
+
[the Companies House developer guidelines](https://developer.company-information.service.gov.uk/developer-guidelines)
|
52
51
|
before using this API, and will note that these guidelines contain several
|
53
52
|
instructions regarding API keys:
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
- Do not embed API keys in your code
|
55
|
+
- Do not store API keys in your source tree
|
56
|
+
- Restrict API key use by IP address and domain
|
57
|
+
- **Regenerate your API keys regularly**
|
58
|
+
- Delete API keys when no longer required
|
60
59
|
|
61
60
|
## Client Initialization
|
62
61
|
|
@@ -70,11 +69,11 @@ client = CompaniesHouse::Client.new(config)
|
|
70
69
|
The client is configured by passing a hash to the constructor. The supported keys for this
|
71
70
|
hash are:
|
72
71
|
|
73
|
-
| Key | Description
|
74
|
-
| ------------------ |
|
75
|
-
| `:api_key` | Required. The API key received after registration.
|
72
|
+
| Key | Description |
|
73
|
+
| ------------------ | ---------------------------------------------------------------------------------- |
|
74
|
+
| `:api_key` | Required. The API key received after registration. |
|
76
75
|
| `:endpoint` | Optional. Specifies the base URI for the API (e.g. if using a self-hosted version) |
|
77
|
-
| `:instrumentation` | Optional. Instruments the request/response (see Instrumentation for details)
|
76
|
+
| `:instrumentation` | Optional. Instruments the request/response (see Instrumentation for details) |
|
78
77
|
|
79
78
|
## Instrumentation
|
80
79
|
|
@@ -85,49 +84,117 @@ If you are using Rails or the `ActiveSupport` gem, instrumentation will happen a
|
|
85
84
|
|
86
85
|
Once a client has been initialised, requests can be made to the API.
|
87
86
|
Details of the available fields in the response are in the Companies House
|
88
|
-
[documentation](https://developer.
|
87
|
+
[documentation](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference).
|
89
88
|
The endpoints currently implemented by the gem are:
|
90
89
|
|
91
|
-
| Client Method
|
92
|
-
|
|
93
|
-
| `.company(company_number)`
|
94
|
-
| `.officers(company_number)`
|
95
|
-
| `.company_search(query, items_per_page: nil, start_index: nil)`
|
90
|
+
| Client Method | Endpoint | Description |
|
91
|
+
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
92
|
+
| `.company(company_number)` | `GET /company/:company_number` | Retrieves a company profile. |
|
93
|
+
| `.officers(company_number)` | `GET /company/:company_number/officers` | Retrieves a list of company officers. |
|
94
|
+
| `.company_search(query, items_per_page: nil, start_index: nil, restrictions: nil)` | `GET /search/companies` | Retrieves a list of companies that match the given query. |
|
95
|
+
| `.persons_with_significant_control(company_number, register_view: false)` | `GET /company/:company_number/persons-with-significant-control` | Retrieves a list of persons with significant control. |
|
96
|
+
| `.persons_with_significant_control_corporate_entity_beneficial_owner(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/corporate-entity-beneficial-owner/:psc_id` | Retrieves a corporate entity beneficial owner. |
|
97
|
+
| `.persons_with_significant_control_corporate_entity(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/corporate-entity/:psc_id` | Retrieves a corporate entity. |
|
98
|
+
| `.persons_with_significant_control_individual_beneficial_owner(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/individual-beneficial-owner/:psc_id` | Retrieves an individual beneficial owner. |
|
99
|
+
| `.persons_with_significant_control_individual(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/individual/:psc_id` | Retrieves an individual. |
|
100
|
+
| `.persons_with_significant_control_individual_with_verification_state(company_number, psc_id)`. | `GET /company/:company_number/persons-with-significant-control/individual/:psc_id/verification-state` | Retrieves an individual with verification state. |
|
101
|
+
| `.persons_with_significant_control_individual_full_record(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/individual/:psc_id/full_record` | Retrieves the full record of an individual. |
|
102
|
+
| `.persons_with_significant_control_legal_person_beneficial_owner(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/legal-person-beneficial-owner/:psc_id` | Retrieves a legal person beneficial owner. |
|
103
|
+
| `.persons_with_significant_control_legal_person(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/legal-person/:psc_id` | Retrieves a legal person. |
|
104
|
+
| `.persons_with_significant_control_super_secure_beneficial_owner(company_number, super_secure_id)` | `GET /company/:company_number/persons-with-significant-control/super-secure-beneficial-owner/:super_secure_id` | Retrieves a super secure beneficial owner. |
|
105
|
+
| `.persons_with_significant_control_super_secure_person(company_number, super_secure_id)` | `GET /company/:company_number/persons-with-significant-control/super-secure/:super_secure_id` | Retrieves a super secure person. |
|
106
|
+
| `.persons_with_significant_control_statements(company_number, register_view: false)` | `GET /company/:company_number/persons-with-significant-control-statements` | Retrieves a list of persons with significant control statements. |
|
107
|
+
| `.persons_with_significant_control_statement(company_number, statement_id)` | `GET /company/:company_number/persons-with-significant-control-statements/:statement_id` | Retrieves a persons with significant control statement. |
|
108
|
+
| `.filing_history_list(company_number)` | `GET /company/:company_number/filing-history` | Retrieves a list of filing history items. |
|
109
|
+
| `.filing_history_item(company_number, transaction_id)` | `GET /company/:company_number/filing-history/:transaction_id` | Retrieves a specific filing history item. |
|
96
110
|
|
97
111
|
### .company
|
98
112
|
|
99
|
-
This method implements the [readCompanyProfile](https://developer.
|
100
|
-
API and returns the full [companyProfile](https://developer.
|
113
|
+
This method implements the [readCompanyProfile](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/company-profile/company-profile)
|
114
|
+
API and returns the full [companyProfile](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/companyprofile)
|
101
115
|
resource.
|
102
116
|
|
103
117
|
### .officers
|
104
118
|
|
105
|
-
This method implements the [officersList](https://developer.
|
119
|
+
This method implements the [officersList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/officers/list)
|
106
120
|
API. It will make one or more requests against this API, as necessary, to obtain
|
107
121
|
the full list of company officers. It returns only the values under the `items`
|
108
122
|
key from the
|
109
|
-
[officerList](https://developer.
|
123
|
+
[officerList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/officerlist)
|
110
124
|
resource(s) which it reads.
|
111
125
|
|
112
126
|
### .company_search
|
113
127
|
|
114
|
-
This method implements the [searchCompanies](https://developer.
|
115
|
-
API and returns the list of [companySearch](https://developer.
|
116
|
-
resources that match the given query. The `items_per_page` and `
|
128
|
+
This method implements the [searchCompanies](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/search/search-companies)
|
129
|
+
API and returns the list of [companySearch](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/companysearch)
|
130
|
+
resources that match the given query. The `items_per_page`, `start_index` and `restrictions` parameters are optional.
|
131
|
+
|
132
|
+
### .persons_with_significant_control
|
133
|
+
|
134
|
+
This method implements the [listPersonsWithSignificantControl](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/list) API and returns the list of [personsWithSignificantControl](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/list) resources.
|
135
|
+
|
136
|
+
### .persons_with_significant_control_corporate_entity_beneficial_owner
|
137
|
+
|
138
|
+
This method implements the [getCorporateEntityBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-corporate-entity-beneficial-owner) API and returns the [corporateEntityBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/corporateentitybeneficialowner) resource.
|
139
|
+
|
140
|
+
### .persons_with_significant_control_corporate_entity
|
141
|
+
|
142
|
+
This method implements the [getCorporateEntities](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-corporate-entities) API and returns the [corporateEntity](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/corporateentity) resource.
|
143
|
+
|
144
|
+
### .persons_with_significant_control_individual_beneficial_owner
|
145
|
+
|
146
|
+
This method implements the [getIndividualBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual-beneficial-owner) API and returns the [individualBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/individualbeneficialowner) resource.
|
147
|
+
|
148
|
+
### .persons_with_significant_control_individual
|
149
|
+
|
150
|
+
This method implements the [getIndividual](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual) API and returns the [individual](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/individual) resource.
|
151
|
+
|
152
|
+
### .persons_with_significant_control_individual_with_verification_state
|
153
|
+
|
154
|
+
This method implements the [getIndividualWithVerificationState](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual-with-verification-state) API and returns the [individual](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/individual) resource.
|
155
|
+
|
156
|
+
### .persons_with_significant_control_individual_full_record
|
157
|
+
|
158
|
+
This method implements the [getIndividualFullRecord](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual-full-record) API and returns the [individual](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/individual) resource.
|
159
|
+
|
160
|
+
### .persons_with_significant_control_legal_person_beneficial_owner
|
161
|
+
|
162
|
+
This method implements the [getLegalPersonBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-legal-person-beneficial-owner) API and returns the [legalPersonBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/legalpersonbeneficialowner) resource.
|
163
|
+
|
164
|
+
### .persons_with_significant_control_legal_person
|
165
|
+
|
166
|
+
This method implements the [getLegalPersons](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-legal-persons) API and returns the [legalPerson](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/legalperson) resource.
|
167
|
+
|
168
|
+
### .persons_with_significant_control_super_secure_beneficial_owner
|
169
|
+
|
170
|
+
This method implements the [getSuperSecureBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-super-secure-beneficial-owner) API and returns the [superSecureBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/supersecurebeneficialowner) resource.
|
171
|
+
|
172
|
+
### .persons_with_significant_control_super_secure_person
|
173
|
+
|
174
|
+
This method implements the [getSuperSecurePerson](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-super-secure-person) API and returns the [superSecure](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/supersecure) resource.
|
175
|
+
|
176
|
+
### .persons_with_significant_control_statements
|
177
|
+
|
178
|
+
This method implements the [listPersonsWithSignificantControlStatements](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/list-statements) API and returns the list of [statementList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/statementlist) resources.
|
179
|
+
|
180
|
+
### .persons_with_significant_control_statement
|
181
|
+
|
182
|
+
This method implements the [getStatement](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-statement) API and returns the [statement](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/statement) resource.
|
117
183
|
|
118
184
|
### .filing_history_list
|
119
185
|
|
120
|
-
This method implements the [filingHistoryList](https://developer.
|
186
|
+
This method implements the [filingHistoryList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/filing-history/list) API and returns the full
|
187
|
+
[filingHistoryList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/filinghistorylist) resource.
|
121
188
|
|
122
189
|
### .filing_history_item
|
123
190
|
|
124
|
-
This method implements the [filingHistoryItem](https://developer.
|
125
|
-
[filingHistoryItem](https://developer.
|
191
|
+
This method implements the [filingHistoryItem](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/filing-history/filinghistoryitem-resource) API and returns the full
|
192
|
+
[filingHistoryItem](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/filinghistoryitem) resource.
|
126
193
|
|
127
194
|
### Other API Methods
|
128
195
|
|
129
196
|
While there are other resources exposed by the
|
130
|
-
[Companies House API](https://developer.
|
197
|
+
[Companies House API](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference),
|
131
198
|
this gem does not implement access to these resources at this time.
|
132
199
|
|
133
200
|
## Error Handling
|
@@ -136,22 +203,22 @@ If a request to the Companies House API encounters an HTTP status other than
|
|
136
203
|
`200 OK`, it will raise an instance of `CompaniesHouse::APIError` instead of
|
137
204
|
returning response data. The error will have the following fields:
|
138
205
|
|
139
|
-
| Field | Description
|
140
|
-
| ---------- |
|
206
|
+
| Field | Description |
|
207
|
+
| ---------- | ------------------------------------------------------- |
|
141
208
|
| `response` | The Net::HTTP response object from the failed API call. |
|
142
|
-
| `status` | A string containing the response status code.
|
209
|
+
| `status` | A string containing the response status code. |
|
143
210
|
|
144
211
|
Certain API responses will raise an instance of a more specific subclass of
|
145
212
|
`CompaniesHouse::APIError`:
|
146
213
|
|
147
|
-
| Status | Error | Description
|
148
|
-
| ------ | ------------------------------------- |
|
149
|
-
| 401 | `CompaniesHouse::AuthenticationError` | Authentication error (invalid API key)
|
150
|
-
| 404 | `CompaniesHouse::NotFoundError` | Not Found. (No record of the company is available.)
|
151
|
-
| 429 | `CompaniesHouse::RateLimitError` | Application is being [rate limited](https://developer.
|
214
|
+
| Status | Error | Description |
|
215
|
+
| ------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
216
|
+
| 401 | `CompaniesHouse::AuthenticationError` | Authentication error (invalid API key) |
|
217
|
+
| 404 | `CompaniesHouse::NotFoundError` | Not Found. (No record of the company is available.) |
|
218
|
+
| 429 | `CompaniesHouse::RateLimitError` | Application is being [rate limited](https://developer-specs.company-information.service.gov.uk/guides/rateLimiting) |
|
152
219
|
|
153
220
|
The client will not catch any other errors which may occur, such as
|
154
|
-
errors involving
|
221
|
+
errors involving network connections (e.g. `Errno::ECONNRESET`).
|
155
222
|
|
156
223
|
## Development
|
157
224
|
|
@@ -162,7 +229,7 @@ Bug reports and pull requests are welcome on this project's
|
|
162
229
|
|
163
230
|
To get started:
|
164
231
|
|
165
|
-
```
|
232
|
+
```shell
|
166
233
|
bundle install --path vendor
|
167
234
|
```
|
168
235
|
|
@@ -22,14 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
spec.required_ruby_version = ">= 3.0.2"
|
24
24
|
|
25
|
-
spec.
|
25
|
+
spec.add_dependency "dry-struct", "~> 1"
|
26
26
|
|
27
|
-
spec.add_development_dependency "activesupport", ">= 4.2", "< 7"
|
28
|
-
spec.add_development_dependency "gc_ruboconfig", "~> 3.6"
|
29
|
-
spec.add_development_dependency "rake", "~> 13.0"
|
30
|
-
spec.add_development_dependency "rspec", "~> 3.5"
|
31
|
-
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
|
32
|
-
spec.add_development_dependency "timecop", "~> 0.8"
|
33
|
-
spec.add_development_dependency "webmock", "~> 3.0"
|
34
27
|
spec.metadata["rubygems_mfa_required"] = "true"
|
35
28
|
end
|
@@ -60,6 +60,76 @@ module CompaniesHouse
|
|
60
60
|
)
|
61
61
|
end
|
62
62
|
|
63
|
+
def persons_with_significant_control_corporate_entity_beneficial_owner(id, psc_id)
|
64
|
+
request(
|
65
|
+
resource: :persons_with_significant_control_corporate_entity_beneficial_owner,
|
66
|
+
path: "company/#{id}/persons-with-significant-control/corporate-entity-beneficial-owner/#{psc_id}",
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
def persons_with_significant_control_corporate_entity(id, psc_id)
|
71
|
+
request(
|
72
|
+
resource: :persons_with_significant_control_corporate_entity,
|
73
|
+
path: "company/#{id}/persons-with-significant-control/corporate-entity/#{psc_id}",
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
77
|
+
def persons_with_significant_control_individual_beneficial_owner(id, psc_id)
|
78
|
+
request(
|
79
|
+
resource: :persons_with_significant_control_individual_beneficial_owner,
|
80
|
+
path: "company/#{id}/persons-with-significant-control/individual-beneficial-owner/#{psc_id}",
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
def persons_with_significant_control_individual(id, psc_id)
|
85
|
+
request(
|
86
|
+
resource: :persons_with_significant_control_individual,
|
87
|
+
path: "company/#{id}/persons-with-significant-control/individual/#{psc_id}",
|
88
|
+
)
|
89
|
+
end
|
90
|
+
|
91
|
+
def persons_with_significant_control_individual_with_verification_state(id, psc_id)
|
92
|
+
request(
|
93
|
+
resource: :persons_with_significant_control_individual_with_verification_state,
|
94
|
+
path: "company/#{id}/persons-with-significant-control/individual/#{psc_id}/verification-state",
|
95
|
+
)
|
96
|
+
end
|
97
|
+
|
98
|
+
def persons_with_significant_control_individual_full_record(id, psc_id)
|
99
|
+
request(
|
100
|
+
resource: :persons_with_significant_control_individual_full_record,
|
101
|
+
path: "company/#{id}/persons-with-significant-control/individual/#{psc_id}/full_record",
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
def persons_with_significant_control_legal_person_beneficial_owner(id, psc_id)
|
106
|
+
request(
|
107
|
+
resource: :persons_with_significant_control_legal_person_beneficial_owner,
|
108
|
+
path: "company/#{id}/persons-with-significant-control/legal-person-beneficial-owner/#{psc_id}",
|
109
|
+
)
|
110
|
+
end
|
111
|
+
|
112
|
+
def persons_with_significant_control_legal_person(id, psc_id)
|
113
|
+
request(
|
114
|
+
resource: :persons_with_significant_control_legal_person,
|
115
|
+
path: "company/#{id}/persons-with-significant-control/legal-person/#{psc_id}",
|
116
|
+
)
|
117
|
+
end
|
118
|
+
|
119
|
+
def persons_with_significant_control_super_secure_beneficial_owner(id, super_secure_id)
|
120
|
+
request(
|
121
|
+
resource: :persons_with_significant_control_super_secure_beneficial_owner,
|
122
|
+
path: "company/#{id}/persons-with-significant-control/super-secure-beneficial-owner/#{super_secure_id}",
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
126
|
+
def persons_with_significant_control_super_secure_person(id, super_secure_id)
|
127
|
+
request(
|
128
|
+
resource: :persons_with_significant_control_super_secure_person,
|
129
|
+
path: "company/#{id}/persons-with-significant-control/super-secure/#{super_secure_id}",
|
130
|
+
)
|
131
|
+
end
|
132
|
+
|
63
133
|
def persons_with_significant_control_statements(id, register_view: false)
|
64
134
|
get_all_pages(
|
65
135
|
:persons_with_significant_control_statements,
|
@@ -69,6 +139,13 @@ module CompaniesHouse
|
|
69
139
|
)
|
70
140
|
end
|
71
141
|
|
142
|
+
def persons_with_significant_control_statement(id, statement_id)
|
143
|
+
request(
|
144
|
+
resource: :persons_with_significant_control_statement,
|
145
|
+
path: "company/#{id}/persons-with-significant-control-statements/#{statement_id}",
|
146
|
+
)
|
147
|
+
end
|
148
|
+
|
72
149
|
def filing_history_list(id)
|
73
150
|
get_all_pages(:filing_history_list, "company/#{id}/filing-history", id)
|
74
151
|
end
|
@@ -80,12 +157,13 @@ module CompaniesHouse
|
|
80
157
|
)
|
81
158
|
end
|
82
159
|
|
83
|
-
def company_search(query, items_per_page: nil, start_index: nil)
|
160
|
+
def company_search(query, items_per_page: nil, start_index: nil, restrictions: nil)
|
84
161
|
request(
|
85
162
|
resource: :company_search,
|
86
163
|
path: "search/companies",
|
87
164
|
params: {
|
88
|
-
q: query, items_per_page: items_per_page, start_index: start_index
|
165
|
+
q: query, items_per_page: items_per_page, start_index: start_index,
|
166
|
+
restrictions: restrictions
|
89
167
|
}.compact,
|
90
168
|
)
|
91
169
|
end
|
@@ -35,7 +35,7 @@ module CompaniesHouse
|
|
35
35
|
attribute :instrumentation, Dry.Types.Interface(:publish)
|
36
36
|
|
37
37
|
def initialize(args)
|
38
|
-
super
|
38
|
+
super
|
39
39
|
|
40
40
|
@uri = URI.join(endpoint, path)
|
41
41
|
@uri.query = URI.encode_www_form(query)
|
@@ -50,7 +50,7 @@ module CompaniesHouse
|
|
50
50
|
def execute
|
51
51
|
@started = Time.now.utc
|
52
52
|
response = request_resource(@uri)
|
53
|
-
@notification_payload[:
|
53
|
+
@notification_payload[:response_status] = response.code
|
54
54
|
|
55
55
|
begin
|
56
56
|
@notification_payload[:response] = parse(response, resource_type, resource_id)
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: companies-house-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless Engineering
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-09-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: dry-struct
|
@@ -24,110 +23,6 @@ dependencies:
|
|
24
23
|
- - "~>"
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '1'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activesupport
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '4.2'
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: '7'
|
37
|
-
type: :development
|
38
|
-
prerelease: false
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '4.2'
|
44
|
-
- - "<"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '7'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: gc_ruboconfig
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '3.6'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '3.6'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: rake
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '13.0'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '13.0'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: rspec
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '3.5'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '3.5'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: rspec_junit_formatter
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: 0.4.1
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 0.4.1
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: timecop
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0.8'
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '0.8'
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: webmock
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '3.0'
|
124
|
-
type: :development
|
125
|
-
prerelease: false
|
126
|
-
version_requirements: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - "~>"
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: '3.0'
|
131
26
|
description: Client for the Companies House REST API. Provides company profiles and
|
132
27
|
officer lists.
|
133
28
|
email:
|
@@ -156,7 +51,6 @@ licenses:
|
|
156
51
|
- MIT
|
157
52
|
metadata:
|
158
53
|
rubygems_mfa_required: 'true'
|
159
|
-
post_install_message:
|
160
54
|
rdoc_options: []
|
161
55
|
require_paths:
|
162
56
|
- lib
|
@@ -171,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
65
|
- !ruby/object:Gem::Version
|
172
66
|
version: '0'
|
173
67
|
requirements: []
|
174
|
-
rubygems_version: 3.
|
175
|
-
signing_key:
|
68
|
+
rubygems_version: 3.6.5
|
176
69
|
specification_version: 4
|
177
70
|
summary: Look up UK company registration information
|
178
71
|
test_files: []
|