@companieshouse/api-sdk-node 2.0.156 → 2.0.157
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.
|
@@ -5,5 +5,6 @@ export default class PscVerificationService {
|
|
|
5
5
|
private readonly client;
|
|
6
6
|
constructor(client: IHttpClient);
|
|
7
7
|
postPscVerification(transactionId: string, pscVerification: PscVerification): Promise<Resource<PscVerificationResource> | ApiErrorResponse>;
|
|
8
|
+
getPscVerification(transactionId: string, pscVerificationId: string): Promise<Resource<PscVerificationResource> | ApiErrorResponse>;
|
|
8
9
|
private populateResource;
|
|
9
10
|
}
|
|
@@ -15,8 +15,21 @@ class PscVerificationService {
|
|
|
15
15
|
}
|
|
16
16
|
postPscVerification(transactionId, pscVerification) {
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const
|
|
19
|
-
const response = yield this.client.httpPost(
|
|
18
|
+
const resourceUri = `/transactions/${transactionId}/persons-with-significant-control-verification`;
|
|
19
|
+
const response = yield this.client.httpPost(resourceUri, pscVerification);
|
|
20
|
+
if (response.error) {
|
|
21
|
+
return {
|
|
22
|
+
httpStatusCode: response.status,
|
|
23
|
+
errors: [response.error]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return this.populateResource(response);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
getPscVerification(transactionId, pscVerificationId) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const resourceUri = `/transactions/${transactionId}/persons-with-significant-control-verification/${pscVerificationId}`;
|
|
32
|
+
const response = yield this.client.httpGet(resourceUri);
|
|
20
33
|
if (response.error) {
|
|
21
34
|
return {
|
|
22
35
|
httpStatusCode: response.status,
|
|
@@ -26,13 +39,15 @@ class PscVerificationService {
|
|
|
26
39
|
const resource = {
|
|
27
40
|
httpStatusCode: response.status
|
|
28
41
|
};
|
|
29
|
-
|
|
30
|
-
this.populateResource(resource, body);
|
|
31
|
-
return resource;
|
|
42
|
+
return this.populateResource(response);
|
|
32
43
|
});
|
|
33
44
|
}
|
|
34
|
-
populateResource(
|
|
35
|
-
resource
|
|
45
|
+
populateResource(response) {
|
|
46
|
+
const resource = {
|
|
47
|
+
httpStatusCode: response.status,
|
|
48
|
+
resource: response.body
|
|
49
|
+
};
|
|
50
|
+
return resource;
|
|
36
51
|
}
|
|
37
52
|
}
|
|
38
53
|
exports.default = PscVerificationService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/psc-verification-link/service.ts"],"names":[],"mappings":";;;;;;;;;;;AAOA,MAAqB,sBAAsB;IACvC,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAExC,mBAAmB,CAAE,aAAqB,EAAE,eAAgC;;YACrF,MAAM,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/psc-verification-link/service.ts"],"names":[],"mappings":";;;;;;;;;;;AAOA,MAAqB,sBAAsB;IACvC,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAExC,mBAAmB,CAAE,aAAqB,EAAE,eAAgC;;YACrF,MAAM,WAAW,GAAG,iBAAiB,aAAa,gDAAgD,CAAC;YACnG,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YAE1E,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,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;KAAA;IAEY,kBAAkB,CAAE,aAAqB,EAAE,iBAAyB;;YAC7E,MAAM,WAAW,GAAG,iBAAiB,aAAa,kDAAkD,iBAAiB,EAAE,CAAC;YACxH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAExD,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,QAAQ,GAAsC;gBAChD,cAAc,EAAE,QAAQ,CAAC,MAAM;aAClC,CAAC;YAEF,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;KAAA;IAEO,gBAAgB,CAAE,QAAsB;QAC5C,MAAM,QAAQ,GAAsC;YAChD,cAAc,EAAE,QAAQ,CAAC,MAAM;YAC/B,QAAQ,EAAE,QAAQ,CAAC,IAA+B;SACrD,CAAC;QAEF,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AA3CD,yCA2CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companieshouse/api-sdk-node",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.157",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"axios": "^1.6.7",
|
|
23
23
|
"camelcase-keys": "~6.2.2",
|
|
24
|
+
"http-status-codes": "^2.3.0",
|
|
24
25
|
"snakecase-keys": "~3.2.0",
|
|
25
26
|
"url-search-params-polyfill": "~8.1.1"
|
|
26
27
|
},
|