@lcdp/api-react-rest-client 3.1.2 → 3.1.3-LDS-5369-api-modifications-routes-et-sch.21861896537
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/order/src/apis/ManageForeorderApi.d.ts +31 -0
- package/order/src/apis/{ManageMetaOrderApi.js → ManageForeorderApi.js} +18 -91
- package/order/src/apis/ManageOrderApi.d.ts +8 -8
- package/order/src/apis/ManageOrderApi.js +9 -10
- package/order/src/apis/index.d.ts +1 -1
- package/order/src/apis/index.js +1 -1
- package/order/src/models/{AnyMetaOrderWarning.d.ts → AnyForeorderWarning.d.ts} +5 -5
- package/order/src/models/{AnyMetaOrderWarning.js → AnyForeorderWarning.js} +10 -10
- package/order/src/models/Foreorder.d.ts +241 -0
- package/order/src/models/Foreorder.js +180 -0
- package/order/src/models/ForeorderCreationParameters.d.ts +45 -0
- package/order/src/models/ForeorderCreationParameters.js +58 -0
- package/order/src/models/ForeorderCreationResponse.d.ts +39 -0
- package/order/src/models/ForeorderCreationResponse.js +53 -0
- package/order/src/models/ForeorderWarning.d.ts +31 -0
- package/order/src/models/{MetaOrderWarning.js → ForeorderWarning.js} +11 -11
- package/order/src/models/Order.d.ts +9 -7
- package/order/src/models/Order.js +6 -4
- package/order/src/models/OrderCreationParameters.d.ts +46 -0
- package/order/src/models/OrderCreationParameters.js +59 -0
- package/order/src/models/index.d.ts +6 -7
- package/order/src/models/index.js +6 -7
- package/package.json +1 -1
- package/shopping-cart/src/apis/ManageCartApi.d.ts +30 -28
- package/shopping-cart/src/apis/ManageCartApi.js +43 -167
- package/shopping-cart/src/apis/ManageCartLineApi.d.ts +82 -0
- package/shopping-cart/src/apis/{ManageCartSubCartApi.js → ManageCartLineApi.js} +86 -157
- package/shopping-cart/src/apis/index.d.ts +1 -2
- package/shopping-cart/src/apis/index.js +1 -2
- package/shopping-cart/src/models/Cart.d.ts +6 -6
- package/shopping-cart/src/models/Cart.js +10 -4
- package/shopping-cart/src/models/CartCreationParameters.d.ts +44 -0
- package/shopping-cart/src/models/CartCreationParameters.js +56 -0
- package/shopping-cart/src/models/CartCreationResponse.d.ts +39 -0
- package/shopping-cart/src/models/CartCreationResponse.js +49 -0
- package/shopping-cart/src/models/{CartSubCartLine.d.ts → CartLine.d.ts} +13 -13
- package/shopping-cart/src/models/{CartSubCartLine.js → CartLine.js} +11 -11
- package/shopping-cart/src/models/CartLineResponse.d.ts +39 -0
- package/shopping-cart/src/models/CartLineResponse.js +49 -0
- package/shopping-cart/src/models/CartLineUpdateParameters.d.ts +37 -0
- package/shopping-cart/src/models/CartLineUpdateParameters.js +49 -0
- package/shopping-cart/src/models/CartLinesResponse.d.ts +39 -0
- package/shopping-cart/src/models/CartLinesResponse.js +49 -0
- package/shopping-cart/src/models/CartRecord.d.ts +70 -0
- package/shopping-cart/src/models/CartRecord.js +74 -0
- package/shopping-cart/src/models/{CartSubCartTransport.d.ts → CartRecordTransport.d.ts} +12 -12
- package/shopping-cart/src/models/{CartSubCartTransport.js → CartRecordTransport.js} +11 -11
- package/shopping-cart/src/models/CartSummary.d.ts +31 -0
- package/shopping-cart/src/models/CartSummary.js +47 -0
- package/shopping-cart/src/models/CartWarning.d.ts +68 -0
- package/shopping-cart/src/models/CartWarning.js +69 -0
- package/shopping-cart/src/models/OwnerLink.d.ts +43 -0
- package/shopping-cart/src/models/{SellerLink.js → OwnerLink.js} +13 -14
- package/shopping-cart/src/models/PaginatedCarts.d.ts +46 -0
- package/shopping-cart/src/models/PaginatedCarts.js +58 -0
- package/shopping-cart/src/models/PagingMetadata.d.ts +49 -0
- package/shopping-cart/src/models/PagingMetadata.js +55 -0
- package/shopping-cart/src/models/index.d.ts +13 -6
- package/shopping-cart/src/models/index.js +13 -6
- package/order/src/apis/ManageMetaOrderApi.d.ts +0 -45
- package/order/src/models/MetaOrder.d.ts +0 -64
- package/order/src/models/MetaOrder.js +0 -70
- package/order/src/models/MetaOrderCreationParameters.d.ts +0 -38
- package/order/src/models/MetaOrderCreationParameters.js +0 -52
- package/order/src/models/MetaOrderCreationSubCartParameters.d.ts +0 -31
- package/order/src/models/MetaOrderCreationSubCartParameters.js +0 -47
- package/order/src/models/MetaOrderPrices.d.ts +0 -79
- package/order/src/models/MetaOrderPrices.js +0 -79
- package/order/src/models/MetaOrderWarning.d.ts +0 -31
- package/order/src/models/MetaOrderWithWarnings.d.ts +0 -39
- package/order/src/models/MetaOrderWithWarnings.js +0 -49
- package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +0 -107
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.d.ts +0 -151
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +0 -879
- package/shopping-cart/src/models/CartSubCart.d.ts +0 -76
- package/shopping-cart/src/models/CartSubCart.js +0 -78
- package/shopping-cart/src/models/CartSubCartLineUpdateParameters.d.ts +0 -37
- package/shopping-cart/src/models/CartSubCartLineUpdateParameters.js +0 -49
- package/shopping-cart/src/models/SellerLink.d.ts +0 -50
- package/shopping-cart/src/models/UserRole.d.ts +0 -29
- package/shopping-cart/src/models/UserRole.js +0 -52
|
@@ -64,34 +64,36 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
-
exports.
|
|
67
|
+
exports.ManageCartLineApi = void 0;
|
|
68
68
|
var runtime = require("../runtime");
|
|
69
69
|
var index_1 = require("../models/index");
|
|
70
70
|
/**
|
|
71
71
|
*
|
|
72
72
|
*/
|
|
73
|
-
var
|
|
74
|
-
__extends(
|
|
75
|
-
function
|
|
73
|
+
var ManageCartLineApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(ManageCartLineApi, _super);
|
|
75
|
+
function ManageCartLineApi() {
|
|
76
76
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* If Sale Offer from \'offerReference\' is a distribution type \'RANGE\', then distributedRangeId should not be null. In any case, \'quantity\' field should be >= 0
|
|
80
|
+
* Create or update a cart line if its already exist
|
|
80
81
|
*/
|
|
81
|
-
|
|
82
|
+
ManageCartLineApi.prototype.createOrUpdateCartLineRaw = function (requestParameters, initOverrides) {
|
|
82
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_1;
|
|
84
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_1;
|
|
84
85
|
return __generator(this, function (_c) {
|
|
85
86
|
switch (_c.label) {
|
|
86
87
|
case 0:
|
|
87
88
|
if (requestParameters['cartId'] == null) {
|
|
88
|
-
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling
|
|
89
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling createOrUpdateCartLine().');
|
|
89
90
|
}
|
|
90
|
-
if (requestParameters['
|
|
91
|
-
throw new runtime.RequiredError('
|
|
91
|
+
if (requestParameters['shoppedOffer'] == null) {
|
|
92
|
+
throw new runtime.RequiredError('shoppedOffer', 'Required parameter "shoppedOffer" was null or undefined when calling createOrUpdateCartLine().');
|
|
92
93
|
}
|
|
93
94
|
queryParameters = {};
|
|
94
95
|
headerParameters = {};
|
|
96
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
95
97
|
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
96
98
|
_a = headerParameters;
|
|
97
99
|
_b = "x-api-key";
|
|
@@ -112,14 +114,26 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
112
114
|
case 4:
|
|
113
115
|
_c.trys.push([4, 6, , 7]);
|
|
114
116
|
return [4 /*yield*/, this.request({
|
|
115
|
-
path: "/carts/{cartId}/
|
|
116
|
-
method: '
|
|
117
|
+
path: "/carts/{cartId}/lines".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))),
|
|
118
|
+
method: 'POST',
|
|
117
119
|
headers: headerParameters,
|
|
118
120
|
query: queryParameters,
|
|
121
|
+
body: requestParameters['shoppedOffer'].map(index_1.ShoppedOfferToJSON),
|
|
119
122
|
}, initOverrides)];
|
|
120
123
|
case 5:
|
|
121
124
|
response = _c.sent();
|
|
122
|
-
|
|
125
|
+
contentType = response.headers.get("content-type");
|
|
126
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
127
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartLinesResponseFromJSON)(jsonValue); })];
|
|
128
|
+
}
|
|
129
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
130
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// TODO : Better handling of others application types
|
|
134
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
135
|
+
}
|
|
136
|
+
return [3 /*break*/, 7];
|
|
123
137
|
case 6:
|
|
124
138
|
response_1 = _c.sent();
|
|
125
139
|
console.debug(response_1);
|
|
@@ -130,31 +144,38 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
130
144
|
});
|
|
131
145
|
};
|
|
132
146
|
/**
|
|
133
|
-
*
|
|
147
|
+
* If Sale Offer from \'offerReference\' is a distribution type \'RANGE\', then distributedRangeId should not be null. In any case, \'quantity\' field should be >= 0
|
|
148
|
+
* Create or update a cart line if its already exist
|
|
134
149
|
*/
|
|
135
|
-
|
|
150
|
+
ManageCartLineApi.prototype.createOrUpdateCartLine = function (requestParameters, initOverrides) {
|
|
136
151
|
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
var response;
|
|
137
153
|
return __generator(this, function (_a) {
|
|
138
154
|
switch (_a.label) {
|
|
139
|
-
case 0: return [4 /*yield*/, this.
|
|
155
|
+
case 0: return [4 /*yield*/, this.createOrUpdateCartLineRaw(requestParameters, initOverrides)];
|
|
140
156
|
case 1:
|
|
141
|
-
_a.sent();
|
|
142
|
-
return [
|
|
157
|
+
response = _a.sent();
|
|
158
|
+
return [4 /*yield*/, response.value()];
|
|
159
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
143
160
|
}
|
|
144
161
|
});
|
|
145
162
|
});
|
|
146
163
|
};
|
|
147
164
|
/**
|
|
148
|
-
*
|
|
165
|
+
* Permit to delete a shopping cart line
|
|
166
|
+
* Delete a cart line
|
|
149
167
|
*/
|
|
150
|
-
|
|
168
|
+
ManageCartLineApi.prototype.deleteCartLineRaw = function (requestParameters, initOverrides) {
|
|
151
169
|
return __awaiter(this, void 0, void 0, function () {
|
|
152
170
|
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_2;
|
|
153
171
|
return __generator(this, function (_c) {
|
|
154
172
|
switch (_c.label) {
|
|
155
173
|
case 0:
|
|
156
|
-
if (requestParameters['
|
|
157
|
-
throw new runtime.RequiredError('
|
|
174
|
+
if (requestParameters['cartId'] == null) {
|
|
175
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling deleteCartLine().');
|
|
176
|
+
}
|
|
177
|
+
if (requestParameters['lineId'] == null) {
|
|
178
|
+
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling deleteCartLine().');
|
|
158
179
|
}
|
|
159
180
|
queryParameters = {};
|
|
160
181
|
headerParameters = {};
|
|
@@ -178,7 +199,7 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
178
199
|
case 4:
|
|
179
200
|
_c.trys.push([4, 6, , 7]);
|
|
180
201
|
return [4 /*yield*/, this.request({
|
|
181
|
-
path: "/carts/
|
|
202
|
+
path: "/carts/{cartId}/lines/{lineId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
182
203
|
method: 'DELETE',
|
|
183
204
|
headers: headerParameters,
|
|
184
205
|
query: queryParameters,
|
|
@@ -196,13 +217,14 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
196
217
|
});
|
|
197
218
|
};
|
|
198
219
|
/**
|
|
199
|
-
*
|
|
220
|
+
* Permit to delete a shopping cart line
|
|
221
|
+
* Delete a cart line
|
|
200
222
|
*/
|
|
201
|
-
|
|
223
|
+
ManageCartLineApi.prototype.deleteCartLine = function (requestParameters, initOverrides) {
|
|
202
224
|
return __awaiter(this, void 0, void 0, function () {
|
|
203
225
|
return __generator(this, function (_a) {
|
|
204
226
|
switch (_a.label) {
|
|
205
|
-
case 0: return [4 /*yield*/, this.
|
|
227
|
+
case 0: return [4 /*yield*/, this.deleteCartLineRaw(requestParameters, initOverrides)];
|
|
206
228
|
case 1:
|
|
207
229
|
_a.sent();
|
|
208
230
|
return [2 /*return*/];
|
|
@@ -211,19 +233,19 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
211
233
|
});
|
|
212
234
|
};
|
|
213
235
|
/**
|
|
214
|
-
* Get
|
|
236
|
+
* Get a cart line
|
|
215
237
|
*/
|
|
216
|
-
|
|
238
|
+
ManageCartLineApi.prototype.getCartLineRaw = function (requestParameters, initOverrides) {
|
|
217
239
|
return __awaiter(this, void 0, void 0, function () {
|
|
218
240
|
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_3;
|
|
219
241
|
return __generator(this, function (_c) {
|
|
220
242
|
switch (_c.label) {
|
|
221
243
|
case 0:
|
|
222
244
|
if (requestParameters['cartId'] == null) {
|
|
223
|
-
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling
|
|
245
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCartLine().');
|
|
224
246
|
}
|
|
225
|
-
if (requestParameters['
|
|
226
|
-
throw new runtime.RequiredError('
|
|
247
|
+
if (requestParameters['lineId'] == null) {
|
|
248
|
+
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling getCartLine().');
|
|
227
249
|
}
|
|
228
250
|
queryParameters = {};
|
|
229
251
|
headerParameters = {};
|
|
@@ -247,7 +269,7 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
247
269
|
case 4:
|
|
248
270
|
_c.trys.push([4, 6, , 7]);
|
|
249
271
|
return [4 /*yield*/, this.request({
|
|
250
|
-
path: "/carts/{cartId}/
|
|
272
|
+
path: "/carts/{cartId}/lines/{lineId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
251
273
|
method: 'GET',
|
|
252
274
|
headers: headerParameters,
|
|
253
275
|
query: queryParameters,
|
|
@@ -256,7 +278,7 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
256
278
|
response = _c.sent();
|
|
257
279
|
contentType = response.headers.get("content-type");
|
|
258
280
|
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
259
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
281
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartLineFromJSON)(jsonValue); })];
|
|
260
282
|
}
|
|
261
283
|
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
262
284
|
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
@@ -276,14 +298,14 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
276
298
|
});
|
|
277
299
|
};
|
|
278
300
|
/**
|
|
279
|
-
* Get
|
|
301
|
+
* Get a cart line
|
|
280
302
|
*/
|
|
281
|
-
|
|
303
|
+
ManageCartLineApi.prototype.getCartLine = function (requestParameters, initOverrides) {
|
|
282
304
|
return __awaiter(this, void 0, void 0, function () {
|
|
283
305
|
var response;
|
|
284
306
|
return __generator(this, function (_a) {
|
|
285
307
|
switch (_a.label) {
|
|
286
|
-
case 0: return [4 /*yield*/, this.
|
|
308
|
+
case 0: return [4 /*yield*/, this.getCartLineRaw(requestParameters, initOverrides)];
|
|
287
309
|
case 1:
|
|
288
310
|
response = _a.sent();
|
|
289
311
|
return [4 /*yield*/, response.value()];
|
|
@@ -293,21 +315,18 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
293
315
|
});
|
|
294
316
|
};
|
|
295
317
|
/**
|
|
296
|
-
* Get
|
|
318
|
+
* Get all cart lines
|
|
297
319
|
*/
|
|
298
|
-
|
|
320
|
+
ManageCartLineApi.prototype.getCartLinesRaw = function (requestParameters, initOverrides) {
|
|
299
321
|
return __awaiter(this, void 0, void 0, function () {
|
|
300
322
|
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_4;
|
|
301
323
|
return __generator(this, function (_c) {
|
|
302
324
|
switch (_c.label) {
|
|
303
325
|
case 0:
|
|
304
326
|
if (requestParameters['cartId'] == null) {
|
|
305
|
-
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling
|
|
327
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCartLines().');
|
|
306
328
|
}
|
|
307
329
|
queryParameters = {};
|
|
308
|
-
if (requestParameters['orderBy'] != null) {
|
|
309
|
-
queryParameters['orderBy'] = requestParameters['orderBy'];
|
|
310
|
-
}
|
|
311
330
|
headerParameters = {};
|
|
312
331
|
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
313
332
|
_a = headerParameters;
|
|
@@ -329,7 +348,7 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
329
348
|
case 4:
|
|
330
349
|
_c.trys.push([4, 6, , 7]);
|
|
331
350
|
return [4 /*yield*/, this.request({
|
|
332
|
-
path: "/carts/{cartId}/
|
|
351
|
+
path: "/carts/{cartId}/lines".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))),
|
|
333
352
|
method: 'GET',
|
|
334
353
|
headers: headerParameters,
|
|
335
354
|
query: queryParameters,
|
|
@@ -338,7 +357,7 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
338
357
|
response = _c.sent();
|
|
339
358
|
contentType = response.headers.get("content-type");
|
|
340
359
|
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
341
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.
|
|
360
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.CartLineFromJSON); })];
|
|
342
361
|
}
|
|
343
362
|
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
344
363
|
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
@@ -358,14 +377,14 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
358
377
|
});
|
|
359
378
|
};
|
|
360
379
|
/**
|
|
361
|
-
* Get
|
|
380
|
+
* Get all cart lines
|
|
362
381
|
*/
|
|
363
|
-
|
|
382
|
+
ManageCartLineApi.prototype.getCartLines = function (requestParameters, initOverrides) {
|
|
364
383
|
return __awaiter(this, void 0, void 0, function () {
|
|
365
384
|
var response;
|
|
366
385
|
return __generator(this, function (_a) {
|
|
367
386
|
switch (_a.label) {
|
|
368
|
-
case 0: return [4 /*yield*/, this.
|
|
387
|
+
case 0: return [4 /*yield*/, this.getCartLinesRaw(requestParameters, initOverrides)];
|
|
369
388
|
case 1:
|
|
370
389
|
response = _a.sent();
|
|
371
390
|
return [4 /*yield*/, response.value()];
|
|
@@ -375,19 +394,26 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
375
394
|
});
|
|
376
395
|
};
|
|
377
396
|
/**
|
|
378
|
-
*
|
|
397
|
+
* Update a cart line
|
|
379
398
|
*/
|
|
380
|
-
|
|
399
|
+
ManageCartLineApi.prototype.updateCartLineRaw = function (requestParameters, initOverrides) {
|
|
381
400
|
return __awaiter(this, void 0, void 0, function () {
|
|
382
401
|
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_5;
|
|
383
402
|
return __generator(this, function (_c) {
|
|
384
403
|
switch (_c.label) {
|
|
385
404
|
case 0:
|
|
386
|
-
if (requestParameters['
|
|
387
|
-
throw new runtime.RequiredError('
|
|
405
|
+
if (requestParameters['cartId'] == null) {
|
|
406
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling updateCartLine().');
|
|
407
|
+
}
|
|
408
|
+
if (requestParameters['lineId'] == null) {
|
|
409
|
+
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling updateCartLine().');
|
|
410
|
+
}
|
|
411
|
+
if (requestParameters['cartLineUpdateParameters'] == null) {
|
|
412
|
+
throw new runtime.RequiredError('cartLineUpdateParameters', 'Required parameter "cartLineUpdateParameters" was null or undefined when calling updateCartLine().');
|
|
388
413
|
}
|
|
389
414
|
queryParameters = {};
|
|
390
415
|
headerParameters = {};
|
|
416
|
+
headerParameters['Content-Type'] = 'application/merge-patch+json';
|
|
391
417
|
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
392
418
|
_a = headerParameters;
|
|
393
419
|
_b = "x-api-key";
|
|
@@ -408,16 +434,17 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
408
434
|
case 4:
|
|
409
435
|
_c.trys.push([4, 6, , 7]);
|
|
410
436
|
return [4 /*yield*/, this.request({
|
|
411
|
-
path: "/carts/
|
|
412
|
-
method: '
|
|
437
|
+
path: "/carts/{cartId}/lines/{lineId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
438
|
+
method: 'PATCH',
|
|
413
439
|
headers: headerParameters,
|
|
414
440
|
query: queryParameters,
|
|
441
|
+
body: (0, index_1.CartLineUpdateParametersToJSON)(requestParameters['cartLineUpdateParameters']),
|
|
415
442
|
}, initOverrides)];
|
|
416
443
|
case 5:
|
|
417
444
|
response = _c.sent();
|
|
418
445
|
contentType = response.headers.get("content-type");
|
|
419
446
|
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
420
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
447
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartLineResponseFromJSON)(jsonValue); })];
|
|
421
448
|
}
|
|
422
449
|
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
423
450
|
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
@@ -437,94 +464,14 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
437
464
|
});
|
|
438
465
|
};
|
|
439
466
|
/**
|
|
440
|
-
*
|
|
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
|
|
467
|
+
* Update a cart line
|
|
520
468
|
*/
|
|
521
|
-
|
|
522
|
-
if (requestParameters === void 0) { requestParameters = {}; }
|
|
469
|
+
ManageCartLineApi.prototype.updateCartLine = function (requestParameters, initOverrides) {
|
|
523
470
|
return __awaiter(this, void 0, void 0, function () {
|
|
524
471
|
var response;
|
|
525
472
|
return __generator(this, function (_a) {
|
|
526
473
|
switch (_a.label) {
|
|
527
|
-
case 0: return [4 /*yield*/, this.
|
|
474
|
+
case 0: return [4 /*yield*/, this.updateCartLineRaw(requestParameters, initOverrides)];
|
|
528
475
|
case 1:
|
|
529
476
|
response = _a.sent();
|
|
530
477
|
return [4 /*yield*/, response.value()];
|
|
@@ -533,24 +480,6 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
533
480
|
});
|
|
534
481
|
});
|
|
535
482
|
};
|
|
536
|
-
return
|
|
483
|
+
return ManageCartLineApi;
|
|
537
484
|
}(runtime.BaseAPI));
|
|
538
|
-
exports.
|
|
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
|
-
};
|
|
485
|
+
exports.ManageCartLineApi = ManageCartLineApi;
|
|
@@ -17,5 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
19
|
__exportStar(require("./ManageCartApi"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./ManageCartSubCartLineApi"), exports);
|
|
20
|
+
__exportStar(require("./ManageCartLineApi"), exports);
|
|
@@ -21,19 +21,19 @@ export interface Cart {
|
|
|
21
21
|
* @type {number}
|
|
22
22
|
* @memberof Cart
|
|
23
23
|
*/
|
|
24
|
-
id
|
|
24
|
+
id: number;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @type {
|
|
26
|
+
* Channel identifier
|
|
27
|
+
* @type {string}
|
|
28
28
|
* @memberof Cart
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
channel: string;
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
|
-
* @type {
|
|
33
|
+
* @type {HttpLink}
|
|
34
34
|
* @memberof Cart
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
lines: HttpLink;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Check if a given object implements the Cart interface.
|
|
@@ -19,6 +19,12 @@ var HttpLink_1 = require("./HttpLink");
|
|
|
19
19
|
* Check if a given object implements the Cart interface.
|
|
20
20
|
*/
|
|
21
21
|
function instanceOfCart(value) {
|
|
22
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
if (!('channel' in value) || value['channel'] === undefined)
|
|
25
|
+
return false;
|
|
26
|
+
if (!('lines' in value) || value['lines'] === undefined)
|
|
27
|
+
return false;
|
|
22
28
|
return true;
|
|
23
29
|
}
|
|
24
30
|
exports.instanceOfCart = instanceOfCart;
|
|
@@ -32,8 +38,8 @@ function CartFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
32
38
|
}
|
|
33
39
|
return {
|
|
34
40
|
'id': json['id'],
|
|
35
|
-
'
|
|
36
|
-
'
|
|
41
|
+
'channel': json['channel'],
|
|
42
|
+
'lines': (json['lines'] === null || json['lines'] === undefined) ? json['lines'] : (0, HttpLink_1.HttpLinkFromJSON)(json['lines']),
|
|
37
43
|
};
|
|
38
44
|
}
|
|
39
45
|
exports.CartFromJSONTyped = CartFromJSONTyped;
|
|
@@ -43,8 +49,8 @@ function CartToJSON(value) {
|
|
|
43
49
|
}
|
|
44
50
|
return {
|
|
45
51
|
'id': value['id'],
|
|
46
|
-
'
|
|
47
|
-
'
|
|
52
|
+
'channel': value['channel'],
|
|
53
|
+
'lines': (0, HttpLink_1.HttpLinkToJSON)(value['lines']),
|
|
48
54
|
};
|
|
49
55
|
}
|
|
50
56
|
exports.CartToJSON = CartToJSON;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 type { ShoppedOffer } from './ShoppedOffer';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface CartCreationParameters
|
|
17
|
+
*/
|
|
18
|
+
export interface CartCreationParameters {
|
|
19
|
+
/**
|
|
20
|
+
* Id of the cart owner
|
|
21
|
+
* @type {number}
|
|
22
|
+
* @memberof CartCreationParameters
|
|
23
|
+
*/
|
|
24
|
+
ownerId: number;
|
|
25
|
+
/**
|
|
26
|
+
* Channel identifier (e.g. "express-order:uuid")
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof CartCreationParameters
|
|
29
|
+
*/
|
|
30
|
+
channel: string;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {Array<ShoppedOffer>}
|
|
34
|
+
* @memberof CartCreationParameters
|
|
35
|
+
*/
|
|
36
|
+
shoppedOffers: Array<ShoppedOffer>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if a given object implements the CartCreationParameters interface.
|
|
40
|
+
*/
|
|
41
|
+
export declare function instanceOfCartCreationParameters(value: object): value is CartCreationParameters;
|
|
42
|
+
export declare function CartCreationParametersFromJSON(json: any): CartCreationParameters;
|
|
43
|
+
export declare function CartCreationParametersFromJSONTyped(json: any, ignoreDiscriminator: boolean): CartCreationParameters;
|
|
44
|
+
export declare function CartCreationParametersToJSON(value?: CartCreationParameters | null): any;
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.CartCreationParametersToJSON = exports.CartCreationParametersFromJSONTyped = exports.CartCreationParametersFromJSON = exports.instanceOfCartCreationParameters = void 0;
|
|
17
|
+
var ShoppedOffer_1 = require("./ShoppedOffer");
|
|
18
|
+
/**
|
|
19
|
+
* Check if a given object implements the CartCreationParameters interface.
|
|
20
|
+
*/
|
|
21
|
+
function instanceOfCartCreationParameters(value) {
|
|
22
|
+
if (!('ownerId' in value) || value['ownerId'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
if (!('channel' in value) || value['channel'] === undefined)
|
|
25
|
+
return false;
|
|
26
|
+
if (!('shoppedOffers' in value) || value['shoppedOffers'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
exports.instanceOfCartCreationParameters = instanceOfCartCreationParameters;
|
|
31
|
+
function CartCreationParametersFromJSON(json) {
|
|
32
|
+
return CartCreationParametersFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
exports.CartCreationParametersFromJSON = CartCreationParametersFromJSON;
|
|
35
|
+
function CartCreationParametersFromJSONTyped(json, ignoreDiscriminator) {
|
|
36
|
+
if (json == null) {
|
|
37
|
+
return json;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'ownerId': json['ownerId'],
|
|
41
|
+
'channel': json['channel'],
|
|
42
|
+
'shoppedOffers': (json['shoppedOffers'] === null || json['shoppedOffers'] === undefined) ? json['shoppedOffers'] : json['shoppedOffers'].map(ShoppedOffer_1.ShoppedOfferFromJSON),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.CartCreationParametersFromJSONTyped = CartCreationParametersFromJSONTyped;
|
|
46
|
+
function CartCreationParametersToJSON(value) {
|
|
47
|
+
if (value == null) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'ownerId': value['ownerId'],
|
|
52
|
+
'channel': value['channel'],
|
|
53
|
+
'shoppedOffers': (value['shoppedOffers'] === null || value['shoppedOffers'] === undefined) ? value['shoppedOffers'] : value['shoppedOffers'].map(ShoppedOffer_1.ShoppedOfferToJSON),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
exports.CartCreationParametersToJSON = CartCreationParametersToJSON;
|