@companieshouse/api-sdk-node 2.0.189 → 2.0.191

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, id: string): Promise<Resource<AcspData> | ApiErrorResponse>;
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(userId: string): Promise<HttpResponse>;
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 userId the id of the user whose application will be deleted
24
+ * @param acspApplicationId the id of the user whose application will be deleted
24
25
  */
25
- deleteSavedApplication(userId: string): Promise<HttpResponse>;
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, id) {
20
+ getAcsp(transactionId, acspApplicationId) {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
- const url = `/transactions/${transactionId}/acsp/${id}`;
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,7 +39,7 @@ 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}/acsp`;
42
+ const url = `/transactions/${transactionId}/authorised-corporate-service-provider-applications`;
43
43
  const resp = yield this.client.httpPost(url, acsp);
44
44
  if (resp.status >= 400) {
45
45
  return { httpStatusCode: resp.status, errors: [resp.error] };
@@ -53,11 +53,12 @@ class default_1 {
53
53
  /**
54
54
  * Put an ACSP object to update on the API.
55
55
  * @param transactionId transaction id associated with the data to be saved
56
+ * @param acspApplicationId acsp application id unique to the application
56
57
  * @param acsp the data to be saved
57
58
  */
58
- putACSP(transactionId, acsp) {
59
+ putACSP(transactionId, acspApplicationId, acsp) {
59
60
  return __awaiter(this, void 0, void 0, function* () {
60
- const url = `/transactions/${transactionId}/acsp`;
61
+ const url = `/transactions/${transactionId}/authorised-corporate-service-provider-applications/${acspApplicationId}`;
61
62
  const resp = yield this.client.httpPut(url, acsp);
62
63
  if (resp.status >= 400) {
63
64
  return { httpStatusCode: resp.status, errors: [resp.error] };
@@ -69,36 +70,24 @@ class default_1 {
69
70
  });
70
71
  }
71
72
  /* get saved application */
72
- getSavedApplication(userId) {
73
+ getSavedApplication(acspApplicationId) {
73
74
  return __awaiter(this, void 0, void 0, function* () {
74
- const url = `/acsp-api/user/${userId}/application`;
75
+ const url = `/acsp-api/user/${acspApplicationId}/application`;
75
76
  const resp = yield this.client.httpGet(url);
76
77
  return resp;
77
78
  });
78
79
  }
79
80
  /**
80
81
  * Delete an existing ACSP application from MongoDB
81
- * @param userId the id of the user whose application will be deleted
82
+ * @param acspApplicationId the id of the user whose application will be deleted
82
83
  */
83
- deleteSavedApplication(userId) {
84
+ deleteSavedApplication(acspApplicationId) {
84
85
  return __awaiter(this, void 0, void 0, function* () {
85
- const url = `/acsp-api/user/${userId}/application`;
86
+ const url = `/acsp-api/user/${acspApplicationId}/application`;
86
87
  const resp = yield this.client.httpDelete(url);
87
88
  return resp;
88
89
  });
89
90
  }
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
91
  }
103
92
  exports.default = default_1;
104
93
  //# 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,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,CA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IAAI,CAAC;QAChB,CAAC;KAAA;IAED;;;OAGG;IACU,sBAAsB,CAAE,iBAAyB;;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;AA9ED,4BA8EC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companieshouse/api-sdk-node",
3
- "version": "2.0.189",
3
+ "version": "2.0.191",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "analyse-code": "sonar-scanner"
20
20
  },
21
21
  "dependencies": {
22
- "axios": "^1.6.7",
22
+ "axios": "^1.7.4",
23
23
  "camelcase-keys": "~6.2.2",
24
24
  "http-status-codes": "^2.3.0",
25
25
  "snakecase-keys": "~3.2.0",