@lcdp/api-react-rest-client 3.1.7-LDS-5578-api-distinct-status-code-accodi.23847291272 → 3.1.7-develop.23855465779

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.
Files changed (188) hide show
  1. package/auth/src/models/RestError.d.ts +5 -3
  2. package/auth/src/models/RestError.js +5 -3
  3. package/auth/src/models/index.d.ts +0 -4
  4. package/auth/src/models/index.js +0 -4
  5. package/catalog/src/models/RestError.d.ts +5 -3
  6. package/catalog/src/models/RestError.js +5 -3
  7. package/chargebee-hook/src/models/RestError.d.ts +5 -3
  8. package/chargebee-hook/src/models/RestError.js +5 -3
  9. package/configuration/src/models/RestError.d.ts +5 -3
  10. package/configuration/src/models/RestError.js +5 -3
  11. package/content/src/models/RestError.d.ts +5 -3
  12. package/content/src/models/RestError.js +5 -3
  13. package/favorite/src/models/RestError.d.ts +5 -3
  14. package/favorite/src/models/RestError.js +5 -3
  15. package/inventory/src/models/RestError.d.ts +5 -3
  16. package/inventory/src/models/RestError.js +5 -3
  17. package/invoice/src/models/RestError.d.ts +5 -3
  18. package/invoice/src/models/RestError.js +5 -3
  19. package/laboratory-store/src/models/RestError.d.ts +5 -3
  20. package/laboratory-store/src/models/RestError.js +5 -3
  21. package/lexicon/src/models/RestError.d.ts +5 -3
  22. package/lexicon/src/models/RestError.js +5 -3
  23. package/litigation/src/models/RestError.d.ts +5 -3
  24. package/litigation/src/models/RestError.js +5 -3
  25. package/magic-cart/src/models/ExpressOrder.d.ts +3 -3
  26. package/magic-cart/src/models/ExpressOrder.js +3 -3
  27. package/magic-cart/src/models/SaleOfferProposal.d.ts +51 -0
  28. package/magic-cart/src/models/SaleOfferProposal.js +61 -0
  29. package/magic-cart/src/models/SellerProposal.d.ts +45 -0
  30. package/magic-cart/src/models/SellerProposal.js +57 -0
  31. package/magic-cart/src/models/index.d.ts +2 -1
  32. package/magic-cart/src/models/index.js +2 -1
  33. package/mangopay-hook/src/models/RestError.d.ts +5 -3
  34. package/mangopay-hook/src/models/RestError.js +5 -3
  35. package/notification/src/models/RestError.d.ts +5 -3
  36. package/notification/src/models/RestError.js +5 -3
  37. package/order/src/apis/ManageMetaOrderApi.d.ts +45 -0
  38. package/{shopping-cart/src/apis/SearchCartLineApi.js → order/src/apis/ManageMetaOrderApi.js} +41 -46
  39. package/order/src/apis/ManageOrderApi.d.ts +8 -8
  40. package/order/src/apis/ManageOrderApi.js +10 -9
  41. package/order/src/apis/index.d.ts +1 -2
  42. package/order/src/apis/index.js +1 -2
  43. package/order/src/models/AnyMetaOrderWarning.d.ts +26 -0
  44. package/order/src/models/AnyMetaOrderWarning.js +50 -0
  45. package/order/src/models/MetaOrder.d.ts +64 -0
  46. package/order/src/models/MetaOrder.js +70 -0
  47. package/order/src/models/MetaOrderCreationParameters.d.ts +38 -0
  48. package/order/src/models/MetaOrderCreationParameters.js +52 -0
  49. package/order/src/models/MetaOrderCreationSubCartParameters.d.ts +31 -0
  50. package/order/src/models/MetaOrderCreationSubCartParameters.js +47 -0
  51. package/order/src/models/MetaOrderPrices.d.ts +79 -0
  52. package/order/src/models/MetaOrderPrices.js +79 -0
  53. package/order/src/models/MetaOrderWarning.d.ts +31 -0
  54. package/order/src/models/MetaOrderWarning.js +47 -0
  55. package/order/src/models/MetaOrderWithWarnings.d.ts +39 -0
  56. package/order/src/models/MetaOrderWithWarnings.js +49 -0
  57. package/order/src/models/Order.d.ts +75 -80
  58. package/order/src/models/Order.js +48 -53
  59. package/order/src/models/OrderItemPrices.d.ts +3 -3
  60. package/order/src/models/{ForeorderItemWarning.d.ts → OrderItemWarning.d.ts} +18 -23
  61. package/order/src/models/{ForeorderItemWarning.js → OrderItemWarning.js} +15 -18
  62. package/order/src/models/OrderWarning.d.ts +51 -0
  63. package/order/src/models/{ForeorderWarning.js → OrderWarning.js} +12 -12
  64. package/order/src/models/RestError.d.ts +5 -3
  65. package/order/src/models/RestError.js +5 -3
  66. package/order/src/models/ShoppedOffer.d.ts +2 -2
  67. package/order/src/models/ShoppedOffer.js +2 -2
  68. package/order/src/models/index.d.ts +9 -17
  69. package/order/src/models/index.js +9 -17
  70. package/package.json +1 -1
  71. package/product/src/models/RestError.d.ts +5 -3
  72. package/product/src/models/RestError.js +5 -3
  73. package/pub/src/models/RestError.d.ts +5 -3
  74. package/pub/src/models/RestError.js +5 -3
  75. package/rfx/src/models/RestError.d.ts +5 -3
  76. package/rfx/src/models/RestError.js +5 -3
  77. package/sale-offer/src/models/RestError.d.ts +5 -3
  78. package/sale-offer/src/models/RestError.js +5 -3
  79. package/servant/src/models/RestError.d.ts +5 -3
  80. package/servant/src/models/RestError.js +5 -3
  81. package/shipment/src/models/RestError.d.ts +5 -3
  82. package/shipment/src/models/RestError.js +5 -3
  83. package/shopping-cart/src/apis/ManageCartApi.d.ts +24 -35
  84. package/shopping-cart/src/apis/ManageCartApi.js +120 -57
  85. package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +107 -0
  86. package/shopping-cart/src/apis/ManageCartSubCartApi.js +556 -0
  87. package/shopping-cart/src/apis/ManageCartSubCartLineApi.d.ts +151 -0
  88. package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +879 -0
  89. package/shopping-cart/src/apis/index.d.ts +2 -3
  90. package/shopping-cart/src/apis/index.js +2 -3
  91. package/shopping-cart/src/models/Cart.d.ts +4 -61
  92. package/shopping-cart/src/models/Cart.js +2 -47
  93. package/shopping-cart/src/models/CartSubCart.d.ts +76 -0
  94. package/shopping-cart/src/models/CartSubCart.js +78 -0
  95. package/shopping-cart/src/models/{CartLine.d.ts → CartSubCartLine.d.ts} +13 -13
  96. package/shopping-cart/src/models/{CartLine.js → CartSubCartLine.js} +11 -11
  97. package/shopping-cart/src/models/CartSubCartLineUpdateParameters.d.ts +37 -0
  98. package/shopping-cart/src/models/CartSubCartLineUpdateParameters.js +49 -0
  99. package/shopping-cart/src/models/{CartTransport.d.ts → CartSubCartTransport.d.ts} +12 -12
  100. package/shopping-cart/src/models/{CartTransport.js → CartSubCartTransport.js} +11 -11
  101. package/shopping-cart/src/models/RestError.d.ts +5 -3
  102. package/shopping-cart/src/models/RestError.js +5 -3
  103. package/shopping-cart/src/models/ShoppedOffer.d.ts +2 -2
  104. package/shopping-cart/src/models/ShoppedOffer.js +2 -2
  105. package/shopping-cart/src/models/index.d.ts +4 -12
  106. package/shopping-cart/src/models/index.js +4 -12
  107. package/smuggler/src/models/RestError.d.ts +5 -3
  108. package/smuggler/src/models/RestError.js +5 -3
  109. package/statistic/src/models/RestError.d.ts +5 -3
  110. package/statistic/src/models/RestError.js +5 -3
  111. package/third-party/src/models/RestError.d.ts +5 -3
  112. package/third-party/src/models/RestError.js +5 -3
  113. package/ubo/src/models/RestError.d.ts +5 -3
  114. package/ubo/src/models/RestError.js +5 -3
  115. package/user/src/models/RestError.d.ts +5 -3
  116. package/user/src/models/RestError.js +5 -3
  117. package/wish/src/models/RestError.d.ts +5 -3
  118. package/wish/src/models/RestError.js +5 -3
  119. package/auth/src/models/AnonymousUser.d.ts +0 -43
  120. package/auth/src/models/AnonymousUser.js +0 -55
  121. package/auth/src/models/AnyUser.d.ts +0 -26
  122. package/auth/src/models/AnyUser.js +0 -50
  123. package/auth/src/models/IdentifiedUser.d.ts +0 -37
  124. package/auth/src/models/IdentifiedUser.js +0 -51
  125. package/auth/src/models/User.d.ts +0 -31
  126. package/auth/src/models/User.js +0 -47
  127. package/magic-cart/src/models/ShoppedOffer.d.ts +0 -43
  128. package/magic-cart/src/models/ShoppedOffer.js +0 -53
  129. package/order/src/apis/ManageForeorderApi.d.ts +0 -31
  130. package/order/src/apis/ManageForeorderApi.js +0 -163
  131. package/order/src/apis/SearchForeorderItemApi.d.ts +0 -44
  132. package/order/src/apis/SearchForeorderItemApi.js +0 -175
  133. package/order/src/models/AnyForeorderCreationParameters.d.ts +0 -23
  134. package/order/src/models/AnyForeorderCreationParameters.js +0 -45
  135. package/order/src/models/AnyForeorderWarning.d.ts +0 -26
  136. package/order/src/models/AnyForeorderWarning.js +0 -50
  137. package/order/src/models/AnyOrderCreationParameters.d.ts +0 -26
  138. package/order/src/models/AnyOrderCreationParameters.js +0 -50
  139. package/order/src/models/AnySource.d.ts +0 -26
  140. package/order/src/models/AnySource.js +0 -50
  141. package/order/src/models/CartForeorderCreationParameters.d.ts +0 -37
  142. package/order/src/models/CartForeorderCreationParameters.js +0 -51
  143. package/order/src/models/CartSource.d.ts +0 -37
  144. package/order/src/models/CartSource.js +0 -49
  145. package/order/src/models/CloneOrderCreationParameters.d.ts +0 -37
  146. package/order/src/models/CloneOrderCreationParameters.js +0 -51
  147. package/order/src/models/Foreorder.d.ts +0 -155
  148. package/order/src/models/Foreorder.js +0 -128
  149. package/order/src/models/ForeorderCreationParameters.d.ts +0 -31
  150. package/order/src/models/ForeorderCreationParameters.js +0 -47
  151. package/order/src/models/ForeorderOrderCreationParameters.d.ts +0 -37
  152. package/order/src/models/ForeorderOrderCreationParameters.js +0 -51
  153. package/order/src/models/ForeorderWarning.d.ts +0 -51
  154. package/order/src/models/ForeorderWarningBase.d.ts +0 -37
  155. package/order/src/models/ForeorderWarningBase.js +0 -51
  156. package/order/src/models/ForeorderWithWarnings.d.ts +0 -39
  157. package/order/src/models/ForeorderWithWarnings.js +0 -53
  158. package/order/src/models/OrderCreationParameters.d.ts +0 -31
  159. package/order/src/models/OrderCreationParameters.js +0 -47
  160. package/order/src/models/OrderSource.d.ts +0 -37
  161. package/order/src/models/OrderSource.js +0 -49
  162. package/order/src/models/Source.d.ts +0 -31
  163. package/order/src/models/Source.js +0 -45
  164. package/shopping-cart/src/apis/ManageCartLineApi.d.ts +0 -45
  165. package/shopping-cart/src/apis/ManageCartLineApi.js +0 -238
  166. package/shopping-cart/src/apis/SearchCartApi.d.ts +0 -59
  167. package/shopping-cart/src/apis/SearchCartApi.js +0 -267
  168. package/shopping-cart/src/apis/SearchCartLineApi.d.ts +0 -41
  169. package/shopping-cart/src/models/CartCreationParameters.d.ts +0 -44
  170. package/shopping-cart/src/models/CartCreationParameters.js +0 -56
  171. package/shopping-cart/src/models/CartLineUpdateParameters.d.ts +0 -37
  172. package/shopping-cart/src/models/CartLineUpdateParameters.js +0 -49
  173. package/shopping-cart/src/models/CartLineWithWarnings.d.ts +0 -39
  174. package/shopping-cart/src/models/CartLineWithWarnings.js +0 -49
  175. package/shopping-cart/src/models/CartSummary.d.ts +0 -31
  176. package/shopping-cart/src/models/CartSummary.js +0 -47
  177. package/shopping-cart/src/models/CartUpdateParameters.d.ts +0 -31
  178. package/shopping-cart/src/models/CartUpdateParameters.js +0 -45
  179. package/shopping-cart/src/models/CartWarning.d.ts +0 -70
  180. package/shopping-cart/src/models/CartWarning.js +0 -67
  181. package/shopping-cart/src/models/CartsWithWarnings.d.ts +0 -39
  182. package/shopping-cart/src/models/CartsWithWarnings.js +0 -49
  183. package/shopping-cart/src/models/OwnerLink.d.ts +0 -43
  184. package/shopping-cart/src/models/OwnerLink.js +0 -53
  185. package/shopping-cart/src/models/PaginatedCarts.d.ts +0 -46
  186. package/shopping-cart/src/models/PaginatedCarts.js +0 -58
  187. package/shopping-cart/src/models/PagingMetadata.d.ts +0 -49
  188. package/shopping-cart/src/models/PagingMetadata.js +0 -55
