@companieshouse/api-sdk-node 2.0.190 → 2.0.192
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,7 +4,7 @@ import Resource, { ApiErrorResponse } from "../resource";
|
|
|
4
4
|
export default class {
|
|
5
5
|
private readonly client;
|
|
6
6
|
constructor(client: IHttpClient);
|
|
7
|
-
getAcsp(transactionId: string,
|
|
7
|
+
getAcsp(transactionId: string, acspApplicationId: string): Promise<Resource<AcspData> | ApiErrorResponse>;
|
|
8
8
|
/**
|
|
9
9
|
* Post an ACSP object to create on the API.
|
|
10
10
|
* @param transactionId transaction id associated with the data to be saved
|
|
@@ -14,19 +14,14 @@ export default class {
|
|
|
14
14
|
/**
|
|
15
15
|
* Put an ACSP object to update on the API.
|
|
16
16
|
* @param transactionId transaction id associated with the data to be saved
|
|
17
|
+
* @param acspApplicationId acsp application id unique to the application
|
|
17
18
|
* @param acsp the data to be saved
|
|
18
19
|
*/
|
|
19
|
-
putACSP(transactionId: string, acsp: AcspData): Promise<Resource<AcspResponse> | ApiErrorResponse>;
|
|
20
|
-
getSavedApplication(
|
|
20
|
+
putACSP(transactionId: string, acspApplicationId: string, acsp: AcspData): Promise<Resource<AcspResponse> | ApiErrorResponse>;
|
|
21
|
+
getSavedApplication(acspApplicationId: string): Promise<HttpResponse>;
|
|
21
22
|
/**
|
|
22
23
|
* Delete an existing ACSP application from MongoDB
|
|
23
|
-
* @param
|
|
24
|
+
* @param acspApplicationId the id of the user whose application will be deleted
|
|
24
25
|
*/
|
|
25
|
-
deleteSavedApplication(
|
|
26
|
-
/**
|
|
27
|
-
* Send a confirmation email for application complete
|
|
28
|
-
* @param userId the id of the user who will recieve the email
|
|
29
|
-
* @param applicationReference the reference number of the application
|
|
30
|
-
*/
|
|
31
|
-
sendConfirmationEmail(userId: string, applicationReference: string): Promise<HttpResponse>;
|
|
26
|
+
deleteSavedApplication(acspApplicationId: string): Promise<HttpResponse>;
|
|
32
27
|
}
|
|
@@ -17,9 +17,9 @@ class default_1 {
|
|
|
17
17
|
constructor(client) {
|
|
18
18
|
this.client = client;
|
|
19
19
|
}
|
|
20
|
-
getAcsp(transactionId,
|
|
20
|
+
getAcsp(transactionId, acspApplicationId) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const url = `/transactions/${transactionId}/
|
|
22
|
+
const url = `/transactions/${transactionId}/authorised-corporate-service-provider-applications/${acspApplicationId}`;
|
|
23
23
|
const resp = yield this.client.httpGet(url);
|
|
24
24
|
if (resp.status >= 400) {
|
|
25
25
|
return { httpStatusCode: resp.status, errors: [resp.error] };
|
|
@@ -39,8 +39,9 @@ class default_1 {
|
|
|
39
39
|
*/
|
|
40
40
|
postACSP(transactionId, acsp) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const url = `/transactions/${transactionId}/
|
|
43
|
-
const
|
|
42
|
+
const url = `/transactions/${transactionId}/authorised-corporate-service-provider-applications`;
|
|
43
|
+
const acspDto = mapping_1.default.snakeCaseKeys(acsp);
|
|
44
|
+
const resp = yield this.client.httpPost(url, acspDto);
|
|
44
45
|
if (resp.status >= 400) {
|
|
45
46
|
return { httpStatusCode: resp.status, errors: [resp.error] };
|
|
46
47
|
}
|
|
@@ -53,12 +54,14 @@ class default_1 {
|
|
|
53
54
|
/**
|
|
54
55
|
* Put an ACSP object to update on the API.
|
|
55
56
|
* @param transactionId transaction id associated with the data to be saved
|
|
57
|
+
* @param acspApplicationId acsp application id unique to the application
|
|
56
58
|
* @param acsp the data to be saved
|
|
57
59
|
*/
|
|
58
|
-
putACSP(transactionId, acsp) {
|
|
60
|
+
putACSP(transactionId, acspApplicationId, acsp) {
|
|
59
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const url = `/transactions/${transactionId}/
|
|
61
|
-
const
|
|
62
|
+
const url = `/transactions/${transactionId}/authorised-corporate-service-provider-applications/${acspApplicationId}`;
|
|
63
|
+
const acspDto = mapping_1.default.snakeCaseKeys(acsp);
|
|
64
|
+
const resp = yield this.client.httpPut(url, acspDto);
|
|
62
65
|
if (resp.status >= 400) {
|
|
63
66
|
return { httpStatusCode: resp.status, errors: [resp.error] };
|
|
64
67
|
}
|
|
@@ -69,36 +72,24 @@ class default_1 {
|
|
|
69
72
|
});
|
|
70
73
|
}
|
|
71
74
|
/* get saved application */
|
|
72
|
-
getSavedApplication(
|
|
75
|
+
getSavedApplication(acspApplicationId) {
|
|
73
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
const url = `/acsp-api/user/${
|
|
77
|
+
const url = `/acsp-api/user/${acspApplicationId}/application`;
|
|
75
78
|
const resp = yield this.client.httpGet(url);
|
|
76
79
|
return resp;
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
82
|
/**
|
|
80
83
|
* Delete an existing ACSP application from MongoDB
|
|
81
|
-
* @param
|
|
84
|
+
* @param acspApplicationId the id of the user whose application will be deleted
|
|
82
85
|
*/
|
|
83
|
-
deleteSavedApplication(
|
|
86
|
+
deleteSavedApplication(acspApplicationId) {
|
|
84
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
const url = `/acsp-api/user/${
|
|
88
|
+
const url = `/acsp-api/user/${acspApplicationId}/application`;
|
|
86
89
|
const resp = yield this.client.httpDelete(url);
|
|
87
90
|
return resp;
|
|
88
91
|
});
|
|
89
92
|
}
|
|
90
|
-
/**
|
|
91
|
-
* Send a confirmation email for application complete
|
|
92
|
-
* @param userId the id of the user who will recieve the email
|
|
93
|
-
* @param applicationReference the reference number of the application
|
|
94
|
-
*/
|
|
95
|
-
sendConfirmationEmail(userId, applicationReference) {
|
|
96
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
const url = `/acsp-api/user/${userId}/application-submit/${applicationReference}`;
|
|
98
|
-
const resp = yield this.client.httpPost(url);
|
|
99
|
-
return resp;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
93
|
}
|
|
103
94
|
exports.default = default_1;
|
|
104
95
|
//# sourceMappingURL=service.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iBAAyB;;YAClE,MAAM,GAAG,GAAG,iBAAiB,aAAa,uDAAuD,iBAAiB,EAAE,CAAC;YACrH,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,IAAmB,CAAC;YAEtC,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,qDAAqD,CAAC;YAEhG,MAAM,OAAO,GAAG,iBAAO,CAAC,aAAa,CAAC,IAAI,CA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;;YAC1D,MAAM,GAAG,GAAG,kBAAkB,iBAAiB,cAAc,CAAC;YAC9D,MAAM,IAAI,GAAiB,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAhFD,4BAgFC"}
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
export interface AddressResource {
|
|
2
|
-
address_line_1: string;
|
|
3
|
-
address_line_2?: string;
|
|
4
|
-
care_of?: string;
|
|
5
|
-
country: string;
|
|
6
|
-
locality: string;
|
|
7
|
-
po_box?: string;
|
|
8
|
-
postal_code?: string;
|
|
9
|
-
premises?: string;
|
|
10
|
-
region?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface DateOfBirthResource {
|
|
13
|
-
day?: string;
|
|
14
|
-
month: string;
|
|
15
|
-
year: string;
|
|
16
|
-
}
|
|
17
|
-
export interface DateOfBirth {
|
|
18
|
-
day?: string;
|
|
19
|
-
month: string;
|
|
20
|
-
year: string;
|
|
21
|
-
}
|
|
22
1
|
export interface Address {
|
|
23
2
|
premises?: string;
|
|
24
3
|
addressLine1?: string;
|
|
@@ -51,10 +30,8 @@ export interface ApplicantDetails {
|
|
|
51
30
|
correspondenceAddress?: Address;
|
|
52
31
|
correspondenceAddressIsSameAsRegisteredOfficeAddress?: boolean;
|
|
53
32
|
}
|
|
54
|
-
export interface
|
|
33
|
+
export interface AcspData {
|
|
55
34
|
id: string;
|
|
56
|
-
transactionId?: string;
|
|
57
|
-
roleInTheBusiness?: string;
|
|
58
35
|
registeredOfficeAddress?: Address;
|
|
59
36
|
typeOfBusiness?: string;
|
|
60
37
|
roleType?: string;
|
|
@@ -67,25 +44,52 @@ export interface AcspDto {
|
|
|
67
44
|
howAreYouRegisteredWithAml?: string;
|
|
68
45
|
applicantDetails?: ApplicantDetails;
|
|
69
46
|
}
|
|
70
|
-
export interface
|
|
47
|
+
export interface AcspResponse {
|
|
48
|
+
data: AcspDataDto;
|
|
49
|
+
}
|
|
50
|
+
export interface AcspDataDto {
|
|
71
51
|
id: string;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
typeOfBusiness?: string;
|
|
76
|
-
roleType?: string;
|
|
52
|
+
registered_office_address?: AddressDto;
|
|
53
|
+
type_of_business?: string;
|
|
54
|
+
role_type?: string;
|
|
77
55
|
verified?: boolean;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
56
|
+
business_name?: string;
|
|
57
|
+
work_sector?: string;
|
|
58
|
+
aml_supervisory_bodies?: AmlSupervisoryBodyDto[];
|
|
59
|
+
company_details?: CompanyDto;
|
|
60
|
+
company_auth_code_provided?: boolean;
|
|
61
|
+
how_are_you_registered_with_aml?: string;
|
|
62
|
+
applicant_details?: ApplicantDetailsDto;
|
|
85
63
|
}
|
|
86
|
-
export interface
|
|
87
|
-
|
|
64
|
+
export interface ApplicantDetailsDto {
|
|
65
|
+
first_name?: string;
|
|
66
|
+
middle_name?: string;
|
|
67
|
+
last_name?: string;
|
|
68
|
+
date_of_birth?: Date;
|
|
69
|
+
nationality?: NationalityDto;
|
|
70
|
+
country_of_residence?: string;
|
|
71
|
+
correspondence_address?: AddressDto;
|
|
72
|
+
correspondence_address_is_same_as_registered_office_address?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface AddressDto {
|
|
75
|
+
premises?: string;
|
|
76
|
+
address_line_1?: string;
|
|
77
|
+
address_line_2?: string;
|
|
78
|
+
locality?: string;
|
|
79
|
+
region?: string;
|
|
80
|
+
country?: string;
|
|
81
|
+
postal_code?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface CompanyDto {
|
|
84
|
+
company_name?: string;
|
|
85
|
+
company_number?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface AmlSupervisoryBodyDto {
|
|
88
|
+
aml_supervisory_body?: string;
|
|
89
|
+
membership_id?: string;
|
|
88
90
|
}
|
|
89
|
-
export interface
|
|
90
|
-
|
|
91
|
+
export interface NationalityDto {
|
|
92
|
+
first_nationality: string;
|
|
93
|
+
second_nationality?: string;
|
|
94
|
+
third_nationality?: string;
|
|
91
95
|
}
|