@companieshouse/api-sdk-node 2.0.74 → 2.0.76

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.
@@ -58,6 +58,7 @@ export interface IdentificationResource {
58
58
  registration_number?: string;
59
59
  }
60
60
  export interface CompanyOfficerResourceLinks {
61
+ self: string;
61
62
  officer: OfficerResourceLinks;
62
63
  }
63
64
  export interface OfficerResourceLinks {
@@ -123,6 +124,7 @@ export interface Identification {
123
124
  registrationNumber?: string;
124
125
  }
125
126
  export interface CompanyOfficerLinks {
127
+ self: string;
126
128
  officer: OfficerLinks;
127
129
  }
128
130
  export interface OfficerLinks {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/officer-filing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,qCAA4D;AAAnD,gIAAA,OAAO,OAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/officer-filing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,0CAAwB;AACxB,qCAA4D;AAAnD,gIAAA,OAAO,OAAwB"}
@@ -6,5 +6,14 @@ export default class {
6
6
  constructor(client: IHttpClient);
7
7
  getListActiveDirectorDetails(transactionId: string): Promise<Resource<CompanyOfficer[]> | ApiErrorResponse>;
8
8
  private getOfficerFilingUrlIncTransactionId;
9
+ private getOfficerFilingUrlIncTransactionIdAndSubmissionId;
10
+ /**
11
+ * Get the director details including the termination date out of the filing.
12
+ * to be used on the check your answers page for TM01.
13
+ *
14
+ * @params transaction id and submission id to look up the filing
15
+ */
16
+ getDirectorAndTerminationDate(transactionId: string, submissionId: string): Promise<Resource<CompanyOfficer> | ApiErrorResponse>;
9
17
  getCurrentOrFutureDissolved(companyNumber: String): Promise<Resource<Boolean> | ApiErrorResponse>;
18
+ private getCompanyOfficerDetails;
10
19
  }
@@ -20,19 +20,27 @@ class default_1 {
20
20
  getListActiveDirectorDetails(transactionId) {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
22
  const url = `${this.getOfficerFilingUrlIncTransactionId(transactionId)}/active-directors-details`;
23
- const resp = yield this.client.httpGet(url);
24
- if (resp.status >= 400) {
25
- return { httpStatusCode: resp.status, errors: [resp.error] };
26
- }
27
- const resource = { httpStatusCode: resp.status };
28
- const body = resp.body;
29
- resource.resource = mapping_1.default.camelCaseKeys(body);
30
- return resource;
23
+ return this.getCompanyOfficerDetails(url);
31
24
  });
32
25
  }
33
26
  getOfficerFilingUrlIncTransactionId(transactionId) {
34
27
  return `/transactions/${transactionId}/officers`;
35
28
  }
29
+ getOfficerFilingUrlIncTransactionIdAndSubmissionId(transactionId, submissionId) {
30
+ return `/transactions/${transactionId}/officers/${submissionId}/`;
31
+ }
32
+ /**
33
+ * Get the director details including the termination date out of the filing.
34
+ * to be used on the check your answers page for TM01.
35
+ *
36
+ * @params transaction id and submission id to look up the filing
37
+ */
38
+ getDirectorAndTerminationDate(transactionId, submissionId) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const url = `${this.getOfficerFilingUrlIncTransactionIdAndSubmissionId(transactionId, submissionId)}/tm01-check-answers-directors-details`;
41
+ return this.getCompanyOfficerDetails(url);
42
+ });
43
+ }
36
44
  getCurrentOrFutureDissolved(companyNumber) {
37
45
  return __awaiter(this, void 0, void 0, function* () {
38
46
  const url = `/officer-filing/company/${companyNumber}/eligibility-check/past-future-dissolved`;
@@ -43,6 +51,18 @@ class default_1 {
43
51
  return { httpStatusCode: resp.status, resource: resp.body };
44
52
  });
45
53
  }
54
+ getCompanyOfficerDetails(url) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ const resp = yield this.client.httpGet(url);
57
+ if (resp.status >= 400) {
58
+ return { httpStatusCode: resp.status, errors: [resp.error] };
59
+ }
60
+ const resource = { httpStatusCode: resp.status };
61
+ const body = resp.body;
62
+ resource.resource = mapping_1.default.camelCaseKeys(body);
63
+ return resource;
64
+ });
65
+ }
46
66
  }
47
67
  exports.default = default_1;
48
68
  //# sourceMappingURL=service.js.map
@@ -1 +1 @@
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;IAEY,2BAA2B,CAAE,aAAqB;;YAC3D,MAAM,GAAG,GAAG,2BAA2B,aAAa,0CAA0C,CAAC;YAC/F,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,CAA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