@@ -0,0 +1,107 @@
1
+ /**
2
+ * lcdp-monolith-service
3
+ * This is the REST API of LCDP products
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: contact@lecomptoirdespharmacies.fr
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { CartSubCart } from '../models/index';
14
+ export interface DeleteCartSubCartRequest {
15
+ cartId: number;
16
+ subCartId: number;
17
+ }
18
+ export interface DeleteCurrentCartSubCartRequest {
19
+ subCartId: number;
20
+ }
21
+ export interface GetCartSubCartRequest {
22
+ cartId: number;
23
+ subCartId: number;
24
+ }
25
+ export interface GetCartSubCartsRequest {
26
+ cartId: number;
27
+ orderBy?: GetCartSubCartsOrderByEnum;
28
+ }
29
+ export interface GetCurrentCartSubCartRequest {
30
+ subCartId: number;
31
+ }
32
+ export interface GetCurrentCartSubCartsRequest {
33
+ orderBy?: GetCurrentCartSubCartsOrderByEnum;
34
+ }
35
+ /**
36
+ *
37
+ */
38
+ export declare class ManageCartSubCartApi extends runtime.BaseAPI {
39
+ /**
40
+ * Delete a SubCart for user cart
41
+ */
42
+ deleteCartSubCartRaw(requestParameters: DeleteCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
43
+ /**
44
+ * Delete a SubCart for user cart
45
+ */
46
+ deleteCartSubCart(requestParameters: DeleteCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
47
+ /**
48
+ * Delete a SubCart for user cart
49
+ */
50
+ deleteCurrentCartSubCartRaw(requestParameters: DeleteCurrentCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
51
+ /**
52
+ * Delete a SubCart for user cart
53
+ */
54
+ deleteCurrentCartSubCart(requestParameters: DeleteCurrentCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
55
+ /**
56
+ * Get user sub cart for a specific SubCart
57
+ */
58
+ getCartSubCartRaw(requestParameters: GetCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CartSubCart | runtime.BlobWithMeta>>;
59
+ /**
60
+ * Get user sub cart for a specific SubCart
61
+ */
62
+ getCartSubCart(requestParameters: GetCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CartSubCart | runtime.BlobWithMeta>;
63
+ /**
64
+ * Get user cart split by SubCart
65
+ */
66
+ getCartSubCartsRaw(requestParameters: GetCartSubCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CartSubCart> | runtime.BlobWithMeta>>;
67
+ /**
68
+ * Get user cart split by SubCart
69
+ */
70
+ getCartSubCarts(requestParameters: GetCartSubCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CartSubCart> | runtime.BlobWithMeta>;
71
+ /**
72
+ * Get user sub cart for a specific SubCart
73
+ */
74
+ getCurrentCartSubCartRaw(requestParameters: GetCurrentCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CartSubCart | runtime.BlobWithMeta>>;
75
+ /**
76
+ * Get user sub cart for a specific SubCart
77
+ */
78
+ getCurrentCartSubCart(requestParameters: GetCurrentCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CartSubCart | runtime.BlobWithMeta>;
79
+ /**
80
+ * Get user cart split by SubCart
81
+ */
82
+ getCurrentCartSubCartsRaw(requestParameters: GetCurrentCartSubCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CartSubCart> | runtime.BlobWithMeta>>;
83
+ /**
84
+ * Get user cart split by SubCart
85
+ */
86
+ getCurrentCartSubCarts(requestParameters?: GetCurrentCartSubCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CartSubCart> | runtime.BlobWithMeta>;
87
+ }
88
+ /**
89
+ * @export
90
+ */
91
+ export declare const GetCartSubCartsOrderByEnum: {
92
+ readonly UPDATED_AT_ASC: "UPDATED_AT:asc";
93
+ readonly UPDATED_AT_DESC: "UPDATED_AT:desc";
94
+ readonly TOTAL_EXCLUDING_TAXES_ASC: "TOTAL_EXCLUDING_TAXES:asc";
95
+ readonly TOTAL_EXCLUDING_TAXES_DESC: "TOTAL_EXCLUDING_TAXES:desc";
96
+ };
97
+ export declare type GetCartSubCartsOrderByEnum = typeof GetCartSubCartsOrderByEnum[keyof typeof GetCartSubCartsOrderByEnum];
98
+ /**
99
+ * @export
100
+ */
101
+ export declare const GetCurrentCartSubCartsOrderByEnum: {
102
+ readonly UPDATED_AT_ASC: "UPDATED_AT:asc";
103
+ readonly UPDATED_AT_DESC: "UPDATED_AT:desc";
104
+ readonly TOTAL_EXCLUDING_TAXES_ASC: "TOTAL_EXCLUDING_TAXES:asc";
105
+ readonly TOTAL_EXCLUDING_TAXES_DESC: "TOTAL_EXCLUDING_TAXES:desc";
106
+ };
107
+ export declare type GetCurrentCartSubCartsOrderByEnum = typeof GetCurrentCartSubCartsOrderByEnum[keyof typeof GetCurrentCartSubCartsOrderByEnum];
@@ -0,0 +1,556 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * lcdp-monolith-service
6
+ * This is the REST API of LCDP products
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: contact@lecomptoirdespharmacies.fr
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
41
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (_) try {
46
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.GetCurrentCartSubCartsOrderByEnum = exports.GetCartSubCartsOrderByEnum = exports.ManageCartSubCartApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var ManageCartSubCartApi = /** @class */ (function (_super) {
74
+ __extends(ManageCartSubCartApi, _super);
75
+ function ManageCartSubCartApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Delete a SubCart for user cart
80
+ */
81
+ ManageCartSubCartApi.prototype.deleteCartSubCartRaw = function (requestParameters, initOverrides) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_1;
84
+ return __generator(this, function (_c) {
85
+ switch (_c.label) {
86
+ case 0:
87
+ if (requestParameters['cartId'] == null) {
88
+ throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling deleteCartSubCart().');
89
+ }
90
+ if (requestParameters['subCartId'] == null) {
91
+ throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling deleteCartSubCart().');
92
+ }
93
+ queryParameters = {};
94
+ headerParameters = {};
95
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
96
+ _a = headerParameters;
97
+ _b = "x-api-key";
98
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
99
+ case 1:
100
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
101
+ _c.label = 2;
102
+ case 2:
103
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
104
+ token = this.configuration.accessToken;
105
+ return [4 /*yield*/, token("bearerAuth", [])];
106
+ case 3:
107
+ tokenString = _c.sent();
108
+ if (tokenString) {
109
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
110
+ }
111
+ _c.label = 4;
112
+ case 4:
113
+ _c.trys.push([4, 6, , 7]);
114
+ return [4 /*yield*/, this.request({
115
+ path: "/carts/{cartId}/sub-carts/{subCartId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
116
+ method: 'DELETE',
117
+ headers: headerParameters,
118
+ query: queryParameters,
119
+ }, initOverrides)];
120
+ case 5:
121
+ response = _c.sent();
122
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
123
+ case 6:
124
+ response_1 = _c.sent();
125
+ console.debug(response_1);
126
+ throw response_1;
127
+ case 7: return [2 /*return*/];
128
+ }
129
+ });
130
+ });
131
+ };
132
+ /**
133
+ * Delete a SubCart for user cart
134
+ */
135
+ ManageCartSubCartApi.prototype.deleteCartSubCart = function (requestParameters, initOverrides) {
136
+ return __awaiter(this, void 0, void 0, function () {
137
+ return __generator(this, function (_a) {
138
+ switch (_a.label) {
139
+ case 0: return [4 /*yield*/, this.deleteCartSubCartRaw(requestParameters, initOverrides)];
140
+ case 1:
141
+ _a.sent();
142
+ return [2 /*return*/];
143
+ }
144
+ });
145
+ });
146
+ };
147
+ /**
148
+ * Delete a SubCart for user cart
149
+ */
150
+ ManageCartSubCartApi.prototype.deleteCurrentCartSubCartRaw = function (requestParameters, initOverrides) {
151
+ return __awaiter(this, void 0, void 0, function () {
152
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_2;
153
+ return __generator(this, function (_c) {
154
+ switch (_c.label) {
155
+ case 0:
156
+ if (requestParameters['subCartId'] == null) {
157
+ throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling deleteCurrentCartSubCart().');
158
+ }
159
+ queryParameters = {};
160
+ headerParameters = {};
161
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
162
+ _a = headerParameters;
163
+ _b = "x-api-key";
164
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
165
+ case 1:
166
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
167
+ _c.label = 2;
168
+ case 2:
169
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
170
+ token = this.configuration.accessToken;
171
+ return [4 /*yield*/, token("bearerAuth", [])];
172
+ case 3:
173
+ tokenString = _c.sent();
174
+ if (tokenString) {
175
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
176
+ }
177
+ _c.label = 4;
178
+ case 4:
179
+ _c.trys.push([4, 6, , 7]);
180
+ return [4 /*yield*/, this.request({
181
+ path: "/carts/me/sub-carts/{subCartId}".replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
182
+ method: 'DELETE',
183
+ headers: headerParameters,
184
+ query: queryParameters,
185
+ }, initOverrides)];
186
+ case 5:
187
+ response = _c.sent();
188
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
189
+ case 6:
190
+ response_2 = _c.sent();
191
+ console.debug(response_2);
192
+ throw response_2;
193
+ case 7: return [2 /*return*/];
194
+ }
195
+ });
196
+ });
197
+ };
198
+ /**
199
+ * Delete a SubCart for user cart
200
+ */
201
+ ManageCartSubCartApi.prototype.deleteCurrentCartSubCart = function (requestParameters, initOverrides) {
202
+ return __awaiter(this, void 0, void 0, function () {
203
+ return __generator(this, function (_a) {
204
+ switch (_a.label) {
205
+ case 0: return [4 /*yield*/, this.deleteCurrentCartSubCartRaw(requestParameters, initOverrides)];
206
+ case 1:
207
+ _a.sent();
208
+ return [2 /*return*/];
209
+ }
210
+ });
211
+ });
212
+ };
213
+ /**
214
+ * Get user sub cart for a specific SubCart
215
+ */
216
+ ManageCartSubCartApi.prototype.getCartSubCartRaw = function (requestParameters, initOverrides) {
217
+ return __awaiter(this, void 0, void 0, function () {
218
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_3;
219
+ return __generator(this, function (_c) {
220
+ switch (_c.label) {
221
+ case 0:
222
+ if (requestParameters['cartId'] == null) {
223
+ throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCartSubCart().');
224
+ }
225
+ if (requestParameters['subCartId'] == null) {
226
+ throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling getCartSubCart().');
227
+ }
228
+ queryParameters = {};
229
+ headerParameters = {};
230
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
231
+ _a = headerParameters;
232
+ _b = "x-api-key";
233
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
234
+ case 1:
235
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
236
+ _c.label = 2;
237
+ case 2:
238
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
239
+ token = this.configuration.accessToken;
240
+ return [4 /*yield*/, token("bearerAuth", [])];
241
+ case 3:
242
+ tokenString = _c.sent();
243
+ if (tokenString) {
244
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
245
+ }
246
+ _c.label = 4;
247
+ case 4:
248
+ _c.trys.push([4, 6, , 7]);
249
+ return [4 /*yield*/, this.request({
250
+ path: "/carts/{cartId}/sub-carts/{subCartId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
251
+ method: 'GET',
252
+ headers: headerParameters,
253
+ query: queryParameters,
254
+ }, initOverrides)];
255
+ case 5:
256
+ response = _c.sent();
257
+ contentType = response.headers.get("content-type");
258
+ if (contentType && contentType.indexOf("application/json") !== -1) {
259
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartSubCartFromJSON)(jsonValue); })];
260
+ }
261
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
262
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
263
+ }
264
+ else {
265
+ // TODO : Better handling of others application types
266
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
267
+ }
268
+ return [3 /*break*/, 7];
269
+ case 6:
270
+ response_3 = _c.sent();
271
+ console.debug(response_3);
272
+ throw response_3;
273
+ case 7: return [2 /*return*/];
274
+ }
275
+ });
276
+ });
277
+ };
278
+ /**
279
+ * Get user sub cart for a specific SubCart
280
+ */
281
+ ManageCartSubCartApi.prototype.getCartSubCart = function (requestParameters, initOverrides) {
282
+ return __awaiter(this, void 0, void 0, function () {
283
+ var response;
284
+ return __generator(this, function (_a) {
285
+ switch (_a.label) {
286
+ case 0: return [4 /*yield*/, this.getCartSubCartRaw(requestParameters, initOverrides)];
287
+ case 1:
288
+ response = _a.sent();
289
+ return [4 /*yield*/, response.value()];
290
+ case 2: return [2 /*return*/, _a.sent()];
291
+ }
292
+ });
293
+ });
294
+ };
295
+ /**
296
+ * Get user cart split by SubCart
297
+ */
298
+ ManageCartSubCartApi.prototype.getCartSubCartsRaw = function (requestParameters, initOverrides) {
299
+ return __awaiter(this, void 0, void 0, function () {
300
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_4;
301
+ return __generator(this, function (_c) {
302
+ switch (_c.label) {
303
+ case 0:
304
+ if (requestParameters['cartId'] == null) {
305
+ throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCartSubCarts().');
306
+ }
307
+ queryParameters = {};
308
+ if (requestParameters['orderBy'] != null) {
309
+ queryParameters['orderBy'] = requestParameters['orderBy'];
310
+ }
311
+ headerParameters = {};
312
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
313
+ _a = headerParameters;
314
+ _b = "x-api-key";
315
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
316
+ case 1:
317
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
318
+ _c.label = 2;
319
+ case 2:
320
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
321
+ token = this.configuration.accessToken;
322
+ return [4 /*yield*/, token("bearerAuth", [])];
323
+ case 3:
324
+ tokenString = _c.sent();
325
+ if (tokenString) {
326
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
327
+ }
328
+ _c.label = 4;
329
+ case 4:
330
+ _c.trys.push([4, 6, , 7]);
331
+ return [4 /*yield*/, this.request({
332
+ path: "/carts/{cartId}/sub-carts".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))),
333
+ method: 'GET',
334
+ headers: headerParameters,
335
+ query: queryParameters,
336
+ }, initOverrides)];
337
+ case 5:
338
+ response = _c.sent();
339
+ contentType = response.headers.get("content-type");
340
+ if (contentType && contentType.indexOf("application/json") !== -1) {
341
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.CartSubCartFromJSON); })];
342
+ }
343
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
344
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
345
+ }
346
+ else {
347
+ // TODO : Better handling of others application types
348
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
349
+ }
350
+ return [3 /*break*/, 7];
351
+ case 6:
352
+ response_4 = _c.sent();
353
+ console.debug(response_4);
354
+ throw response_4;
355
+ case 7: return [2 /*return*/];
356
+ }
357
+ });
358
+ });
359
+ };
360
+ /**
361
+ * Get user cart split by SubCart
362
+ */
363
+ ManageCartSubCartApi.prototype.getCartSubCarts = function (requestParameters, initOverrides) {
364
+ return __awaiter(this, void 0, void 0, function () {
365
+ var response;
366
+ return __generator(this, function (_a) {
367
+ switch (_a.label) {
368
+ case 0: return [4 /*yield*/, this.getCartSubCartsRaw(requestParameters, initOverrides)];
369
+ case 1:
370
+ response = _a.sent();
371
+ return [4 /*yield*/, response.value()];
372
+ case 2: return [2 /*return*/, _a.sent()];
373
+ }
374
+ });
375
+ });
376
+ };
377
+ /**
378
+ * Get user sub cart for a specific SubCart
379
+ */
380
+ ManageCartSubCartApi.prototype.getCurrentCartSubCartRaw = function (requestParameters, initOverrides) {
381
+ return __awaiter(this, void 0, void 0, function () {
382
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_5;
383
+ return __generator(this, function (_c) {
384
+ switch (_c.label) {
385
+ case 0:
386
+ if (requestParameters['subCartId'] == null) {
387
+ throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling getCurrentCartSubCart().');
388
+ }
389
+ queryParameters = {};
390
+ headerParameters = {};
391
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
392
+ _a = headerParameters;
393
+ _b = "x-api-key";
394
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
395
+ case 1:
396
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
397
+ _c.label = 2;
398
+ case 2:
399
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
400
+ token = this.configuration.accessToken;
401
+ return [4 /*yield*/, token("bearerAuth", [])];
402
+ case 3:
403
+ tokenString = _c.sent();
404
+ if (tokenString) {
405
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
406
+ }
407
+ _c.label = 4;
408
+ case 4:
409
+ _c.trys.push([4, 6, , 7]);
410
+ return [4 /*yield*/, this.request({
411
+ path: "/carts/me/sub-carts/{subCartId}".replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
412
+ method: 'GET',
413
+ headers: headerParameters,
414
+ query: queryParameters,
415
+ }, initOverrides)];
416
+ case 5:
417
+ response = _c.sent();
418
+ contentType = response.headers.get("content-type");
419
+ if (contentType && contentType.indexOf("application/json") !== -1) {
420
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartSubCartFromJSON)(jsonValue); })];
421
+ }
422
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
423
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
424
+ }
425
+ else {
426
+ // TODO : Better handling of others application types
427
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
428
+ }
429
+ return [3 /*break*/, 7];
430
+ case 6:
431
+ response_5 = _c.sent();
432
+ console.debug(response_5);
433
+ throw response_5;
434
+ case 7: return [2 /*return*/];
435
+ }
436
+ });
437
+ });
438
+ };
439
+ /**
440
+ * Get user sub cart for a specific SubCart
441
+ */
442
+ ManageCartSubCartApi.prototype.getCurrentCartSubCart = function (requestParameters, initOverrides) {
443
+ return __awaiter(this, void 0, void 0, function () {
444
+ var response;
445
+ return __generator(this, function (_a) {
446
+ switch (_a.label) {
447
+ case 0: return [4 /*yield*/, this.getCurrentCartSubCartRaw(requestParameters, initOverrides)];
448
+ case 1:
449
+ response = _a.sent();
450
+ return [4 /*yield*/, response.value()];
451
+ case 2: return [2 /*return*/, _a.sent()];
452
+ }
453
+ });
454
+ });
455
+ };
456
+ /**
457
+ * Get user cart split by SubCart
458
+ */
459
+ ManageCartSubCartApi.prototype.getCurrentCartSubCartsRaw = function (requestParameters, initOverrides) {
460
+ return __awaiter(this, void 0, void 0, function () {
461
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_6;
462
+ return __generator(this, function (_c) {
463
+ switch (_c.label) {
464
+ case 0:
465
+ queryParameters = {};
466
+ if (requestParameters['orderBy'] != null) {
467
+ queryParameters['orderBy'] = requestParameters['orderBy'];
468
+ }
469
+ headerParameters = {};
470
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
471
+ _a = headerParameters;
472
+ _b = "x-api-key";
473
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
474
+ case 1:
475
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
476
+ _c.label = 2;
477
+ case 2:
478
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
479
+ token = this.configuration.accessToken;
480
+ return [4 /*yield*/, token("bearerAuth", [])];
481
+ case 3:
482
+ tokenString = _c.sent();
483
+ if (tokenString) {
484
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
485
+ }
486
+ _c.label = 4;
487
+ case 4:
488
+ _c.trys.push([4, 6, , 7]);
489
+ return [4 /*yield*/, this.request({
490
+ path: "/carts/me/sub-carts",
491
+ method: 'GET',
492
+ headers: headerParameters,
493
+ query: queryParameters,
494
+ }, initOverrides)];
495
+ case 5:
496
+ response = _c.sent();
497
+ contentType = response.headers.get("content-type");
498
+ if (contentType && contentType.indexOf("application/json") !== -1) {
499
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.CartSubCartFromJSON); })];
500
+ }
501
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
502
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
503
+ }
504
+ else {
505
+ // TODO : Better handling of others application types
506
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
507
+ }
508
+ return [3 /*break*/, 7];
509
+ case 6:
510
+ response_6 = _c.sent();
511
+ console.debug(response_6);
512
+ throw response_6;
513
+ case 7: return [2 /*return*/];
514
+ }
515
+ });
516
+ });
517
+ };
518
+ /**
519
+ * Get user cart split by SubCart
520
+ */
521
+ ManageCartSubCartApi.prototype.getCurrentCartSubCarts = function (requestParameters, initOverrides) {
522
+ if (requestParameters === void 0) { requestParameters = {}; }
523
+ return __awaiter(this, void 0, void 0, function () {
524
+ var response;
525
+ return __generator(this, function (_a) {
526
+ switch (_a.label) {
527
+ case 0: return [4 /*yield*/, this.getCurrentCartSubCartsRaw(requestParameters, initOverrides)];
528
+ case 1:
529
+ response = _a.sent();
530
+ return [4 /*yield*/, response.value()];
531
+ case 2: return [2 /*return*/, _a.sent()];
532
+ }
533
+ });
534
+ });
535
+ };
536
+ return ManageCartSubCartApi;
537
+ }(runtime.BaseAPI));
538
+ exports.ManageCartSubCartApi = ManageCartSubCartApi;
539
+ /**
540
+ * @export
541
+ */
542
+ exports.GetCartSubCartsOrderByEnum = {
543
+ UPDATED_AT_ASC: 'UPDATED_AT:asc',
544
+ UPDATED_AT_DESC: 'UPDATED_AT:desc',
545
+ TOTAL_EXCLUDING_TAXES_ASC: 'TOTAL_EXCLUDING_TAXES:asc',
546
+ TOTAL_EXCLUDING_TAXES_DESC: 'TOTAL_EXCLUDING_TAXES:desc'
547
+ };
548
+ /**
549
+ * @export
550
+ */
551
+ exports.GetCurrentCartSubCartsOrderByEnum = {
552
+ UPDATED_AT_ASC: 'UPDATED_AT:asc',
553
+ UPDATED_AT_DESC: 'UPDATED_AT:desc',
554
+ TOTAL_EXCLUDING_TAXES_ASC: 'TOTAL_EXCLUDING_TAXES:asc',
555
+ TOTAL_EXCLUDING_TAXES_DESC: 'TOTAL_EXCLUDING_TAXES:desc'
556
+ };