@lcdp/api-react-rest-client 3.1.6-develop.23737431721 → 3.1.7-LDS-5436-api-modifications-routes-et-sch.23749912028

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 (178) hide show
  1. package/auth/src/models/RestError.d.ts +3 -5
  2. package/auth/src/models/RestError.js +3 -5
  3. package/catalog/src/models/RestError.d.ts +3 -5
  4. package/catalog/src/models/RestError.js +3 -5
  5. package/chargebee-hook/src/models/RestError.d.ts +3 -5
  6. package/chargebee-hook/src/models/RestError.js +3 -5
  7. package/configuration/src/models/RestError.d.ts +3 -5
  8. package/configuration/src/models/RestError.js +3 -5
  9. package/content/src/models/RestError.d.ts +3 -5
  10. package/content/src/models/RestError.js +3 -5
  11. package/favorite/src/models/RestError.d.ts +3 -5
  12. package/favorite/src/models/RestError.js +3 -5
  13. package/inventory/src/models/RestError.d.ts +3 -5
  14. package/inventory/src/models/RestError.js +3 -5
  15. package/invoice/src/models/RestError.d.ts +3 -5
  16. package/invoice/src/models/RestError.js +3 -5
  17. package/laboratory-store/src/models/RestError.d.ts +3 -5
  18. package/laboratory-store/src/models/RestError.js +3 -5
  19. package/lexicon/src/models/RestError.d.ts +3 -5
  20. package/lexicon/src/models/RestError.js +3 -5
  21. package/litigation/src/models/RestError.d.ts +3 -5
  22. package/litigation/src/models/RestError.js +3 -5
  23. package/magic-cart/src/models/ExpressOrder.d.ts +3 -3
  24. package/magic-cart/src/models/ExpressOrder.js +3 -3
  25. package/magic-cart/src/models/ShoppedOffer.d.ts +43 -0
  26. package/magic-cart/src/models/ShoppedOffer.js +53 -0
  27. package/magic-cart/src/models/index.d.ts +1 -2
  28. package/magic-cart/src/models/index.js +1 -2
  29. package/mangopay-hook/src/models/RestError.d.ts +3 -5
  30. package/mangopay-hook/src/models/RestError.js +3 -5
  31. package/notification/src/models/RestError.d.ts +3 -5
  32. package/notification/src/models/RestError.js +3 -5
  33. package/order/src/apis/ManageForeorderApi.d.ts +31 -0
  34. package/order/src/apis/ManageForeorderApi.js +163 -0
  35. package/order/src/apis/ManageOrderApi.d.ts +8 -8
  36. package/order/src/apis/ManageOrderApi.js +9 -10
  37. package/order/src/apis/SearchForeorderItemApi.d.ts +44 -0
  38. package/order/src/apis/SearchForeorderItemApi.js +175 -0
  39. package/order/src/apis/index.d.ts +2 -1
  40. package/order/src/apis/index.js +2 -1
  41. package/order/src/models/AnyForeorderCreationParameters.d.ts +23 -0
  42. package/order/src/models/AnyForeorderCreationParameters.js +45 -0
  43. package/order/src/models/AnyForeorderWarning.d.ts +26 -0
  44. package/order/src/models/AnyForeorderWarning.js +50 -0
  45. package/order/src/models/AnyOrderCreationParameters.d.ts +26 -0
  46. package/order/src/models/AnyOrderCreationParameters.js +50 -0
  47. package/order/src/models/AnySource.d.ts +26 -0
  48. package/order/src/models/AnySource.js +50 -0
  49. package/order/src/models/CartForeorderCreationParameters.d.ts +37 -0
  50. package/order/src/models/CartForeorderCreationParameters.js +51 -0
  51. package/order/src/models/CartSource.d.ts +37 -0
  52. package/order/src/models/CartSource.js +49 -0
  53. package/order/src/models/CloneOrderCreationParameters.d.ts +37 -0
  54. package/order/src/models/CloneOrderCreationParameters.js +51 -0
  55. package/order/src/models/Foreorder.d.ts +155 -0
  56. package/order/src/models/Foreorder.js +128 -0
  57. package/order/src/models/ForeorderCreationParameters.d.ts +31 -0
  58. package/order/src/models/ForeorderCreationParameters.js +47 -0
  59. package/order/src/models/ForeorderCreationResponse.d.ts +39 -0
  60. package/order/src/models/ForeorderCreationResponse.js +53 -0
  61. package/order/src/models/{OrderItemWarning.d.ts → ForeorderItemWarning.d.ts} +23 -18
  62. package/order/src/models/{OrderItemWarning.js → ForeorderItemWarning.js} +18 -15
  63. package/order/src/models/ForeorderOrderCreationParameters.d.ts +37 -0
  64. package/order/src/models/ForeorderOrderCreationParameters.js +51 -0
  65. package/order/src/models/ForeorderWarning.d.ts +51 -0
  66. package/order/src/models/{OrderWarning.js → ForeorderWarning.js} +12 -12
  67. package/order/src/models/ForeorderWarningBase.d.ts +37 -0
  68. package/order/src/models/ForeorderWarningBase.js +51 -0
  69. package/order/src/models/Order.d.ts +80 -75
  70. package/order/src/models/Order.js +53 -48
  71. package/order/src/models/OrderCreationParameters.d.ts +31 -0
  72. package/order/src/models/OrderCreationParameters.js +47 -0
  73. package/order/src/models/OrderItemPrices.d.ts +3 -3
  74. package/order/src/models/OrderSource.d.ts +37 -0
  75. package/order/src/models/OrderSource.js +49 -0
  76. package/order/src/models/RestError.d.ts +3 -5
  77. package/order/src/models/RestError.js +3 -5
  78. package/order/src/models/ShoppedOffer.d.ts +2 -2
  79. package/order/src/models/ShoppedOffer.js +2 -2
  80. package/order/src/models/Source.d.ts +31 -0
  81. package/order/src/models/Source.js +45 -0
  82. package/order/src/models/index.d.ts +17 -9
  83. package/order/src/models/index.js +17 -9
  84. package/package.json +1 -1
  85. package/product/src/models/RestError.d.ts +3 -5
  86. package/product/src/models/RestError.js +3 -5
  87. package/pub/src/models/RestError.d.ts +3 -5
  88. package/pub/src/models/RestError.js +3 -5
  89. package/rfx/src/models/RestError.d.ts +3 -5
  90. package/rfx/src/models/RestError.js +3 -5
  91. package/sale-offer/src/models/RestError.d.ts +3 -5
  92. package/sale-offer/src/models/RestError.js +3 -5
  93. package/servant/src/models/RestError.d.ts +3 -5
  94. package/servant/src/models/RestError.js +3 -5
  95. package/shipment/src/models/RestError.d.ts +3 -5
  96. package/shipment/src/models/RestError.js +3 -5
  97. package/shopping-cart/src/apis/ManageCartApi.d.ts +35 -24
  98. package/shopping-cart/src/apis/ManageCartApi.js +57 -120
  99. package/shopping-cart/src/apis/ManageCartLineApi.d.ts +45 -0
  100. package/shopping-cart/src/apis/ManageCartLineApi.js +238 -0
  101. package/shopping-cart/src/apis/SearchCartApi.d.ts +59 -0
  102. package/shopping-cart/src/apis/SearchCartApi.js +267 -0
  103. package/shopping-cart/src/apis/SearchCartLineApi.d.ts +41 -0
  104. package/{order/src/apis/ManageMetaOrderApi.js → shopping-cart/src/apis/SearchCartLineApi.js} +46 -41
  105. package/shopping-cart/src/apis/index.d.ts +3 -2
  106. package/shopping-cart/src/apis/index.js +3 -2
  107. package/shopping-cart/src/models/Cart.d.ts +61 -4
  108. package/shopping-cart/src/models/Cart.js +47 -2
  109. package/shopping-cart/src/models/CartCreationParameters.d.ts +44 -0
  110. package/shopping-cart/src/models/CartCreationParameters.js +56 -0
  111. package/shopping-cart/src/models/{CartSubCartLine.d.ts → CartLine.d.ts} +13 -13
  112. package/shopping-cart/src/models/{CartSubCartLine.js → CartLine.js} +11 -11
  113. package/shopping-cart/src/models/CartLineUpdateParameters.d.ts +37 -0
  114. package/shopping-cart/src/models/CartLineUpdateParameters.js +49 -0
  115. package/shopping-cart/src/models/CartLineWithWarnings.d.ts +39 -0
  116. package/shopping-cart/src/models/CartLineWithWarnings.js +49 -0
  117. package/shopping-cart/src/models/CartSummary.d.ts +31 -0
  118. package/shopping-cart/src/models/CartSummary.js +47 -0
  119. package/shopping-cart/src/models/{CartSubCartTransport.d.ts → CartTransport.d.ts} +12 -12
  120. package/shopping-cart/src/models/{CartSubCartTransport.js → CartTransport.js} +11 -11
  121. package/shopping-cart/src/models/CartUpdateParameters.d.ts +31 -0
  122. package/shopping-cart/src/models/CartUpdateParameters.js +45 -0
  123. package/shopping-cart/src/models/CartWarning.d.ts +70 -0
  124. package/shopping-cart/src/models/CartWarning.js +67 -0
  125. package/shopping-cart/src/models/CartsWithWarnings.d.ts +39 -0
  126. package/shopping-cart/src/models/CartsWithWarnings.js +49 -0
  127. package/shopping-cart/src/models/OwnerLink.d.ts +43 -0
  128. package/shopping-cart/src/models/OwnerLink.js +53 -0
  129. package/shopping-cart/src/models/PaginatedCarts.d.ts +46 -0
  130. package/shopping-cart/src/models/PaginatedCarts.js +58 -0
  131. package/shopping-cart/src/models/PagingMetadata.d.ts +49 -0
  132. package/shopping-cart/src/models/PagingMetadata.js +55 -0
  133. package/shopping-cart/src/models/RestError.d.ts +3 -5
  134. package/shopping-cart/src/models/RestError.js +3 -5
  135. package/shopping-cart/src/models/ShoppedOffer.d.ts +2 -2
  136. package/shopping-cart/src/models/ShoppedOffer.js +2 -2
  137. package/shopping-cart/src/models/index.d.ts +12 -4
  138. package/shopping-cart/src/models/index.js +12 -4
  139. package/smuggler/src/models/RestError.d.ts +3 -5
  140. package/smuggler/src/models/RestError.js +3 -5
  141. package/statistic/src/models/RestError.d.ts +3 -5
  142. package/statistic/src/models/RestError.js +3 -5
  143. package/third-party/src/models/RestError.d.ts +3 -5
  144. package/third-party/src/models/RestError.js +3 -5
  145. package/ubo/src/models/RestError.d.ts +3 -5
  146. package/ubo/src/models/RestError.js +3 -5
  147. package/user/src/models/RestError.d.ts +3 -5
  148. package/user/src/models/RestError.js +3 -5
  149. package/wish/src/models/RestError.d.ts +3 -5
  150. package/wish/src/models/RestError.js +3 -5
  151. package/magic-cart/src/models/SaleOfferProposal.d.ts +0 -51
  152. package/magic-cart/src/models/SaleOfferProposal.js +0 -61
  153. package/magic-cart/src/models/SellerProposal.d.ts +0 -45
  154. package/magic-cart/src/models/SellerProposal.js +0 -57
  155. package/order/src/apis/ManageMetaOrderApi.d.ts +0 -45
  156. package/order/src/models/AnyMetaOrderWarning.d.ts +0 -26
  157. package/order/src/models/AnyMetaOrderWarning.js +0 -50
  158. package/order/src/models/MetaOrder.d.ts +0 -64
  159. package/order/src/models/MetaOrder.js +0 -70
  160. package/order/src/models/MetaOrderCreationParameters.d.ts +0 -38
  161. package/order/src/models/MetaOrderCreationParameters.js +0 -52
  162. package/order/src/models/MetaOrderCreationSubCartParameters.d.ts +0 -31
  163. package/order/src/models/MetaOrderCreationSubCartParameters.js +0 -47
  164. package/order/src/models/MetaOrderPrices.d.ts +0 -79
  165. package/order/src/models/MetaOrderPrices.js +0 -79
  166. package/order/src/models/MetaOrderWarning.d.ts +0 -31
  167. package/order/src/models/MetaOrderWarning.js +0 -47
  168. package/order/src/models/MetaOrderWithWarnings.d.ts +0 -39
  169. package/order/src/models/MetaOrderWithWarnings.js +0 -49
  170. package/order/src/models/OrderWarning.d.ts +0 -51
  171. package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +0 -107
  172. package/shopping-cart/src/apis/ManageCartSubCartApi.js +0 -556
  173. package/shopping-cart/src/apis/ManageCartSubCartLineApi.d.ts +0 -151
  174. package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +0 -879
  175. package/shopping-cart/src/models/CartSubCart.d.ts +0 -76
  176. package/shopping-cart/src/models/CartSubCart.js +0 -78
  177. package/shopping-cart/src/models/CartSubCartLineUpdateParameters.d.ts +0 -37
  178. package/shopping-cart/src/models/CartSubCartLineUpdateParameters.js +0 -49
@@ -1,556 +0,0 @@
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
- };