@companieshouse/api-sdk-node 2.0.64 → 2.0.65
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/services/officer-filing/service.d.ts +2 -4
- package/dist/services/officer-filing/service.js +6 -22
- package/dist/services/officer-filing/service.js.map +1 -1
- package/dist/services/officer-filing/types.d.ts +87 -52
- package/dist/services/officer-filing/types.js +3 -0
- package/dist/services/officer-filing/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CompanyOfficer } from "./types";
|
|
2
2
|
import { IHttpClient } from "../../http";
|
|
3
3
|
import Resource, { ApiErrorResponse } from "../resource";
|
|
4
4
|
export default class {
|
|
5
5
|
private readonly client;
|
|
6
6
|
constructor(client: IHttpClient);
|
|
7
|
-
getListActiveDirectorDetails(transactionId: string): Promise<Resource<
|
|
8
|
-
private mapToListActiveOfficerDetails;
|
|
9
|
-
private mapToAddress;
|
|
7
|
+
getListActiveDirectorDetails(transactionId: string): Promise<Resource<CompanyOfficer[]> | ApiErrorResponse>;
|
|
10
8
|
private getOfficerFilingUrlIncTransactionId;
|
|
11
9
|
}
|
|
@@ -8,7 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const mapping_1 = __importDefault(require("../../mapping/mapping"));
|
|
12
16
|
class default_1 {
|
|
13
17
|
constructor(client) {
|
|
14
18
|
this.client = client;
|
|
@@ -21,31 +25,11 @@ class default_1 {
|
|
|
21
25
|
return { httpStatusCode: resp.status, errors: [resp.error] };
|
|
22
26
|
}
|
|
23
27
|
const resource = { httpStatusCode: resp.status };
|
|
24
|
-
|
|
28
|
+
const body = resp.body;
|
|
29
|
+
resource.resource = mapping_1.default.camelCaseKeys(body);
|
|
25
30
|
return resource;
|
|
26
31
|
});
|
|
27
32
|
}
|
|
28
|
-
mapToListActiveOfficerDetails(officerResourceList) {
|
|
29
|
-
const officerList = [];
|
|
30
|
-
for (let index = 0; index < officerResourceList.length; index++) {
|
|
31
|
-
const officerResource = officerResourceList[index];
|
|
32
|
-
officerList[index] = Object.assign(Object.assign(Object.assign({ foreName1: officerResource.fore_name_1, foreName2: officerResource.fore_name_2, surname: officerResource.surname, occupation: officerResource.occupation, nationality: officerResource.nationality, dateOfBirth: officerResource.date_of_birth, dateOfAppointment: officerResource.date_of_appointment, countryOfResidence: officerResource.country_of_residence }, (officerResource.service_address && { serviceAddress: this.mapToAddress(officerResource.service_address) })), (officerResource.residential_address && { residentialAddress: this.mapToAddress(officerResource.residential_address) })), { isCorporate: officerResource.is_corporate, role: officerResource.role, placeRegistered: officerResource.place_registered, registrationNumber: officerResource.registration_number, lawGoverned: officerResource.law_governed, legalForm: officerResource.legal_form, identificationType: officerResource.identification_type });
|
|
33
|
-
}
|
|
34
|
-
return officerList;
|
|
35
|
-
}
|
|
36
|
-
mapToAddress(addressResource) {
|
|
37
|
-
return {
|
|
38
|
-
addressLine1: addressResource.address_line_1,
|
|
39
|
-
addressLine2: addressResource.address_line_2,
|
|
40
|
-
careOf: addressResource.care_of,
|
|
41
|
-
country: addressResource.country,
|
|
42
|
-
locality: addressResource.locality,
|
|
43
|
-
poBox: addressResource.po_box,
|
|
44
|
-
postalCode: addressResource.postal_code,
|
|
45
|
-
premises: addressResource.premises,
|
|
46
|
-
region: addressResource.region
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
33
|
getOfficerFilingUrlIncTransactionId(transactionId) {
|
|
50
34
|
return `/transactions/${transactionId}/officers`;
|
|
51
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/officer-filing/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/officer-filing/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAMA,oEAA4C;AAE5C;IACI,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAI,CAAC;IAEzC,4BAA4B,CAAE,aAAqB;;YAC5D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,mCAAmC,CAAC,aAAa,CAAC,2BAA2B,CAAC;YAClG,MAAM,IAAI,GAAiB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAE1D,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG,EAAE;gBACpB,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;aAChE;YAED,MAAM,QAAQ,GAA+B,EAAE,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;YAE7E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAgC,CAAC;YAEnD,QAAQ,CAAC,QAAQ,GAAG,iBAAO,CAAC,aAAa,CAAmB,IAAI,CAAC,CAAC;YAElE,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;IAEO,mCAAmC,CAAE,aAAqB;QAC9D,OAAO,iBAAiB,aAAa,WAAW,CAAC;IACrD,CAAC;CACJ;AAvBD,4BAuBC"}
|
|
@@ -1,65 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* CompanyOfficerResource is what is returned from the api.
|
|
3
|
+
*/
|
|
4
|
+
export interface CompanyOfficerResource {
|
|
5
|
+
address: AddressResource;
|
|
6
|
+
appointed_on: string;
|
|
7
|
+
country_of_residence?: string;
|
|
8
|
+
date_of_birth?: DateOfBirthResource;
|
|
9
|
+
former_names?: FormerNameResource[];
|
|
10
|
+
identification?: IdentificationResource;
|
|
11
|
+
links: CompanyOfficerResourceLinks;
|
|
12
|
+
name: string;
|
|
13
|
+
nationality?: string;
|
|
14
|
+
occupation?: string;
|
|
15
|
+
officer_role: string;
|
|
16
|
+
resigned_on?: string;
|
|
5
17
|
}
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
lawGoverned?: string;
|
|
22
|
-
legalForm?: string;
|
|
23
|
-
identificationType?: string;
|
|
18
|
+
export interface AddressResource {
|
|
19
|
+
address_line_1: string;
|
|
20
|
+
address_line_2?: string;
|
|
21
|
+
care_of?: string;
|
|
22
|
+
country: string;
|
|
23
|
+
locality: string;
|
|
24
|
+
po_box?: string;
|
|
25
|
+
postal_code?: string;
|
|
26
|
+
premises?: string;
|
|
27
|
+
region?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface DateOfBirthResource {
|
|
30
|
+
day?: string;
|
|
31
|
+
month: string;
|
|
32
|
+
year: string;
|
|
24
33
|
}
|
|
25
|
-
export interface
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
country_of_residence: string;
|
|
34
|
-
service_address: AddressResource;
|
|
35
|
-
residential_address: AddressResource;
|
|
36
|
-
is_corporate: boolean;
|
|
37
|
-
role: string;
|
|
34
|
+
export interface FormerNameResource {
|
|
35
|
+
forenames?: string;
|
|
36
|
+
surname?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IdentificationResource {
|
|
39
|
+
identification_type?: string;
|
|
40
|
+
legal_authority?: string;
|
|
41
|
+
legal_form?: string;
|
|
38
42
|
place_registered?: string;
|
|
39
43
|
registration_number?: string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
}
|
|
45
|
+
export interface CompanyOfficerResourceLinks {
|
|
46
|
+
officer: OfficerResourceLinks;
|
|
47
|
+
}
|
|
48
|
+
export interface OfficerResourceLinks {
|
|
49
|
+
appointments: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* CompanyOfficers is the interface used within this SDK.
|
|
53
|
+
*/
|
|
54
|
+
export interface CompanyOfficer {
|
|
55
|
+
address: Address;
|
|
56
|
+
appointedOn: string;
|
|
57
|
+
countryOfResidence?: string;
|
|
58
|
+
dateOfBirth?: DateOfBirth;
|
|
59
|
+
formerNames?: FormerName[];
|
|
60
|
+
identification?: Identification;
|
|
61
|
+
links: CompanyOfficerLinks;
|
|
62
|
+
name: string;
|
|
63
|
+
nationality?: string;
|
|
64
|
+
occupation?: string;
|
|
65
|
+
officerRole: string;
|
|
66
|
+
resignedOn?: string;
|
|
43
67
|
}
|
|
44
68
|
export interface Address {
|
|
45
|
-
addressLine1
|
|
46
|
-
addressLine2
|
|
69
|
+
addressLine1: string;
|
|
70
|
+
addressLine2: string;
|
|
47
71
|
careOf?: string;
|
|
48
|
-
country
|
|
49
|
-
locality
|
|
72
|
+
country: string;
|
|
73
|
+
locality: string;
|
|
50
74
|
poBox?: string;
|
|
51
75
|
postalCode?: string;
|
|
52
76
|
premises?: string;
|
|
53
77
|
region?: string;
|
|
54
78
|
}
|
|
55
|
-
export interface
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
79
|
+
export interface DateOfBirth {
|
|
80
|
+
day?: string;
|
|
81
|
+
month: string;
|
|
82
|
+
year: string;
|
|
83
|
+
}
|
|
84
|
+
export interface FormerName {
|
|
85
|
+
forenames?: string;
|
|
86
|
+
surname?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface Identification {
|
|
89
|
+
identificationType?: string;
|
|
90
|
+
legalAuthority?: string;
|
|
91
|
+
legalForm?: string;
|
|
92
|
+
placeRegistered?: string;
|
|
93
|
+
registrationNumber?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface CompanyOfficerLinks {
|
|
96
|
+
officer: OfficerLinks;
|
|
97
|
+
}
|
|
98
|
+
export interface OfficerLinks {
|
|
99
|
+
appointments: string;
|
|
65
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/officer-filing/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/officer-filing/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|