@companieshouse/api-sdk-node 2.0.169 → 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,8 +6,21 @@ 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>;
|
|
21
|
+
/**
|
|
22
|
+
* Delete an existing ACSP application from MongoDB
|
|
23
|
+
* @param userId the id of the user whose application will be deleted
|
|
24
|
+
*/
|
|
25
|
+
deleteSavedApplication(userId: string): Promise<HttpResponse>;
|
|
13
26
|
}
|
|
@@ -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 */
|
|
@@ -58,6 +76,17 @@ class default_1 {
|
|
|
58
76
|
return resp;
|
|
59
77
|
});
|
|
60
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Delete an existing ACSP application from MongoDB
|
|
81
|
+
* @param userId the id of the user whose application will be deleted
|
|
82
|
+
*/
|
|
83
|
+
deleteSavedApplication(userId) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const url = `/acsp-api/user/${userId}/application`;
|
|
86
|
+
const resp = yield this.client.httpDelete(url);
|
|
87
|
+
return resp;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
61
90
|
}
|
|
62
91
|
exports.default = default_1;
|
|
63
92
|
//# sourceMappingURL=service.js.map
|
|
@@ -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,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;aAChE;YAED,MAAM,QAAQ,GAAuB;gBACjC,cAAc,EAAE,IAAI,CAAC,MAAM;aAC9B,CAAC;YAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAe,CAAC;YAElC,QAAQ,CAAC,QAAQ,GAAG,iBAAO,CAAC,aAAa,CAAW,IAAI,CAAC,CAAC;YAC1D,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;IAED;;;;OAIG;IACU,QAAQ,CAAE,aAAqB,EAAE,IAAc;;YACxD,MAAM,GAAG,GAAG,iBAAiB,aAAa,OAAO,CAAC;YAElD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAEnD,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,OAAO;gBACH,cAAc,EAAE,IAAI,CAAC,MAAM;gBAC3B,QAAQ,EAAE,IAAI,CAAC,IAAI;aACI,CAAC;QAChC,CAAC;KAAA;IAED;;;;OAIG;IACU,OAAO,CAAE,aAAqB,EAAE,IAAc;;YACvD,MAAM,GAAG,GAAG,iBAAiB,aAAa,OAAO,CAAC;YAElD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAElD,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,OAAO;gBACH,cAAc,EAAE,IAAI,CAAC,MAAM;gBAC3B,QAAQ,EAAE,IAAI,CAAC,IAAI;aACI,CAAC;QAChC,CAAC;KAAA;IAED,2BAA2B;IACd,mBAAmB,CAAE,MAAc;;YAC5C,MAAM,GAAG,GAAG,kBAAkB,MAAM,cAAc,CAAC;YACnD,MAAM,IAAI,GAAiB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC1D,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IAED;;;OAGG;IACU,sBAAsB,CAAE,MAAc;;YAC/C,MAAM,GAAG,GAAG,kBAAkB,MAAM,cAAc,CAAC;YACnD,MAAM,IAAI,GAAiB,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AA7ED,4BA6EC"}
|
|
@@ -48,6 +48,7 @@ export interface AmlSupervisoryBody {
|
|
|
48
48
|
}
|
|
49
49
|
export interface AcspDto {
|
|
50
50
|
id: string;
|
|
51
|
+
transactionId?: string;
|
|
51
52
|
firstName?: string;
|
|
52
53
|
middleName?: string;
|
|
53
54
|
lastName?: string;
|
|
@@ -70,6 +71,7 @@ export interface AcspDto {
|
|
|
70
71
|
}
|
|
71
72
|
export interface AcspData {
|
|
72
73
|
id: string;
|
|
74
|
+
transactionId?: string;
|
|
73
75
|
firstName?: string;
|
|
74
76
|
middleName?: string;
|
|
75
77
|
lastName?: string;
|