@lcdp/api-react-rest-client 3.0.4-LDS-5142-archive-ad.20455279399 → 3.0.4-LDS-4910-rde2e-mettre-a-jour-les-tests.20523632491
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/package.json +1 -1
- package/sale-offer/src/models/SaleOfferStatusReason.d.ts +0 -1
- package/sale-offer/src/models/SaleOfferStatusReason.js +0 -1
- package/shopping-cart/src/apis/ManageCartApi.d.ts +22 -0
- package/shopping-cart/src/apis/ManageCartApi.js +164 -6
- package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +46 -0
- package/shopping-cart/src/apis/ManageCartSubCartApi.js +254 -12
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.d.ts +69 -0
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +427 -20
|
@@ -79,17 +79,20 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
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
80
|
* Create or update a cart line if its already exist
|
|
81
81
|
*/
|
|
82
|
-
ManageCartSubCartLineApi.prototype.
|
|
82
|
+
ManageCartSubCartLineApi.prototype.createOrUpdateCartSubCartLinesRaw = function (requestParameters, initOverrides) {
|
|
83
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
84
84
|
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_1;
|
|
85
85
|
return __generator(this, function (_c) {
|
|
86
86
|
switch (_c.label) {
|
|
87
87
|
case 0:
|
|
88
|
+
if (requestParameters['cartId'] == null) {
|
|
89
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling createOrUpdateCartSubCartLines().');
|
|
90
|
+
}
|
|
88
91
|
if (requestParameters['subCartId'] == null) {
|
|
89
|
-
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling
|
|
92
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling createOrUpdateCartSubCartLines().');
|
|
90
93
|
}
|
|
91
94
|
if (requestParameters['shoppedOffer'] == null) {
|
|
92
|
-
throw new runtime.RequiredError('shoppedOffer', 'Required parameter "shoppedOffer" was null or undefined when calling
|
|
95
|
+
throw new runtime.RequiredError('shoppedOffer', 'Required parameter "shoppedOffer" was null or undefined when calling createOrUpdateCartSubCartLines().');
|
|
93
96
|
}
|
|
94
97
|
queryParameters = {};
|
|
95
98
|
headerParameters = {};
|
|
@@ -114,7 +117,7 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
114
117
|
case 4:
|
|
115
118
|
_c.trys.push([4, 6, , 7]);
|
|
116
119
|
return [4 /*yield*/, this.request({
|
|
117
|
-
path: "/carts/
|
|
120
|
+
path: "/carts/{cartId}/sub-carts/{subCartId}/lines".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
|
|
118
121
|
method: 'POST',
|
|
119
122
|
headers: headerParameters,
|
|
120
123
|
query: queryParameters,
|
|
@@ -132,6 +135,79 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
132
135
|
});
|
|
133
136
|
});
|
|
134
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* If Sale Offer from \'offerReference\' is a distribution type \'RANGE\', then distributedRangeId should not be null. In any case, \'quantity\' field should be >= 0
|
|
140
|
+
* Create or update a cart line if its already exist
|
|
141
|
+
*/
|
|
142
|
+
ManageCartSubCartLineApi.prototype.createOrUpdateCartSubCartLines = function (requestParameters, initOverrides) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
144
|
+
return __generator(this, function (_a) {
|
|
145
|
+
switch (_a.label) {
|
|
146
|
+
case 0: return [4 /*yield*/, this.createOrUpdateCartSubCartLinesRaw(requestParameters, initOverrides)];
|
|
147
|
+
case 1:
|
|
148
|
+
_a.sent();
|
|
149
|
+
return [2 /*return*/];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* If Sale Offer from \'offerReference\' is a distribution type \'RANGE\', then distributedRangeId should not be null. In any case, \'quantity\' field should be >= 0
|
|
156
|
+
* Create or update a cart line if its already exist
|
|
157
|
+
*/
|
|
158
|
+
ManageCartSubCartLineApi.prototype.createOrUpdateCurrentCartSubCartLinesRaw = function (requestParameters, initOverrides) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_2;
|
|
161
|
+
return __generator(this, function (_c) {
|
|
162
|
+
switch (_c.label) {
|
|
163
|
+
case 0:
|
|
164
|
+
if (requestParameters['subCartId'] == null) {
|
|
165
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling createOrUpdateCurrentCartSubCartLines().');
|
|
166
|
+
}
|
|
167
|
+
if (requestParameters['shoppedOffer'] == null) {
|
|
168
|
+
throw new runtime.RequiredError('shoppedOffer', 'Required parameter "shoppedOffer" was null or undefined when calling createOrUpdateCurrentCartSubCartLines().');
|
|
169
|
+
}
|
|
170
|
+
queryParameters = {};
|
|
171
|
+
headerParameters = {};
|
|
172
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
173
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
174
|
+
_a = headerParameters;
|
|
175
|
+
_b = "x-api-key";
|
|
176
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
177
|
+
case 1:
|
|
178
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
179
|
+
_c.label = 2;
|
|
180
|
+
case 2:
|
|
181
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
182
|
+
token = this.configuration.accessToken;
|
|
183
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
184
|
+
case 3:
|
|
185
|
+
tokenString = _c.sent();
|
|
186
|
+
if (tokenString) {
|
|
187
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
188
|
+
}
|
|
189
|
+
_c.label = 4;
|
|
190
|
+
case 4:
|
|
191
|
+
_c.trys.push([4, 6, , 7]);
|
|
192
|
+
return [4 /*yield*/, this.request({
|
|
193
|
+
path: "/carts/me/sub-carts/{subCartId}/lines".replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
|
|
194
|
+
method: 'POST',
|
|
195
|
+
headers: headerParameters,
|
|
196
|
+
query: queryParameters,
|
|
197
|
+
body: (0, index_1.ShoppedOfferToJSON)(requestParameters['shoppedOffer']),
|
|
198
|
+
}, initOverrides)];
|
|
199
|
+
case 5:
|
|
200
|
+
response = _c.sent();
|
|
201
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
202
|
+
case 6:
|
|
203
|
+
response_2 = _c.sent();
|
|
204
|
+
console.debug(response_2);
|
|
205
|
+
throw response_2;
|
|
206
|
+
case 7: return [2 /*return*/];
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
};
|
|
135
211
|
/**
|
|
136
212
|
* If Sale Offer from \'offerReference\' is a distribution type \'RANGE\', then distributedRangeId should not be null. In any case, \'quantity\' field should be >= 0
|
|
137
213
|
* Create or update a cart line if its already exist
|
|
@@ -148,13 +224,87 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
148
224
|
});
|
|
149
225
|
});
|
|
150
226
|
};
|
|
227
|
+
/**
|
|
228
|
+
* Permit to delete a shopping cart line who is in current user shopping cart
|
|
229
|
+
* Delete user cart line
|
|
230
|
+
*/
|
|
231
|
+
ManageCartSubCartLineApi.prototype.deleteCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
232
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
233
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_3;
|
|
234
|
+
return __generator(this, function (_c) {
|
|
235
|
+
switch (_c.label) {
|
|
236
|
+
case 0:
|
|
237
|
+
if (requestParameters['cartId'] == null) {
|
|
238
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling deleteCartSubCartLine().');
|
|
239
|
+
}
|
|
240
|
+
if (requestParameters['subCartId'] == null) {
|
|
241
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling deleteCartSubCartLine().');
|
|
242
|
+
}
|
|
243
|
+
if (requestParameters['lineId'] == null) {
|
|
244
|
+
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling deleteCartSubCartLine().');
|
|
245
|
+
}
|
|
246
|
+
queryParameters = {};
|
|
247
|
+
headerParameters = {};
|
|
248
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
249
|
+
_a = headerParameters;
|
|
250
|
+
_b = "x-api-key";
|
|
251
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
252
|
+
case 1:
|
|
253
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
254
|
+
_c.label = 2;
|
|
255
|
+
case 2:
|
|
256
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
257
|
+
token = this.configuration.accessToken;
|
|
258
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
259
|
+
case 3:
|
|
260
|
+
tokenString = _c.sent();
|
|
261
|
+
if (tokenString) {
|
|
262
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
263
|
+
}
|
|
264
|
+
_c.label = 4;
|
|
265
|
+
case 4:
|
|
266
|
+
_c.trys.push([4, 6, , 7]);
|
|
267
|
+
return [4 /*yield*/, this.request({
|
|
268
|
+
path: "/carts/{cartId}/sub-carts/{subCartId}/lines/{lineId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
269
|
+
method: 'DELETE',
|
|
270
|
+
headers: headerParameters,
|
|
271
|
+
query: queryParameters,
|
|
272
|
+
}, initOverrides)];
|
|
273
|
+
case 5:
|
|
274
|
+
response = _c.sent();
|
|
275
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
276
|
+
case 6:
|
|
277
|
+
response_3 = _c.sent();
|
|
278
|
+
console.debug(response_3);
|
|
279
|
+
throw response_3;
|
|
280
|
+
case 7: return [2 /*return*/];
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* Permit to delete a shopping cart line who is in current user shopping cart
|
|
287
|
+
* Delete user cart line
|
|
288
|
+
*/
|
|
289
|
+
ManageCartSubCartLineApi.prototype.deleteCartSubCartLine = function (requestParameters, initOverrides) {
|
|
290
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
291
|
+
return __generator(this, function (_a) {
|
|
292
|
+
switch (_a.label) {
|
|
293
|
+
case 0: return [4 /*yield*/, this.deleteCartSubCartLineRaw(requestParameters, initOverrides)];
|
|
294
|
+
case 1:
|
|
295
|
+
_a.sent();
|
|
296
|
+
return [2 /*return*/];
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
};
|
|
151
301
|
/**
|
|
152
302
|
* Permit to delete a shopping cart line who is in current user shopping cart
|
|
153
303
|
* Delete user cart line
|
|
154
304
|
*/
|
|
155
305
|
ManageCartSubCartLineApi.prototype.deleteCurrentCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
156
306
|
return __awaiter(this, void 0, void 0, function () {
|
|
157
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response,
|
|
307
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_4;
|
|
158
308
|
return __generator(this, function (_c) {
|
|
159
309
|
switch (_c.label) {
|
|
160
310
|
case 0:
|
|
@@ -195,9 +345,9 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
195
345
|
response = _c.sent();
|
|
196
346
|
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
197
347
|
case 6:
|
|
198
|
-
|
|
199
|
-
console.debug(
|
|
200
|
-
throw
|
|
348
|
+
response_4 = _c.sent();
|
|
349
|
+
console.debug(response_4);
|
|
350
|
+
throw response_4;
|
|
201
351
|
case 7: return [2 /*return*/];
|
|
202
352
|
}
|
|
203
353
|
});
|
|
@@ -219,12 +369,179 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
219
369
|
});
|
|
220
370
|
});
|
|
221
371
|
};
|
|
372
|
+
/**
|
|
373
|
+
* Get user cart line
|
|
374
|
+
*/
|
|
375
|
+
ManageCartSubCartLineApi.prototype.getCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
376
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
377
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_5;
|
|
378
|
+
return __generator(this, function (_c) {
|
|
379
|
+
switch (_c.label) {
|
|
380
|
+
case 0:
|
|
381
|
+
if (requestParameters['cartId'] == null) {
|
|
382
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCartSubCartLine().');
|
|
383
|
+
}
|
|
384
|
+
if (requestParameters['subCartId'] == null) {
|
|
385
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling getCartSubCartLine().');
|
|
386
|
+
}
|
|
387
|
+
if (requestParameters['lineId'] == null) {
|
|
388
|
+
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling getCartSubCartLine().');
|
|
389
|
+
}
|
|
390
|
+
queryParameters = {};
|
|
391
|
+
headerParameters = {};
|
|
392
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
393
|
+
_a = headerParameters;
|
|
394
|
+
_b = "x-api-key";
|
|
395
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
396
|
+
case 1:
|
|
397
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
398
|
+
_c.label = 2;
|
|
399
|
+
case 2:
|
|
400
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
401
|
+
token = this.configuration.accessToken;
|
|
402
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
403
|
+
case 3:
|
|
404
|
+
tokenString = _c.sent();
|
|
405
|
+
if (tokenString) {
|
|
406
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
407
|
+
}
|
|
408
|
+
_c.label = 4;
|
|
409
|
+
case 4:
|
|
410
|
+
_c.trys.push([4, 6, , 7]);
|
|
411
|
+
return [4 /*yield*/, this.request({
|
|
412
|
+
path: "/carts/{cartId}/sub-carts/{subCartId}/lines/{lineId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
413
|
+
method: 'GET',
|
|
414
|
+
headers: headerParameters,
|
|
415
|
+
query: queryParameters,
|
|
416
|
+
}, initOverrides)];
|
|
417
|
+
case 5:
|
|
418
|
+
response = _c.sent();
|
|
419
|
+
contentType = response.headers.get("content-type");
|
|
420
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
421
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartSubCartLineFromJSON)(jsonValue); })];
|
|
422
|
+
}
|
|
423
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
424
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
// TODO : Better handling of others application types
|
|
428
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
429
|
+
}
|
|
430
|
+
return [3 /*break*/, 7];
|
|
431
|
+
case 6:
|
|
432
|
+
response_5 = _c.sent();
|
|
433
|
+
console.debug(response_5);
|
|
434
|
+
throw response_5;
|
|
435
|
+
case 7: return [2 /*return*/];
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
};
|
|
440
|
+
/**
|
|
441
|
+
* Get user cart line
|
|
442
|
+
*/
|
|
443
|
+
ManageCartSubCartLineApi.prototype.getCartSubCartLine = function (requestParameters, initOverrides) {
|
|
444
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
445
|
+
var response;
|
|
446
|
+
return __generator(this, function (_a) {
|
|
447
|
+
switch (_a.label) {
|
|
448
|
+
case 0: return [4 /*yield*/, this.getCartSubCartLineRaw(requestParameters, initOverrides)];
|
|
449
|
+
case 1:
|
|
450
|
+
response = _a.sent();
|
|
451
|
+
return [4 /*yield*/, response.value()];
|
|
452
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Get all cart lines for a SubCart
|
|
459
|
+
*/
|
|
460
|
+
ManageCartSubCartLineApi.prototype.getCartSubCartLinesRaw = function (requestParameters, initOverrides) {
|
|
461
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
462
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_6;
|
|
463
|
+
return __generator(this, function (_c) {
|
|
464
|
+
switch (_c.label) {
|
|
465
|
+
case 0:
|
|
466
|
+
if (requestParameters['cartId'] == null) {
|
|
467
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCartSubCartLines().');
|
|
468
|
+
}
|
|
469
|
+
if (requestParameters['subCartId'] == null) {
|
|
470
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling getCartSubCartLines().');
|
|
471
|
+
}
|
|
472
|
+
queryParameters = {};
|
|
473
|
+
headerParameters = {};
|
|
474
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
475
|
+
_a = headerParameters;
|
|
476
|
+
_b = "x-api-key";
|
|
477
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
478
|
+
case 1:
|
|
479
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
480
|
+
_c.label = 2;
|
|
481
|
+
case 2:
|
|
482
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
483
|
+
token = this.configuration.accessToken;
|
|
484
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
485
|
+
case 3:
|
|
486
|
+
tokenString = _c.sent();
|
|
487
|
+
if (tokenString) {
|
|
488
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
489
|
+
}
|
|
490
|
+
_c.label = 4;
|
|
491
|
+
case 4:
|
|
492
|
+
_c.trys.push([4, 6, , 7]);
|
|
493
|
+
return [4 /*yield*/, this.request({
|
|
494
|
+
path: "/carts/{cartId}/sub-carts/{subCartId}/lines".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
|
|
495
|
+
method: 'GET',
|
|
496
|
+
headers: headerParameters,
|
|
497
|
+
query: queryParameters,
|
|
498
|
+
}, initOverrides)];
|
|
499
|
+
case 5:
|
|
500
|
+
response = _c.sent();
|
|
501
|
+
contentType = response.headers.get("content-type");
|
|
502
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
503
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.CartSubCartLineFromJSON); })];
|
|
504
|
+
}
|
|
505
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
506
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
// TODO : Better handling of others application types
|
|
510
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
511
|
+
}
|
|
512
|
+
return [3 /*break*/, 7];
|
|
513
|
+
case 6:
|
|
514
|
+
response_6 = _c.sent();
|
|
515
|
+
console.debug(response_6);
|
|
516
|
+
throw response_6;
|
|
517
|
+
case 7: return [2 /*return*/];
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* Get all cart lines for a SubCart
|
|
524
|
+
*/
|
|
525
|
+
ManageCartSubCartLineApi.prototype.getCartSubCartLines = function (requestParameters, initOverrides) {
|
|
526
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
527
|
+
var response;
|
|
528
|
+
return __generator(this, function (_a) {
|
|
529
|
+
switch (_a.label) {
|
|
530
|
+
case 0: return [4 /*yield*/, this.getCartSubCartLinesRaw(requestParameters, initOverrides)];
|
|
531
|
+
case 1:
|
|
532
|
+
response = _a.sent();
|
|
533
|
+
return [4 /*yield*/, response.value()];
|
|
534
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
});
|
|
538
|
+
};
|
|
222
539
|
/**
|
|
223
540
|
* Get user cart line
|
|
224
541
|
*/
|
|
225
542
|
ManageCartSubCartLineApi.prototype.getCurrentCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
226
543
|
return __awaiter(this, void 0, void 0, function () {
|
|
227
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType,
|
|
544
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_7;
|
|
228
545
|
return __generator(this, function (_c) {
|
|
229
546
|
switch (_c.label) {
|
|
230
547
|
case 0:
|
|
@@ -276,9 +593,9 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
276
593
|
}
|
|
277
594
|
return [3 /*break*/, 7];
|
|
278
595
|
case 6:
|
|
279
|
-
|
|
280
|
-
console.debug(
|
|
281
|
-
throw
|
|
596
|
+
response_7 = _c.sent();
|
|
597
|
+
console.debug(response_7);
|
|
598
|
+
throw response_7;
|
|
282
599
|
case 7: return [2 /*return*/];
|
|
283
600
|
}
|
|
284
601
|
});
|
|
@@ -306,7 +623,7 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
306
623
|
*/
|
|
307
624
|
ManageCartSubCartLineApi.prototype.getCurrentCartSubCartLinesRaw = function (requestParameters, initOverrides) {
|
|
308
625
|
return __awaiter(this, void 0, void 0, function () {
|
|
309
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType,
|
|
626
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_8;
|
|
310
627
|
return __generator(this, function (_c) {
|
|
311
628
|
switch (_c.label) {
|
|
312
629
|
case 0:
|
|
@@ -355,9 +672,9 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
355
672
|
}
|
|
356
673
|
return [3 /*break*/, 7];
|
|
357
674
|
case 6:
|
|
358
|
-
|
|
359
|
-
console.debug(
|
|
360
|
-
throw
|
|
675
|
+
response_8 = _c.sent();
|
|
676
|
+
console.debug(response_8);
|
|
677
|
+
throw response_8;
|
|
361
678
|
case 7: return [2 /*return*/];
|
|
362
679
|
}
|
|
363
680
|
});
|
|
@@ -380,12 +697,102 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
380
697
|
});
|
|
381
698
|
});
|
|
382
699
|
};
|
|
700
|
+
/**
|
|
701
|
+
* Update user cart line
|
|
702
|
+
*/
|
|
703
|
+
ManageCartSubCartLineApi.prototype.updateCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
704
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
705
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_9;
|
|
706
|
+
return __generator(this, function (_c) {
|
|
707
|
+
switch (_c.label) {
|
|
708
|
+
case 0:
|
|
709
|
+
if (requestParameters['cartId'] == null) {
|
|
710
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling updateCartSubCartLine().');
|
|
711
|
+
}
|
|
712
|
+
if (requestParameters['subCartId'] == null) {
|
|
713
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling updateCartSubCartLine().');
|
|
714
|
+
}
|
|
715
|
+
if (requestParameters['lineId'] == null) {
|
|
716
|
+
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling updateCartSubCartLine().');
|
|
717
|
+
}
|
|
718
|
+
if (requestParameters['cartSubCartLineUpdateParameters'] == null) {
|
|
719
|
+
throw new runtime.RequiredError('cartSubCartLineUpdateParameters', 'Required parameter "cartSubCartLineUpdateParameters" was null or undefined when calling updateCartSubCartLine().');
|
|
720
|
+
}
|
|
721
|
+
queryParameters = {};
|
|
722
|
+
headerParameters = {};
|
|
723
|
+
headerParameters['Content-Type'] = 'application/merge-patch+json';
|
|
724
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
725
|
+
_a = headerParameters;
|
|
726
|
+
_b = "x-api-key";
|
|
727
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
728
|
+
case 1:
|
|
729
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
730
|
+
_c.label = 2;
|
|
731
|
+
case 2:
|
|
732
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
733
|
+
token = this.configuration.accessToken;
|
|
734
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
735
|
+
case 3:
|
|
736
|
+
tokenString = _c.sent();
|
|
737
|
+
if (tokenString) {
|
|
738
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
739
|
+
}
|
|
740
|
+
_c.label = 4;
|
|
741
|
+
case 4:
|
|
742
|
+
_c.trys.push([4, 6, , 7]);
|
|
743
|
+
return [4 /*yield*/, this.request({
|
|
744
|
+
path: "/carts/{cartId}/sub-carts/{subCartId}/lines/{lineId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
745
|
+
method: 'PATCH',
|
|
746
|
+
headers: headerParameters,
|
|
747
|
+
query: queryParameters,
|
|
748
|
+
body: (0, index_1.CartSubCartLineUpdateParametersToJSON)(requestParameters['cartSubCartLineUpdateParameters']),
|
|
749
|
+
}, initOverrides)];
|
|
750
|
+
case 5:
|
|
751
|
+
response = _c.sent();
|
|
752
|
+
contentType = response.headers.get("content-type");
|
|
753
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
754
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartSubCartLineFromJSON)(jsonValue); })];
|
|
755
|
+
}
|
|
756
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
757
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
758
|
+
}
|
|
759
|
+
else {
|
|
760
|
+
// TODO : Better handling of others application types
|
|
761
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
762
|
+
}
|
|
763
|
+
return [3 /*break*/, 7];
|
|
764
|
+
case 6:
|
|
765
|
+
response_9 = _c.sent();
|
|
766
|
+
console.debug(response_9);
|
|
767
|
+
throw response_9;
|
|
768
|
+
case 7: return [2 /*return*/];
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
});
|
|
772
|
+
};
|
|
773
|
+
/**
|
|
774
|
+
* Update user cart line
|
|
775
|
+
*/
|
|
776
|
+
ManageCartSubCartLineApi.prototype.updateCartSubCartLine = function (requestParameters, initOverrides) {
|
|
777
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
778
|
+
var response;
|
|
779
|
+
return __generator(this, function (_a) {
|
|
780
|
+
switch (_a.label) {
|
|
781
|
+
case 0: return [4 /*yield*/, this.updateCartSubCartLineRaw(requestParameters, initOverrides)];
|
|
782
|
+
case 1:
|
|
783
|
+
response = _a.sent();
|
|
784
|
+
return [4 /*yield*/, response.value()];
|
|
785
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
});
|
|
789
|
+
};
|
|
383
790
|
/**
|
|
384
791
|
* Update user cart line
|
|
385
792
|
*/
|
|
386
793
|
ManageCartSubCartLineApi.prototype.updateCurrentCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
387
794
|
return __awaiter(this, void 0, void 0, function () {
|
|
388
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType,
|
|
795
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_10;
|
|
389
796
|
return __generator(this, function (_c) {
|
|
390
797
|
switch (_c.label) {
|
|
391
798
|
case 0:
|
|
@@ -442,9 +849,9 @@ var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
|
442
849
|
}
|
|
443
850
|
return [3 /*break*/, 7];
|
|
444
851
|
case 6:
|
|
445
|
-
|
|
446
|
-
console.debug(
|
|
447
|
-
throw
|
|
852
|
+
response_10 = _c.sent();
|
|
853
|
+
console.debug(response_10);
|
|
854
|
+
throw response_10;
|
|
448
855
|
case 7: return [2 /*return*/];
|
|
449
856
|
}
|
|
450
857
|
});
|