@companieshouse/api-sdk-node 2.0.158 → 2.0.160

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 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;
@@ -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;AACp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I,iBAAqB,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,CAAC,cAAc,GAAG,IAAI,yCAAqB,CAAC,SAAS,CAAC,CAAC;QAC3D,iEAAiE;QACjE,4DAA4D;QAC5D,IAAI,CAAC,YAAY,GAAG,IAAI,mCAAmB,CAAC,aAAa,CAAC,CAAC;QAC3D,IAAI,CAAC,gBAAgB,GAAG,IAAI,iBAAqB,CAAC,SAAS,CAAC,CAAC;QAC7D,IAAI,CAAC,oBAAoB,GAAG,IAAI,kBAA6B,CAAC,SAAS,CAAC,CAAC;QACzE,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACrD,IAAI,CAAC,6BAA6B,GAAG,IAAI,kBAA6B,CAAC,SAAS,CAAC,CAAC;QAClF,IAAI,CAAC,cAAc,GAAG,IAAI,uCAAqB,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,CAAC,sBAAsB,GAAG,IAAI,kBAAsB,CAAC,SAAS,CAAC,CAAC;QACpE,IAAI,CAAC,qBAAqB,GAAG,IAAI,uCAAqB,CAAC,SAAS,CAAC,CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,IAAI,kBAAU,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;CACF;AA1ED,4BA0EC"}
@@ -5,16 +5,16 @@ export interface AccountValidatorRequest {
5
5
  packageType?: PackageType;
6
6
  }
7
7
  export interface Data {
8
- balanceSheetDate: string;
9
- accountsType: string;
10
- companieshouseRegisteredNumber: string;
8
+ balanceSheetDate?: string;
9
+ accountsType?: string;
10
+ companieshouseRegisteredNumber?: string;
11
11
  }
12
12
  export interface ErrorMessage {
13
13
  errorMessage: string;
14
14
  }
15
15
  export interface Result {
16
16
  errorMessages: ErrorMessage[];
17
- data: Data;
17
+ data?: Data;
18
18
  validationStatus: ValidationStatus;
19
19
  }
20
20
  export interface AccountValidatorResponse {
@@ -22,11 +22,6 @@ function isAccountValidatorResponse(object) {
22
22
  if (!["OK", "FAILED"].includes(validationStatus)) {
23
23
  return false;
24
24
  }
25
- if (typeof data.balance_sheet_date !== "string" ||
26
- typeof data.accounts_type !== "string" ||
27
- typeof data.companieshouse_registered_number !== "string") {
28
- return false;
29
- }
30
25
  for (const errorMessage of errorMessages !== null && errorMessages !== void 0 ? errorMessages : []) {
31
26
  if (typeof errorMessage !== "object" || errorMessage === null) {
32
27
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/account-validator/types.ts"],"names":[],"mappings":";;;AAkCA,SAAgB,0BAA0B,CAAE,MAAW;IACnD,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;QACjC,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;QACjC,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;QACrC,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;QAC3D,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE;QAC7D,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC;IAChE,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9D,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,gBAAgB,KAAK,QAAQ,EAAE;QACtC,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAC9C,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,OAAO,IAAI,CAAC,kBAAk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AgB,KAAK,QAAQ,EAAE;QACtC,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAC9C,OAAO,KAAK,CAAC;KAChB;IAED,KAAK,MAAM,YAAY,IAAI,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,EAAE;QAC5C,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,KAAK,IAAI,EAAE;YAC3D,OAAO,KAAK,CAAC;SAChB;QACD,IAAI,OAAO,YAAY,CAAC,YAAY,KAAK,QAAQ,EAAE;YAC/C,OAAO,KAAK,CAAC;SAChB;KACJ;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AApCD,gEAoCC"}
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ export * from "./service";
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companieshouse/api-sdk-node",
3
- "version": "2.0.158",
3
+ "version": "2.0.160",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [