@companieshouse/api-sdk-node 2.0.158 → 2.0.159
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.
- package/dist/client.d.ts +2 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/services/psc/index.d.ts +2 -0
- package/dist/services/psc/index.js +15 -0
- package/dist/services/psc/index.js.map +1 -0
- package/dist/services/psc/service.d.ts +17 -0
- package/dist/services/psc/service.js +48 -0
- package/dist/services/psc/service.js.map +1 -0
- package/dist/services/psc/types.d.ts +111 -0
- package/dist/services/psc/types.js +20 -0
- package/dist/services/psc/types.js.map +1 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { ClientType } from "./enums";
|
|
|
27
27
|
import { PostcodeLookupService } from "./services/postcode-lookup";
|
|
28
28
|
import PscVerificationService from "./services/psc-verification-link/service";
|
|
29
29
|
import { AccountsFilingService } from "./services/accounts-filing";
|
|
30
|
+
import PscService from "./services/psc/service";
|
|
30
31
|
/**
|
|
31
32
|
* ApiClient is the class that all service objects hang off.
|
|
32
33
|
*/
|
|
@@ -66,5 +67,6 @@ export default class ApiClient {
|
|
|
66
67
|
readonly postCodeLookup: PostcodeLookupService;
|
|
67
68
|
readonly pscVerificationService: PscVerificationService;
|
|
68
69
|
readonly accountsFilingService: AccountsFilingService;
|
|
70
|
+
readonly pscService: PscService;
|
|
69
71
|
constructor(apiClient: IHttpClient, accountClient: IHttpClient);
|
|
70
72
|
}
|
package/dist/client.js
CHANGED
|
@@ -30,6 +30,7 @@ const service_18 = __importDefault(require("./services/registered-email-address/
|
|
|
30
30
|
const postcode_lookup_1 = require("./services/postcode-lookup");
|
|
31
31
|
const service_19 = __importDefault(require("./services/psc-verification-link/service"));
|
|
32
32
|
const accounts_filing_1 = require("./services/accounts-filing");
|
|
33
|
+
const service_20 = __importDefault(require("./services/psc/service"));
|
|
33
34
|
/**
|
|
34
35
|
* ApiClient is the class that all service objects hang off.
|
|
35
36
|
*/
|
|
@@ -72,6 +73,7 @@ class ApiClient {
|
|
|
72
73
|
this.postCodeLookup = new postcode_lookup_1.PostcodeLookupService(apiClient);
|
|
73
74
|
this.pscVerificationService = new service_19.default(apiClient);
|
|
74
75
|
this.accountsFilingService = new accounts_filing_1.AccountsFilingService(apiClient);
|
|
76
|
+
this.pscService = new service_20.default(apiClient);
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
exports.default = ApiClient;
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;AACA,kFAAyE;AACzE,iFAAuE;AACvE,iFAAuE;AACvE,6EAA+D;AAC/D,wCAA0D;AAC1D,6CAO2B;AAC3B,iDAAqD;AACrD,wFAAoF;AACpF,4DAA+D;AAC/D,wFAA8E;AAC9E,4FAAsF;AACtF,yFAAgF;AAChF,mFAAyE;AACzE,2FAAwF;AACxF,8EAAgE;AAChE,yFAAoF;AACpF,8EAAiF;AACjF,oEAAqE;AACrE,8DAAwE;AACxE,mFAAmE;AACnE,sFAAyE;AACzE,iFAAqE;AACrE,uEAAkD;AAClD,2FAAwF;AAExF,gEAAmE;AACnE,wFAA8E;AAC9E,gEAAmE;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;AACA,kFAAyE;AACzE,iFAAuE;AACvE,iFAAuE;AACvE,6EAA+D;AAC/D,wCAA0D;AAC1D,6CAO2B;AAC3B,iDAAqD;AACrD,wFAAoF;AACpF,4DAA+D;AAC/D,wFAA8E;AAC9E,4FAAsF;AACtF,yFAAgF;AAChF,mFAAyE;AACzE,2FAAwF;AACxF,8EAAgE;AAChE,yFAAoF;AACpF,8EAAiF;AACjF,oEAAqE;AACrE,8DAAwE;AACxE,mFAAmE;AACnE,sFAAyE;AACzE,iFAAqE;AACrE,uEAAkD;AA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AqB,CAAC,SAAS,CAAC,CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,IAAI,kBAAU,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;CACF;AA1ED,4BA0EC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./types"), exports);
|
|
14
|
+
__exportStar(require("./service"), exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/psc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IHttpClient } from "../../http";
|
|
2
|
+
import Resource, { ApiErrorResponse } from "../resource";
|
|
3
|
+
import { PersonWithSignificantControl } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual
|
|
6
|
+
*/
|
|
7
|
+
export default class PscService {
|
|
8
|
+
private readonly client;
|
|
9
|
+
constructor(client: IHttpClient);
|
|
10
|
+
/**
|
|
11
|
+
* Get the PSC details for an individual person.
|
|
12
|
+
*
|
|
13
|
+
* @param companyNumber the company number to look up
|
|
14
|
+
* @param notificationId the PSC Notification Id to retrieve
|
|
15
|
+
*/
|
|
16
|
+
getPscIndividual(companyNumber: string, notificationId: string): Promise<Resource<PersonWithSignificantControl> | ApiErrorResponse>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const mapping_1 = __importDefault(require("../../mapping/mapping"));
|
|
16
|
+
/**
|
|
17
|
+
* https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual
|
|
18
|
+
*/
|
|
19
|
+
class PscService {
|
|
20
|
+
constructor(client) {
|
|
21
|
+
this.client = client;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the PSC details for an individual person.
|
|
25
|
+
*
|
|
26
|
+
* @param companyNumber the company number to look up
|
|
27
|
+
* @param notificationId the PSC Notification Id to retrieve
|
|
28
|
+
*/
|
|
29
|
+
getPscIndividual(companyNumber, notificationId) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const response = yield this.client.httpGet(`/company/${companyNumber}/persons-with-significant-control/individual/${notificationId}`);
|
|
32
|
+
const resource = {
|
|
33
|
+
httpStatusCode: response.status
|
|
34
|
+
};
|
|
35
|
+
if (response.error) {
|
|
36
|
+
return {
|
|
37
|
+
httpStatusCode: response.status,
|
|
38
|
+
errors: [response.error]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const body = response.body;
|
|
42
|
+
resource.resource = mapping_1.default.camelCaseKeys(body);
|
|
43
|
+
return resource;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.default = PscService;
|
|
48
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/psc/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,oEAA4C;AAI5C;;GAEG;AACH,MAAqB,UAAU;IAC3B,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAI,CAAC;IAEtD;;;;;KAKC;IACY,gBAAgB,CAAE,aAAqB,EAAE,cAAsB;;YACxE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,aAAa,gDAAgD,cAAc,EAAE,CAAC,CAAC;YAEtI,MAAM,QAAQ,GAA2C;gBACrD,cAAc,EAAE,QAAQ,CAAC,MAAM;aAClC,CAAC;YAEF,IAAI,QAAQ,CAAC,KAAK,EAAE;gBAChB,OAAO;oBACH,cAAc,EAAE,QAAQ,CAAC,MAAM;oBAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;iBAC3B,CAAA;aACJ;YAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAA4C,CAAC;YACnE,QAAQ,CAAC,QAAQ,GAAG,iBAAO,CAAC,aAAa,CAA+B,IAAI,CAAC,CAAC;YAE9E,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CACJ;AA5BD,6BA4BC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PersonWithSignificantControlResource is what is returned from the api.
|
|
3
|
+
*/
|
|
4
|
+
export interface PersonWithSignificantControlResource {
|
|
5
|
+
address: AddressResource;
|
|
6
|
+
country_of_residence: string;
|
|
7
|
+
date_of_birth: DateOfBirthResource;
|
|
8
|
+
ceased_on?: string;
|
|
9
|
+
etag: string;
|
|
10
|
+
links: ItemLinksResource;
|
|
11
|
+
name: string;
|
|
12
|
+
name_elements: NameElementsResource;
|
|
13
|
+
nationality: string;
|
|
14
|
+
natures_of_control: string[];
|
|
15
|
+
notified_on: string;
|
|
16
|
+
is_sanctioned?: boolean;
|
|
17
|
+
kind?: string;
|
|
18
|
+
identification?: IdentificationResource;
|
|
19
|
+
}
|
|
20
|
+
export interface AddressResource {
|
|
21
|
+
address_line_1: string;
|
|
22
|
+
address_line_2?: string;
|
|
23
|
+
careOf?: string;
|
|
24
|
+
locality: string;
|
|
25
|
+
poBox?: string;
|
|
26
|
+
postal_code?: string;
|
|
27
|
+
premises?: string;
|
|
28
|
+
region?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface DateOfBirthResource {
|
|
31
|
+
day?: string;
|
|
32
|
+
month: string;
|
|
33
|
+
year: string;
|
|
34
|
+
}
|
|
35
|
+
export interface NameElementsResource {
|
|
36
|
+
title?: string;
|
|
37
|
+
forename?: string;
|
|
38
|
+
other_forenames?: string;
|
|
39
|
+
middle_name?: string;
|
|
40
|
+
surname: string;
|
|
41
|
+
}
|
|
42
|
+
export interface IdentificationResource {
|
|
43
|
+
identification_type?: string;
|
|
44
|
+
legal_authority?: string;
|
|
45
|
+
legal_form?: string;
|
|
46
|
+
place_registered?: string;
|
|
47
|
+
registration_number?: string;
|
|
48
|
+
country_registered?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ResultsLinksResource {
|
|
51
|
+
self: string;
|
|
52
|
+
persons_with_significant_control_statements_list?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ItemLinksResource {
|
|
55
|
+
self: string;
|
|
56
|
+
statement?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface PersonWithSignificantControl {
|
|
59
|
+
address: any;
|
|
60
|
+
countryOfResidence: string;
|
|
61
|
+
dateOfBirth: DateOfBirth;
|
|
62
|
+
ceasedOn?: string;
|
|
63
|
+
etag: string;
|
|
64
|
+
links: ItemLinks;
|
|
65
|
+
name: string;
|
|
66
|
+
nameElements: NameElements;
|
|
67
|
+
nationality: string;
|
|
68
|
+
naturesOfControl: string[];
|
|
69
|
+
notifiedOn: string;
|
|
70
|
+
isSanctioned?: boolean;
|
|
71
|
+
kind?: string;
|
|
72
|
+
identification?: Identification;
|
|
73
|
+
}
|
|
74
|
+
export interface Address {
|
|
75
|
+
addressLine1: string;
|
|
76
|
+
addressLine2?: string;
|
|
77
|
+
careOf?: string;
|
|
78
|
+
locality: string;
|
|
79
|
+
poBox?: string;
|
|
80
|
+
postalCode?: string;
|
|
81
|
+
premises?: string;
|
|
82
|
+
region?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface DateOfBirth {
|
|
85
|
+
day?: string;
|
|
86
|
+
month: string;
|
|
87
|
+
year: string;
|
|
88
|
+
}
|
|
89
|
+
export interface NameElements {
|
|
90
|
+
title?: string;
|
|
91
|
+
forename?: string;
|
|
92
|
+
otherForenames?: string;
|
|
93
|
+
middleName?: string;
|
|
94
|
+
surname: string;
|
|
95
|
+
}
|
|
96
|
+
export interface Identification {
|
|
97
|
+
identificationType?: string;
|
|
98
|
+
legalAuthority?: string;
|
|
99
|
+
legalForm?: string;
|
|
100
|
+
placeRegistered?: string;
|
|
101
|
+
registrationNumber?: string;
|
|
102
|
+
countryRegistered?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface ResultsLinks {
|
|
105
|
+
self: string;
|
|
106
|
+
personsWithSignificantControlStatementsList?: string;
|
|
107
|
+
}
|
|
108
|
+
export interface ItemLinks {
|
|
109
|
+
self: string;
|
|
110
|
+
statement?: string;
|
|
111
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* PersonWithSignificantControlResource is what is returned from the api.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
;
|
|
7
|
+
;
|
|
8
|
+
;
|
|
9
|
+
;
|
|
10
|
+
;
|
|
11
|
+
;
|
|
12
|
+
;
|
|
13
|
+
;
|
|
14
|
+
;
|
|
15
|
+
;
|
|
16
|
+
;
|
|
17
|
+
;
|
|
18
|
+
;
|
|
19
|
+
;
|
|
20
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/psc/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAiBF,CAAC;AAWD,CAAC;AAMD,CAAC;AAQD,CAAC;AASD,CAAC;AAKD,CAAC;AAKD,CAAC;AAiBD,CAAC;AAWD,CAAC;AAMD,CAAC;AAQD,CAAC;AASD,CAAC;AAKD,CAAC;AAKD,CAAC"}
|