@companieshouse/api-sdk-node 2.0.170 → 2.0.171
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.
|
@@ -6,9 +6,17 @@ export default class {
|
|
|
6
6
|
constructor(client: IHttpClient);
|
|
7
7
|
getAcsp(transactionId: string, id: string): Promise<Resource<AcspData> | ApiErrorResponse>;
|
|
8
8
|
/**
|
|
9
|
-
* Post an ACSP object to
|
|
9
|
+
* Post an ACSP object to create on the API.
|
|
10
|
+
* @param transactionId transaction id associated with the data to be saved
|
|
11
|
+
* @param acsp the data to be saved
|
|
10
12
|
*/
|
|
11
13
|
postACSP(transactionId: string, acsp: AcspData): Promise<Resource<AcspResponse> | ApiErrorResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Put an ACSP object to update on the API.
|
|
16
|
+
* @param transactionId transaction id associated with the data to be saved
|
|
17
|
+
* @param acsp the data to be saved
|
|
18
|
+
*/
|
|
19
|
+
putACSP(transactionId: string, acsp: AcspData): Promise<Resource<AcspResponse> | ApiErrorResponse>;
|
|
12
20
|
getSavedApplication(userId: string): Promise<HttpResponse>;
|
|
13
21
|
/**
|
|
14
22
|
* Delete an existing ACSP application from MongoDB
|
|
@@ -33,21 +33,39 @@ class default_1 {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* Post an ACSP object to
|
|
36
|
+
* Post an ACSP object to create on the API.
|
|
37
|
+
* @param transactionId transaction id associated with the data to be saved
|
|
38
|
+
* @param acsp the data to be saved
|
|
37
39
|
*/
|
|
38
40
|
postACSP(transactionId, acsp) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const url = `/transactions/${transactionId}/acsp`;
|
|
43
|
+
const resp = yield this.client.httpPost(url, acsp);
|
|
44
|
+
if (resp.status >= 400) {
|
|
45
|
+
return { httpStatusCode: resp.status, errors: [resp.error] };
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
httpStatusCode: resp.status,
|
|
49
|
+
resource: resp.body
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Put an ACSP object to update on the API.
|
|
55
|
+
* @param transactionId transaction id associated with the data to be saved
|
|
56
|
+
* @param acsp the data to be saved
|
|
57
|
+
*/
|
|
58
|
+
putACSP(transactionId, acsp) {
|
|
39
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
60
|
const url = `/transactions/${transactionId}/acsp`;
|
|
41
61
|
const resp = yield this.client.httpPut(url, acsp);
|
|
42
62
|
if (resp.status >= 400) {
|
|
43
63
|
return { httpStatusCode: resp.status, errors: [resp.error] };
|
|
44
64
|
}
|
|
45
|
-
|
|
46
|
-
httpStatusCode: resp.status
|
|
65
|
+
return {
|
|
66
|
+
httpStatusCode: resp.status,
|
|
67
|
+
resource: resp.body
|
|
47
68
|
};
|
|
48
|
-
const body = resp.body;
|
|
49
|
-
resource.resource = resp.body;
|
|
50
|
-
return resource;
|
|
51
69
|
});
|
|
52
70
|
}
|
|
53
71
|
/* get saved application */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/acsp/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/acsp/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAOA,oEAA4C;AAE5C;IACI,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAI,CAAC;IAEzC,OAAO,CAAE,aAAqB,EAAE,EAAU;;YACnD,MAAM,GAAG,GAAG,iBAAiB,aAAa,SAAS,EAAE,EAAE,CAAC;YACxD,MAAM,IAAI,GAAiB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAE1D,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG,EAAE;gBACpB,OAAO,EAAE,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