@companieshouse/api-sdk-node 2.0.274 → 2.0.275
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.
|
@@ -18,19 +18,25 @@ export default class AssociationsService {
|
|
|
18
18
|
* @param includeRemoved - a flag to get a list of companies where status is "removed". Default value: false.
|
|
19
19
|
* @param pageIndex - a page number to be returned. Default value: 0.
|
|
20
20
|
* @param itemsPerPage - a number of items to be returned per page. Default value: 15.
|
|
21
|
-
* @param userEmail - an email address of a user to check if associated with the company.
|
|
22
21
|
* @param userId - a unique identifier of a user to check if associated with the company.
|
|
23
22
|
* @returns a promise that resolves to the HTTP response from the server that includes the associations or errors object.
|
|
24
23
|
*/
|
|
25
|
-
getCompanyAssociations(companyNumber: string, includeRemoved?: boolean, pageIndex?: number, itemsPerPage?: number,
|
|
24
|
+
getCompanyAssociations(companyNumber: string, includeRemoved?: boolean, pageIndex?: number, itemsPerPage?: number, userId?: string): Promise<Resource<AssociationList | Errors>>;
|
|
26
25
|
/**
|
|
27
|
-
* Initiates an HTTP GET request to retrieve the
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
31
|
-
* @param companyNumber - a filter based on company number.
|
|
32
|
-
* @returns a promise that resolves to the HTTP response from the server that includes the associations or errors object.
|
|
26
|
+
* Initiates an HTTP GET request to retrieve the association for a company for the provided user email.
|
|
27
|
+
* @param companyNumber - a company number of the company for which the associations should be retrieved.
|
|
28
|
+
* @param userEmail - an email address of a user to check if associated with the company.
|
|
29
|
+
* @returns a promise that resolves to the HTTP response from the server that includes the association or errors object.
|
|
33
30
|
*/
|
|
31
|
+
getCompanyAssociationByUserEmail(companyNumber: string, userEmail: string): Promise<Resource<Association | Errors>>;
|
|
32
|
+
/**
|
|
33
|
+
* Initiates an HTTP GET request to retrieve the associations searched based on association status.
|
|
34
|
+
* @param associationStatus - an association status used to filter associations. This parameter is required. Available values: confirmed, awaiting-approval, removed. Default value: confirmed.
|
|
35
|
+
* @param pageIndex - a page to be returned. Default value: 0.
|
|
36
|
+
* @param itemsPerPage - a number of items returned per page. Default value: 15.
|
|
37
|
+
* @param companyNumber - a filter based on company number.
|
|
38
|
+
* @returns a promise that resolves to the HTTP response from the server that includes the associations or errors object.
|
|
39
|
+
*/
|
|
34
40
|
searchAssociations(associationStatus: AssociationStatus[], pageIndex?: number, itemsPerPage?: number, companyNumber?: string): Promise<Resource<AssociationList | Errors>>;
|
|
35
41
|
/**
|
|
36
42
|
* Creates a new association for a user in session.
|
|
@@ -30,11 +30,10 @@ class AssociationsService {
|
|
|
30
30
|
* @param includeRemoved - a flag to get a list of companies where status is "removed". Default value: false.
|
|
31
31
|
* @param pageIndex - a page number to be returned. Default value: 0.
|
|
32
32
|
* @param itemsPerPage - a number of items to be returned per page. Default value: 15.
|
|
33
|
-
* @param userEmail - an email address of a user to check if associated with the company.
|
|
34
33
|
* @param userId - a unique identifier of a user to check if associated with the company.
|
|
35
34
|
* @returns a promise that resolves to the HTTP response from the server that includes the associations or errors object.
|
|
36
35
|
*/
|
|
37
|
-
getCompanyAssociations(companyNumber, includeRemoved, pageIndex, itemsPerPage,
|
|
36
|
+
getCompanyAssociations(companyNumber, includeRemoved, pageIndex, itemsPerPage, userId) {
|
|
38
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
38
|
let queryString = "";
|
|
40
39
|
if (includeRemoved || pageIndex || itemsPerPage || userId) {
|
|
@@ -46,23 +45,33 @@ class AssociationsService {
|
|
|
46
45
|
};
|
|
47
46
|
queryString = this.getQueryString(queryParameters);
|
|
48
47
|
}
|
|
49
|
-
let headers;
|
|
50
|
-
if (userEmail) {
|
|
51
|
-
headers = { user_email: userEmail };
|
|
52
|
-
}
|
|
53
48
|
const url = `/associations/companies/${companyNumber}${queryString}`;
|
|
54
|
-
const response = yield this.client.httpGet(url
|
|
49
|
+
const response = yield this.client.httpGet(url);
|
|
55
50
|
return this.getResource(response);
|
|
56
51
|
});
|
|
57
52
|
}
|
|
58
53
|
/**
|
|
59
|
-
* Initiates an HTTP GET request to retrieve the
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
* @
|
|
63
|
-
* @param companyNumber - a filter based on company number.
|
|
64
|
-
* @returns a promise that resolves to the HTTP response from the server that includes the associations or errors object.
|
|
54
|
+
* Initiates an HTTP GET request to retrieve the association for a company for the provided user email.
|
|
55
|
+
* @param companyNumber - a company number of the company for which the associations should be retrieved.
|
|
56
|
+
* @param userEmail - an email address of a user to check if associated with the company.
|
|
57
|
+
* @returns a promise that resolves to the HTTP response from the server that includes the association or errors object.
|
|
65
58
|
*/
|
|
59
|
+
getCompanyAssociationByUserEmail(companyNumber, userEmail) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const url = `/associations/companies/${companyNumber}`;
|
|
62
|
+
const body = { user_email: userEmail };
|
|
63
|
+
const response = yield this.client.httpPost(url, body);
|
|
64
|
+
return this.getResource(response);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Initiates an HTTP GET request to retrieve the associations searched based on association status.
|
|
69
|
+
* @param associationStatus - an association status used to filter associations. This parameter is required. Available values: confirmed, awaiting-approval, removed. Default value: confirmed.
|
|
70
|
+
* @param pageIndex - a page to be returned. Default value: 0.
|
|
71
|
+
* @param itemsPerPage - a number of items returned per page. Default value: 15.
|
|
72
|
+
* @param companyNumber - a filter based on company number.
|
|
73
|
+
* @returns a promise that resolves to the HTTP response from the server that includes the associations or errors object.
|
|
74
|
+
*/
|
|
66
75
|
searchAssociations(associationStatus, pageIndex, itemsPerPage, companyNumber) {
|
|
67
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
77
|
const queryParameters = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/associations/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA,oEAA4C;AAE5C;;GAEG;AACH,MAAqB,mBAAm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