@companieshouse/api-sdk-node 1.0.91 → 1.0.92

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.
@@ -4,9 +4,9 @@ import Resource from "../../resource";
4
4
  export default class {
5
5
  private readonly client;
6
6
  constructor(client: IHttpClient);
7
- getCertificate: (certificateId: string) => Promise<Resource<CertificateItem>>;
8
- postCertificate: (certificateItemRequest: CertificateItemPostRequest) => Promise<Resource<CertificateItem>>;
9
- postInitialCertificate: (certificateItemRequest: CertificateItemInitialRequest) => Promise<Resource<CertificateItem>>;
10
- patchCertificate: (certificateItemRequest: CertificateItemPatchRequest, certificateId: string) => Promise<Resource<CertificateItem>>;
7
+ getCertificate(certificateId: string): Promise<Resource<CertificateItem>>;
8
+ postCertificate(certificateItemRequest: CertificateItemPostRequest): Promise<Resource<CertificateItem>>;
9
+ postInitialCertificate(certificateItemRequest: CertificateItemInitialRequest): Promise<Resource<CertificateItem>>;
10
+ patchCertificate(certificateItemRequest: CertificateItemPatchRequest, certificateId: string): Promise<Resource<CertificateItem>>;
11
11
  private postCertificateRequest;
12
12
  }
@@ -16,7 +16,9 @@ const mapping_1 = __importDefault(require("../../../mapping/mapping"));
16
16
  class default_1 {
17
17
  constructor(client) {
18
18
  this.client = client;
19
- this.getCertificate = (certificateId) => __awaiter(this, void 0, void 0, function* () {
19
+ }
20
+ getCertificate(certificateId) {
21
+ return __awaiter(this, void 0, void 0, function* () {
20
22
  const resp = yield this.client.httpGet(`/orderable/certificates/${certificateId}`);
21
23
  const resource = {
22
24
  httpStatusCode: resp.status
@@ -26,24 +28,30 @@ class default_1 {
26
28
  }
27
29
  return resource;
28
30
  });
29
- // Create a whole certificate item in one invocation
30
- this.postCertificate = (certificateItemRequest) => __awaiter(this, void 0, void 0, function* () {
31
+ }
32
+ // Create a whole certificate item in one invocation
33
+ postCertificate(certificateItemRequest) {
34
+ return __awaiter(this, void 0, void 0, function* () {
31
35
  return this.postCertificateRequest(certificateItemRequest, "/orderable/certificates");
32
36
  });
33
- /*
34
- * Create a partial certificate item with an initial request.
35
- *
36
- * Note: use patchCertificate to add or amend certificate item properties.
37
- */
38
- this.postInitialCertificate = (certificateItemRequest) => __awaiter(this, void 0, void 0, function* () {
37
+ }
38
+ /*
39
+ * Create a partial certificate item with an initial request.
40
+ *
41
+ * Note: use patchCertificate to add or amend certificate item properties.
42
+ */
43
+ postInitialCertificate(certificateItemRequest) {
44
+ return __awaiter(this, void 0, void 0, function* () {
39
45
  return this.postCertificateRequest(certificateItemRequest, "/orderable/certificates/initial");
40
46
  });
41
- /*
42
- * Add or amend certificate item properties; there can be one or more patch requests.
43
- *
44
- * Note: use this method after a call to postInitialCertificate.
45
- */
46
- this.patchCertificate = (certificateItemRequest, certificateId) => __awaiter(this, void 0, void 0, function* () {
47
+ }
48
+ /*
49
+ * Add or amend certificate item properties; there can be one or more patch requests.
50
+ *
51
+ * Note: use this method after a call to postInitialCertificate.
52
+ */
53
+ patchCertificate(certificateItemRequest, certificateId) {
54
+ return __awaiter(this, void 0, void 0, function* () {
47
55
  const patchRequest = mapping_1.default.snakeCaseKeys(certificateItemRequest);
48
56
  const additionalHeaders = {
49
57
  "Content-Type": "application/merge-patch+json"
@@ -57,7 +65,9 @@ class default_1 {
57
65
  }
58
66
  return resource;
59
67
  });
60
- this.postCertificateRequest = (certificateItemRequest, url) => __awaiter(this, void 0, void 0, function* () {
68
+ }
69
+ postCertificateRequest(certificateItemRequest, url) {
70
+ return __awaiter(this, void 0, void 0, function* () {
61
71
  const postRequest = mapping_1.default.snakeCaseKeys(certificateItemRequest);
62
72
  const resp = yield this.client.httpPost(url, postRequest);
63
73
  const resource = {
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../src/services/order/certificates/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAQA,uEAA+C;AAE/C;IACI,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;QAG1C,mBAAc,GA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KAAA;CACJ;AAxED,4BAwEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companieshouse/api-sdk-node",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -44,7 +44,7 @@
44
44
  "eslint-plugin-node": "11.1.0",
45
45
  "eslint-plugin-promise": "4.3.1",
46
46
  "eslint-plugin-standard": "5.0.0",
47
- "mocha": "^9.1.3",
47
+ "mocha": "^9.2.0",
48
48
  "sinon": "^9.2.4",
49
49
  "sinon-chai": "~3.5.0",
50
50
  "sonarqube-scanner": "^2.8.1",