@companieshouse/api-sdk-node 2.0.273 → 2.0.274

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.
package/dist/client.d.ts CHANGED
@@ -29,6 +29,7 @@ import PscVerificationService from "./services/psc-verification-link/service";
29
29
  import { AccountsFilingService } from "./services/accounts-filing";
30
30
  import PscService from "./services/psc/service";
31
31
  import { LimitedPartnershipsService } from "./services/limited-partnerships";
32
+ import AssociationsService from "./services/associations/service";
32
33
  /**
33
34
  * ApiClient is the class that all service objects hang off.
34
35
  */
@@ -70,5 +71,6 @@ export default class ApiClient {
70
71
  readonly accountsFilingService: AccountsFilingService;
71
72
  readonly pscService: PscService;
72
73
  readonly limitedPartnershipsService: LimitedPartnershipsService;
74
+ readonly associationsService: AssociationsService;
73
75
  constructor(apiClient: IHttpClient, accountClient: IHttpClient);
74
76
  }
package/dist/client.js CHANGED
@@ -32,6 +32,7 @@ const service_19 = __importDefault(require("./services/psc-verification-link/ser
32
32
  const accounts_filing_1 = require("./services/accounts-filing");
33
33
  const service_20 = __importDefault(require("./services/psc/service"));
34
34
  const limited_partnerships_1 = require("./services/limited-partnerships");
35
+ const service_21 = __importDefault(require("./services/associations/service"));
35
36
  /**
36
37
  * ApiClient is the class that all service objects hang off.
37
38
  */
@@ -76,6 +77,7 @@ class ApiClient {
76
77
  this.accountsFilingService = new accounts_filing_1.AccountsFilingService(apiClient);
77
78
  this.pscService = new service_20.default(apiClient);
78
79
  this.limitedPartnershipsService = new limited_partnerships_1.LimitedPartnershipsService(apiClient);
80
+ this.associationsService = new service_21.default(accountClient);
79
81
  }
80
82
  }
81
83
  exports.default = ApiClient;
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;AACA,kFAAyE;AACzE,iFAAuE;AACvE,iFAAuE;AACvE,6EAA+D;AAC/D,wCAA0D;AAC1D,6CAO2B;AAC3B,iDAAqD;AACrD,wFA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";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./types"), exports);
14
+ __exportStar(require("./service"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/associations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B"}
@@ -0,0 +1,98 @@
1
+ import IHttpClient from "http/http-client";
2
+ import Resource from "../../services/resource";
3
+ import { Association, AssociationList, AssociationStatus, Errors, InvitationList, NewAssociationResponse, PreviousStateList } from "./types";
4
+ /**
5
+ * A service class for managing communications with the associations API.
6
+ */
7
+ export default class AssociationsService {
8
+ private readonly client;
9
+ private static readonly STATUS;
10
+ /**
11
+ * Constructs an AssociationsService instance.
12
+ * @param client - The HTTP client for making requests.
13
+ */
14
+ constructor(client: IHttpClient);
15
+ /**
16
+ * Initiates an HTTP GET request to retrieve the associations for a company.
17
+ * @param companyNumber - a company number of the company for which the associations should be retrieved.
18
+ * @param includeRemoved - a flag to get a list of companies where status is "removed". Default value: false.
19
+ * @param pageIndex - a page number to be returned. Default value: 0.
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
+ * @param userId - a unique identifier of a user to check if associated with the company.
23
+ * @returns a promise that resolves to the HTTP response from the server that includes the associations or errors object.
24
+ */
25
+ getCompanyAssociations(companyNumber: string, includeRemoved?: boolean, pageIndex?: number, itemsPerPage?: number, userEmail?: string, userId?: string): Promise<Resource<AssociationList | Errors>>;
26
+ /**
27
+ * Initiates an HTTP GET request to retrieve the associations searched based on association status.
28
+ * @param associationStatus - an association status used to filter associations. This parameter is required. Available values: confirmed, awaiting-approval, removed. Default value: confirmed.
29
+ * @param pageIndex - a page to be returned. Default value: 0.
30
+ * @param itemsPerPage - a number of items returned per page. Default value: 15.
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.
33
+ */
34
+ searchAssociations(associationStatus: AssociationStatus[], pageIndex?: number, itemsPerPage?: number, companyNumber?: string): Promise<Resource<AssociationList | Errors>>;
35
+ /**
36
+ * Creates a new association for a user in session.
37
+ * @param companyNumber - a company number of the company with which a new association for the user will be created.
38
+ * @param inviteeEmailAddress - an email address of the user invited to have an association with a company.
39
+ * @returns a promise that resolves to the HTTP response from the server that includes the new association's link (it contains the association identifier) or errors object.
40
+ */
41
+ createAssociation(companyNumber: string, inviteeEmailAddress?: string): Promise<Resource<NewAssociationResponse | Errors>>;
42
+ /**
43
+ * Returns an association data for the association with the provided association identifier.
44
+ * @param associationId - an identifier of the association for which data has to be returned.
45
+ * @returns a promise that resolves to the HTTP response from the server that includes the association data or errors object.
46
+ */
47
+ getAssociation(associationId: string): Promise<Resource<Association | Errors>>;
48
+ /**
49
+ * Changes the status of an association with the provided identifier to the provided status.
50
+ * @param associationId - an identifier of the association to modify.
51
+ * @param status - a new status for the association.
52
+ * @returns a promise that resolves to the HTTP response from the server that has no resource data or includes errors object.
53
+ */
54
+ updateAssociationStatus(associationId: string, status: AssociationStatus): Promise<Resource<undefined | Errors>>;
55
+ /**
56
+ * Initiates an HTTP GET fetch active invitations for a user in session from all associations.
57
+ * This request return only the invitations which are active (status = awaiting_approval)
58
+ * and not expired.
59
+ * @param pageIndex - page number to be returned, default value: 0.
60
+ * @param itemsPerPage - a number of items to be returned per page. Default value: 15.
61
+ * @returns a promise that resolves to the invitations list for this user or errors object.
62
+ */
63
+ getInvitations(pageIndex?: number, itemsPerPage?: number): Promise<Resource<InvitationList | Errors>>;
64
+ /**
65
+ * Creates a new invitation (association) for the supplied email and company number.
66
+ * @param companyNumber - the company number.
67
+ * @param inviteeEmailAddress - email address of the user invited to have an association.
68
+ * @returns a promise that resolves to the HTTP response from the server that includes the new association's identifier or errors object.
69
+ */
70
+ postInvitation(companyNumber: string, inviteeEmailAddress: string): Promise<Resource<NewAssociationResponse | Errors>>;
71
+ /**
72
+ * Initiates an HTTP GET request to return all previous states for an association. This will not return the active state.
73
+ * @param associationID - an identifier of the association for which the previous states are being returned.
74
+ * @param pageIndex - a page number to be returned. Default value: 0.
75
+ * @param itemsPerPage - a number of items to be returned per page. Default value: 15.
76
+ * @returns a promise that resolves to the HTTP response from the server that includes the PreviousStateList or an Errors object.
77
+ */
78
+ getPreviousStates(associationID: string, pageIndex?: number, itemsPerPage?: number): Promise<Resource<PreviousStateList | Errors>>;
79
+ /**
80
+ * Creates a query string based on the properties provided in queryParameters object.
81
+ * @param queryParameters - an object of which properties are used as key-value entries to a query string to be added to URL.
82
+ * @returns - a query string or an empty string if no parameters provided.
83
+ */
84
+ private getQueryString;
85
+ /**
86
+ * Creates a string containing key-value pairs connected with an ampersand & to include in a query string.
87
+ * @param keyName - a key name common for all values.
88
+ * @param values - an array of values to include in the string.
89
+ * @returns a string containing key-value pairs connected with an ampersand.
90
+ */
91
+ private getExplodableArray;
92
+ /**
93
+ * Maps the resource data structures from snake case to camel keys.
94
+ * @param response - a HTTP response object with resource data.
95
+ * @returns a resource data with camel case keys.
96
+ */
97
+ private getResource;
98
+ }
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const mapping_1 = __importDefault(require("../../mapping/mapping"));
16
+ /**
17
+ * A service class for managing communications with the associations API.
18
+ */
19
+ class AssociationsService {
20
+ /**
21
+ * Constructs an AssociationsService instance.
22
+ * @param client - The HTTP client for making requests.
23
+ */
24
+ constructor(client) {
25
+ this.client = client;
26
+ }
27
+ /**
28
+ * Initiates an HTTP GET request to retrieve the associations for a company.
29
+ * @param companyNumber - a company number of the company for which the associations should be retrieved.
30
+ * @param includeRemoved - a flag to get a list of companies where status is "removed". Default value: false.
31
+ * @param pageIndex - a page number to be returned. Default value: 0.
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
+ * @param userId - a unique identifier of a user to check if associated with the company.
35
+ * @returns a promise that resolves to the HTTP response from the server that includes the associations or errors object.
36
+ */
37
+ getCompanyAssociations(companyNumber, includeRemoved, pageIndex, itemsPerPage, userEmail, userId) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ let queryString = "";
40
+ if (includeRemoved || pageIndex || itemsPerPage || userId) {
41
+ const queryParameters = {
42
+ include_removed: includeRemoved || undefined,
43
+ page_index: pageIndex || undefined,
44
+ items_per_page: itemsPerPage || undefined,
45
+ user_id: userId || undefined
46
+ };
47
+ queryString = this.getQueryString(queryParameters);
48
+ }
49
+ let headers;
50
+ if (userEmail) {
51
+ headers = { user_email: userEmail };
52
+ }
53
+ const url = `/associations/companies/${companyNumber}${queryString}`;
54
+ const response = yield this.client.httpGet(url, headers);
55
+ return this.getResource(response);
56
+ });
57
+ }
58
+ /**
59
+ * Initiates an HTTP GET request to retrieve the associations searched based on association status.
60
+ * @param associationStatus - an association status used to filter associations. This parameter is required. Available values: confirmed, awaiting-approval, removed. Default value: confirmed.
61
+ * @param pageIndex - a page to be returned. Default value: 0.
62
+ * @param itemsPerPage - a number of items returned per page. Default value: 15.
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.
65
+ */
66
+ searchAssociations(associationStatus, pageIndex, itemsPerPage, companyNumber) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const queryParameters = {
69
+ page_index: pageIndex || undefined,
70
+ items_per_page: itemsPerPage || undefined,
71
+ company_number: companyNumber || undefined,
72
+ status: associationStatus
73
+ };
74
+ const queryString = this.getQueryString(queryParameters);
75
+ const url = `/associations${queryString}`;
76
+ const response = yield this.client.httpGet(url);
77
+ return this.getResource(response);
78
+ });
79
+ }
80
+ /**
81
+ * Creates a new association for a user in session.
82
+ * @param companyNumber - a company number of the company with which a new association for the user will be created.
83
+ * @param inviteeEmailAddress - an email address of the user invited to have an association with a company.
84
+ * @returns a promise that resolves to the HTTP response from the server that includes the new association's link (it contains the association identifier) or errors object.
85
+ */
86
+ createAssociation(companyNumber, inviteeEmailAddress) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ const url = inviteeEmailAddress ? "/associations/invitations" : "/associations";
89
+ const body = inviteeEmailAddress
90
+ ? { company_number: companyNumber, invitee_email_id: inviteeEmailAddress }
91
+ : { company_number: companyNumber };
92
+ const response = yield this.client.httpPost(url, body);
93
+ return this.getResource(response);
94
+ });
95
+ }
96
+ /**
97
+ * Returns an association data for the association with the provided association identifier.
98
+ * @param associationId - an identifier of the association for which data has to be returned.
99
+ * @returns a promise that resolves to the HTTP response from the server that includes the association data or errors object.
100
+ */
101
+ getAssociation(associationId) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ const url = `/associations/${associationId}`;
104
+ const response = yield this.client.httpGet(url);
105
+ return this.getResource(response);
106
+ });
107
+ }
108
+ /**
109
+ * Changes the status of an association with the provided identifier to the provided status.
110
+ * @param associationId - an identifier of the association to modify.
111
+ * @param status - a new status for the association.
112
+ * @returns a promise that resolves to the HTTP response from the server that has no resource data or includes errors object.
113
+ */
114
+ updateAssociationStatus(associationId, status) {
115
+ return __awaiter(this, void 0, void 0, function* () {
116
+ const url = `/associations/${associationId}`;
117
+ const body = { status: status };
118
+ const response = yield this.client.httpPatch(url, body);
119
+ return this.getResource(response);
120
+ });
121
+ }
122
+ /**
123
+ * Initiates an HTTP GET fetch active invitations for a user in session from all associations.
124
+ * This request return only the invitations which are active (status = awaiting_approval)
125
+ * and not expired.
126
+ * @param pageIndex - page number to be returned, default value: 0.
127
+ * @param itemsPerPage - a number of items to be returned per page. Default value: 15.
128
+ * @returns a promise that resolves to the invitations list for this user or errors object.
129
+ */
130
+ getInvitations(pageIndex, itemsPerPage) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ const queryParameters = {
133
+ page_index: pageIndex || undefined,
134
+ items_per_page: itemsPerPage || undefined
135
+ };
136
+ const queryString = this.getQueryString(queryParameters);
137
+ const url = `/associations/invitations${queryString}`;
138
+ const response = yield this.client.httpGet(url);
139
+ return this.getResource(response);
140
+ });
141
+ }
142
+ /**
143
+ * Creates a new invitation (association) for the supplied email and company number.
144
+ * @param companyNumber - the company number.
145
+ * @param inviteeEmailAddress - email address of the user invited to have an association.
146
+ * @returns a promise that resolves to the HTTP response from the server that includes the new association's identifier or errors object.
147
+ */
148
+ postInvitation(companyNumber, inviteeEmailAddress) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ const body = {
151
+ company_number: companyNumber,
152
+ invitee_email_id: inviteeEmailAddress
153
+ };
154
+ const url = `/associations/invitations`;
155
+ const response = yield this.client.httpPost(url, body);
156
+ return this.getResource(response);
157
+ });
158
+ }
159
+ /**
160
+ * Initiates an HTTP GET request to return all previous states for an association. This will not return the active state.
161
+ * @param associationID - an identifier of the association for which the previous states are being returned.
162
+ * @param pageIndex - a page number to be returned. Default value: 0.
163
+ * @param itemsPerPage - a number of items to be returned per page. Default value: 15.
164
+ * @returns a promise that resolves to the HTTP response from the server that includes the PreviousStateList or an Errors object.
165
+ */
166
+ getPreviousStates(associationID, pageIndex, itemsPerPage) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ let queryString = "";
169
+ if (pageIndex || itemsPerPage) {
170
+ const queryParameters = {
171
+ page_index: pageIndex || undefined,
172
+ items_per_page: itemsPerPage || undefined
173
+ };
174
+ queryString = this.getQueryString(queryParameters);
175
+ }
176
+ const url = `/associations/${associationID}/previous-states${queryString}`;
177
+ const response = yield this.client.httpGet(url);
178
+ return this.getResource(response);
179
+ });
180
+ }
181
+ /**
182
+ * Creates a query string based on the properties provided in queryParameters object.
183
+ * @param queryParameters - an object of which properties are used as key-value entries to a query string to be added to URL.
184
+ * @returns - a query string or an empty string if no parameters provided.
185
+ */
186
+ getQueryString(queryParameters) {
187
+ let queryString = "";
188
+ if (queryParameters && Object.keys(queryParameters).length > 0) {
189
+ let counter = Object.keys(queryParameters).length;
190
+ queryString = "?";
191
+ for (const [key, value] of Object.entries(queryParameters)) {
192
+ counter--;
193
+ if (!value) {
194
+ continue;
195
+ }
196
+ const keyValuePair = key === AssociationsService.STATUS
197
+ ? this.getExplodableArray(key, value)
198
+ : `${key}=${value}`;
199
+ const separator = counter > 0 ? "&" : "";
200
+ queryString = `${queryString}${keyValuePair}${separator}`;
201
+ }
202
+ }
203
+ return queryString;
204
+ }
205
+ /**
206
+ * Creates a string containing key-value pairs connected with an ampersand & to include in a query string.
207
+ * @param keyName - a key name common for all values.
208
+ * @param values - an array of values to include in the string.
209
+ * @returns a string containing key-value pairs connected with an ampersand.
210
+ */
211
+ getExplodableArray(keyName, values) {
212
+ let queryString = "";
213
+ let counter = values.length;
214
+ for (const value of values) {
215
+ counter--;
216
+ const separator = counter > 0 ? "&" : "";
217
+ queryString = `${queryString}${keyName}=${value}${separator}`;
218
+ }
219
+ return queryString;
220
+ }
221
+ /**
222
+ * Maps the resource data structures from snake case to camel keys.
223
+ * @param response - a HTTP response object with resource data.
224
+ * @returns a resource data with camel case keys.
225
+ */
226
+ getResource(response) {
227
+ const resource = {
228
+ httpStatusCode: response.status
229
+ };
230
+ resource.resource = mapping_1.default.camelCaseKeys(response.body);
231
+ return resource;
232
+ }
233
+ }
234
+ exports.default = AssociationsService;
235
+ AssociationsService.STATUS = "status";
236
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/associations/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA,oEAA4C;AAE5C;;GAEG;AACH,MAAqB,mBAAmB;IAGpC;;;OAGG;IACH,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAI,CAAC;IAEtD;;;;;;;;;OASG;IACU,sBAAsB,CAC/B,aAAqB,EACrB,cAAwB,EACxB,SAAkB,EAClB,YAAqB,EACrB,SAAkB,EAClB,MAAe;;YAEf,IAAI,WAAW,GAAW,EAAE,CAAC;YAC7B,IAAI,cAAc,IAAI,SAAS,IAAI,YAAY,IAAI,MAAM,EAAE;gBACvD,MAAM,eAAe,GAAoB;oBACrC,eAAe,EAAE,cAAc,IAAI,SAAS;oBAC5C,UAAU,EAAE,SAAS,IAAI,SAAS;oBAClC,cAAc,EAAE,YAAY,IAAI,SAAS;oBACzC,OAAO,EAAE,MAAM,IAAI,SAAS;iBAC/B,CAAC;gBACF,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;aACtD;YAED,IAAI,OAAgB,CAAC;YACrB,IAAI,SAAS,EAAE;gBACX,OAAO,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;aACvC;YAED,MAAM,GAAG,GAAG,2BAA2B,aAAa,GAAG,WAAW,EAAE,CAAC;YACrE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAA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BACxD,CAAC,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;gBAC5B,MAAM,SAAS,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzC,WAAW,GAAG,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,EAAE,CAAC;aAC7D;SACJ;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACK,kBAAkB,CAAK,OAAe,EAAE,MAAW;QACvD,IAAI,WAAW,GAAW,EAAE,CAAC;QAC7B,IAAI,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,OAAO,EAAE,CAAC;YACV,MAAM,SAAS,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,WAAW,GAAG,GAAG,WAAW,GAAG,OAAO,IAAI,KAAK,GAAG,SAAS,EAAE,CAAC;SACjE;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACK,WAAW,CAAE,QAAsB;QACvC,MAAM,QAAQ,GAAmC;YAC7C,cAAc,EAAE,QAAQ,CAAC,MAAM;SAClC,CAAC;QAEF,QAAQ,CAAC,QAAQ,GAAG,iBAAO,CAAC,aAAa,CAAuB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAE/E,OAAO,QAAQ,CAAC;IACpB,CAAC;;AAhQL,sCAiQC;AAhQ2B,0BAAM,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,188 @@
1
+ export interface InvitationResource {
2
+ invited_by: string;
3
+ invited_at: string;
4
+ association_id: string;
5
+ isActive: boolean;
6
+ }
7
+ export interface PreviousStateResource {
8
+ status: PreviousStateStatus;
9
+ changed_at: string;
10
+ changed_by: string;
11
+ }
12
+ export interface AssociationResource {
13
+ etag: string;
14
+ id: string;
15
+ user_id: string;
16
+ user_email: string;
17
+ display_name: string;
18
+ company_number: string;
19
+ company_name: string;
20
+ company_status: string;
21
+ status: AssociationStatus;
22
+ created_at: string;
23
+ approved_at: string;
24
+ removed_at: string;
25
+ unauthorised_at: string;
26
+ kind: string;
27
+ approval_route: ApprovalRoute;
28
+ approval_expiry_at: string;
29
+ links: {
30
+ self: string;
31
+ };
32
+ }
33
+ /**
34
+ * AssociationsResource is what is returned from the API with snake_case API fields
35
+ */
36
+ export interface AssociationListResource {
37
+ items: AssociationResource[];
38
+ links: {
39
+ self: string;
40
+ next: string;
41
+ };
42
+ items_per_page: number;
43
+ page_number: number;
44
+ total_results: number;
45
+ total_pages: number;
46
+ }
47
+ export interface InvitationListResource {
48
+ items: InvitationResource[];
49
+ links: {
50
+ self: string;
51
+ next: string;
52
+ };
53
+ items_per_page: number;
54
+ page_number: number;
55
+ total_results: number;
56
+ total_pages: number;
57
+ }
58
+ export interface PreviousStateListResource {
59
+ items: PreviousStateResource[];
60
+ links: {
61
+ self: string;
62
+ next: string;
63
+ };
64
+ items_per_page: number;
65
+ page_number: number;
66
+ total_results: number;
67
+ total_pages: number;
68
+ }
69
+ export interface ErrorResource {
70
+ error: string;
71
+ error_values: {
72
+ [key: string]: string;
73
+ };
74
+ location: string;
75
+ location_type: string;
76
+ type: string;
77
+ }
78
+ /**
79
+ * ErrorsResource is what is returned from the API with snake_case API fields
80
+ */
81
+ export interface ErrorsResource {
82
+ errors: ErrorResource[];
83
+ }
84
+ export declare enum AssociationStatus {
85
+ CONFIRMED = "confirmed",
86
+ REMOVED = "removed",
87
+ AWAITING_APPROVAL = "awaiting-approval",
88
+ MIGRATED = "migrated",
89
+ UNAUTHORISED = "unauthorised"
90
+ }
91
+ export declare enum ApprovalRoute {
92
+ AUTH_CODE = "auth_code",
93
+ INVITATION = "invitation"
94
+ }
95
+ export interface Invitation {
96
+ invitedBy: string;
97
+ invitedAt: string;
98
+ associationId: string;
99
+ isActive: boolean;
100
+ }
101
+ export interface Association {
102
+ etag: string;
103
+ id: string;
104
+ userId: string;
105
+ userEmail: string;
106
+ displayName: string;
107
+ companyNumber: string;
108
+ companyName: string;
109
+ companyStatus: string;
110
+ status: AssociationStatus;
111
+ createdAt: string;
112
+ approvedAt: string;
113
+ removedAt: string;
114
+ unauthorisedAt: string;
115
+ kind: string;
116
+ approvalRoute: ApprovalRoute;
117
+ approvalExpiryAt: string;
118
+ links: {
119
+ self: string;
120
+ };
121
+ }
122
+ export interface AssociationList {
123
+ items: Association[];
124
+ itemsPerPage: number;
125
+ pageNumber: number;
126
+ totalResults: number;
127
+ totalPages: number;
128
+ links: {
129
+ self: string;
130
+ next: string;
131
+ };
132
+ }
133
+ export interface InvitationList {
134
+ items: Invitation[];
135
+ itemsPerPage: number;
136
+ pageNumber: number;
137
+ totalResults: number;
138
+ totalPages: number;
139
+ links: {
140
+ self: string;
141
+ next: string;
142
+ };
143
+ }
144
+ export declare type PreviousStateStatus = "confirmed" | "awaiting-approval" | "removed" | "migrated";
145
+ export interface PreviousState {
146
+ status: PreviousStateStatus;
147
+ changedAt: string;
148
+ changedBy: string;
149
+ }
150
+ export interface PreviousStateList {
151
+ items: PreviousState[];
152
+ itemsPerPage: number;
153
+ pageNumber: number;
154
+ totalResults: number;
155
+ totalPages: number;
156
+ links: {
157
+ self: string;
158
+ next: string;
159
+ };
160
+ }
161
+ export interface Error {
162
+ error: string;
163
+ errorValues: {
164
+ [key: string]: string;
165
+ };
166
+ location: string;
167
+ locationType: string;
168
+ type: string;
169
+ }
170
+ export interface Errors {
171
+ errors: Error[];
172
+ }
173
+ export interface QueryParameters {
174
+ include_removed?: boolean;
175
+ page_index?: number;
176
+ items_per_page?: number;
177
+ status?: AssociationStatus[];
178
+ company_number?: string;
179
+ user_email?: string;
180
+ user_id?: string;
181
+ }
182
+ export interface NewAssociationResponseResource {
183
+ association_link: string;
184
+ }
185
+ export interface NewAssociationResponse {
186
+ associationLink: string;
187
+ }
188
+ export declare type AssociationsResponse = AssociationList | Association | NewAssociationResponse | Errors;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApprovalRoute = exports.AssociationStatus = void 0;
4
+ var AssociationStatus;
5
+ (function (AssociationStatus) {
6
+ AssociationStatus["CONFIRMED"] = "confirmed";
7
+ AssociationStatus["REMOVED"] = "removed";
8
+ AssociationStatus["AWAITING_APPROVAL"] = "awaiting-approval";
9
+ AssociationStatus["MIGRATED"] = "migrated";
10
+ AssociationStatus["UNAUTHORISED"] = "unauthorised";
11
+ })(AssociationStatus = exports.AssociationStatus || (exports.AssociationStatus = {}));
12
+ var ApprovalRoute;
13
+ (function (ApprovalRoute) {
14
+ ApprovalRoute["AUTH_CODE"] = "auth_code";
15
+ ApprovalRoute["INVITATION"] = "invitation";
16
+ })(ApprovalRoute = exports.ApprovalRoute || (exports.ApprovalRoute = {}));
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/associations/types.ts"],"names":[],"mappings":";;;AA2FA,IAAY,iBAMX;AAND,WAAY,iBAAiB;IACzB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,4DAAuC,CAAA;IACvC,0CAAqB,CAAA;IACrB,kDAA6B,CAAA;AACjC,CAAC,EANW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAM5B;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,0CAAyB,CAAA;AAC7B,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companieshouse/api-sdk-node",
3
- "version": "2.0.273",
3
+ "version": "2.0.274",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [