@companieshouse/api-sdk-node 2.0.34 → 2.0.36
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/services/order/checkout-item/service.d.ts +2 -2
- package/dist/services/order/checkout-item/service.js +9 -3
- package/dist/services/order/checkout-item/service.js.map +1 -1
- package/dist/services/order/order/service.d.ts +6 -2
- package/dist/services/order/order/service.js +1 -1
- package/dist/services/order/order/service.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IHttpClient } from "../../../http";
|
|
2
2
|
import { Result } from "../../../services/result";
|
|
3
|
-
import {
|
|
3
|
+
import { Checkout } from "../checkout";
|
|
4
4
|
export declare type CheckoutItemErrorResponse = {
|
|
5
5
|
httpStatusCode?: number;
|
|
6
6
|
error?: string;
|
|
@@ -9,5 +9,5 @@ export default class CheckoutItemService {
|
|
|
9
9
|
private readonly client;
|
|
10
10
|
private static readonly EXCLUDED_FIELDS;
|
|
11
11
|
constructor(client: IHttpClient);
|
|
12
|
-
getCheckoutItem(orderId: string, itemId: string): Promise<Result<
|
|
12
|
+
getCheckoutItem(orderId: string, itemId: string): Promise<Result<Checkout, CheckoutItemErrorResponse>>;
|
|
13
13
|
}
|
|
@@ -29,6 +29,12 @@ class CheckoutItemService {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
const body = resp.body;
|
|
32
|
+
if (body.items.length !== 1) {
|
|
33
|
+
return result_1.failure({
|
|
34
|
+
httpStatusCode: resp.status,
|
|
35
|
+
error: "Expected checkout returned by api to have exactly one embedded item."
|
|
36
|
+
});
|
|
37
|
+
}
|
|
32
38
|
const result = mapping_1.default.camelCaseKeys(body, CheckoutItemService.EXCLUDED_FIELDS);
|
|
33
39
|
return result_1.success(result);
|
|
34
40
|
});
|
|
@@ -38,9 +44,9 @@ exports.default = CheckoutItemService;
|
|
|
38
44
|
CheckoutItemService.EXCLUDED_FIELDS = {
|
|
39
45
|
deep: true,
|
|
40
46
|
stopPaths: [
|
|
41
|
-
"description_values",
|
|
42
|
-
"item_options.filing_history_description_values",
|
|
43
|
-
"item_options.filing_history_documents.filing_history_description_values" // certified copies
|
|
47
|
+
"items.description_values",
|
|
48
|
+
"items.item_options.filing_history_description_values",
|
|
49
|
+
"items.item_options.filing_history_documents.filing_history_description_values" // certified copies
|
|
44
50
|
]
|
|
45
51
|
};
|
|
46
52
|
//# sourceMappingURL=service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../src/services/order/checkout-item/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,qDAAoE;AACpE,uEAA+C;AAQ/C,MAAqB,mBAAmB;IAUpC,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAI,CAAC;IAEzC,eAAe,CAAE,OAAe,EAAE,MAAc;;;YACzD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,OAAO,UAAU,MAAM,EAAE,CAAC,CAAC;YAEhF,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,OAAO,gBAAO,CAAC;oBACX,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,KAAK,QAAE,IAAI,CAAC,KAAK,0CAAE,KAAK;iBAC3B,CAAC,CAAC;aACN;YAED,MAAM,IAAI,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../src/services/order/checkout-item/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,qDAAoE;AACpE,uEAA+C;AAQ/C,MAAqB,mBAAmB;IAUpC,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAI,CAAC;IAEzC,eAAe,CAAE,OAAe,EAAE,MAAc;;;YACzD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,OAAO,UAAU,MAAM,EAAE,CAAC,CAAC;YAEhF,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,OAAO,gBAAO,CAAC;oBACX,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,KAAK,QAAE,IAAI,CAAC,KAAK,0CAAE,KAAK;iBAC3B,CAAC,CAAC;aACN;YAED,MAAM,IAAI,GAAG,IAAI,CAAC,IAAwB,CAAC;YAE3C,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACzB,OAAO,gBAAO,CAAC;oBACX,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,KAAK,EAAE,sEAAsE;iBAChF,CAAC,CAAA;aACL;YAED,MAAM,MAAM,GAAa,iBAAO,CAAC,aAAa,CAAC,IAAI,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;YAE1F,OAAO,gBAAO,CAAC,MAAM,CAAC,CAAC;;KAC1B;;AAlCL,sCAmCC;AAlC2B,mCAAe,GAAG;IACtC,IAAI,EAAE,IAAI;IACV,SAAS,EAAE;QACP,0BAA0B;QAC1B,sDAAsD;QACtD,+EAA+E,CAAC,mBAAmB;KACtG;CACJ,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { IHttpClient } from "../../../http";
|
|
2
2
|
import { Order } from "./types";
|
|
3
|
-
import {
|
|
3
|
+
import { Result } from "../../../services/result";
|
|
4
|
+
export declare type OrderErrorResponse = {
|
|
5
|
+
httpStatusCode?: number;
|
|
6
|
+
error?: string;
|
|
7
|
+
};
|
|
4
8
|
export default class OrderService {
|
|
5
9
|
private readonly client;
|
|
6
10
|
private static readonly EXCLUDED_FIELDS;
|
|
7
11
|
constructor(client: IHttpClient);
|
|
8
|
-
getOrder(orderId: string): Promise<
|
|
12
|
+
getOrder(orderId: string): Promise<Result<Order, OrderErrorResponse>>;
|
|
9
13
|
}
|
|
@@ -25,7 +25,7 @@ class OrderService {
|
|
|
25
25
|
if (resp.error) {
|
|
26
26
|
return result_1.failure({
|
|
27
27
|
httpStatusCode: resp.status,
|
|
28
|
-
|
|
28
|
+
error: (_a = resp.error) === null || _a === void 0 ? void 0 : _a.error
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
const body = resp.body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../src/services/order/order/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../src/services/order/order/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,qDAAoE;AACpE,uEAA+C;AAO/C,MAAqB,YAAY;IAU7B,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAI,CAAC;IAEzC,QAAQ,CAAE,OAAe;;;YAClC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC;YAE7D,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,OAAO,gBAAO,CAAC;oBACX,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,KAAK,QAAE,IAAI,CAAC,KAAK,0CAAE,KAAK;iBAC3B,CAAC,CAAC;aACN;YAED,MAAM,IAAI,GAAG,IAAI,CAAC,IAAqB,CAAC;YAExC,MAAM,MAAM,GAAU,iBAAO,CAAC,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;YAChF,OAAO,gBAAO,CAAC,MAAM,CAAC,CAAC;;KAC1B;;AA1BL,+BA2BC;AA1B2B,4BAAe,GAAG;IACtC,IAAI,EAAE,IAAI;IACV,SAAS,EAAE;QACP,0BAA0B;QAC1B,sDAAsD;QACtD,+EAA+E,CAAC,mBAAmB;KACtG;CACJ,CAAC"}
|