@lcdp/api-react-rest-client 3.1.9 → 3.1.10
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/auth/src/models/RestError.d.ts +3 -5
- package/auth/src/models/RestError.js +3 -5
- package/catalog/src/models/RestError.d.ts +3 -5
- package/catalog/src/models/RestError.js +3 -5
- package/chargebee-hook/src/models/RestError.d.ts +3 -5
- package/chargebee-hook/src/models/RestError.js +3 -5
- package/configuration/src/models/RestError.d.ts +3 -5
- package/configuration/src/models/RestError.js +3 -5
- package/content/src/models/RestError.d.ts +3 -5
- package/content/src/models/RestError.js +3 -5
- package/favorite/src/models/RestError.d.ts +3 -5
- package/favorite/src/models/RestError.js +3 -5
- package/inventory/src/models/RestError.d.ts +3 -5
- package/inventory/src/models/RestError.js +3 -5
- package/invoice/src/models/RestError.d.ts +3 -5
- package/invoice/src/models/RestError.js +3 -5
- package/laboratory-store/src/models/RestError.d.ts +3 -5
- package/laboratory-store/src/models/RestError.js +3 -5
- package/lexicon/src/models/RestError.d.ts +3 -5
- package/lexicon/src/models/RestError.js +3 -5
- package/litigation/src/models/RestError.d.ts +3 -5
- package/litigation/src/models/RestError.js +3 -5
- package/magic-cart/src/models/ExpressOrder.d.ts +4 -4
- package/magic-cart/src/models/ExpressOrder.js +7 -3
- package/magic-cart/src/models/ShoppedOffer.d.ts +43 -0
- package/magic-cart/src/models/ShoppedOffer.js +53 -0
- package/magic-cart/src/models/index.d.ts +1 -2
- package/magic-cart/src/models/index.js +1 -2
- package/mangopay-hook/src/models/RestError.d.ts +3 -5
- package/mangopay-hook/src/models/RestError.js +3 -5
- package/notification/src/models/NotificationTypeId.d.ts +0 -1
- package/notification/src/models/NotificationTypeId.js +0 -1
- package/notification/src/models/RestError.d.ts +3 -5
- package/notification/src/models/RestError.js +3 -5
- package/order/src/apis/ManageForeorderApi.d.ts +31 -0
- package/order/src/apis/ManageForeorderApi.js +163 -0
- package/order/src/apis/ManageOrderApi.d.ts +9 -9
- package/order/src/apis/ManageOrderApi.js +12 -13
- package/order/src/apis/SearchForeorderItemApi.d.ts +44 -0
- package/order/src/apis/SearchForeorderItemApi.js +175 -0
- package/order/src/apis/index.d.ts +2 -1
- package/order/src/apis/index.js +2 -1
- package/order/src/models/AnyForeorderCreationParameters.d.ts +23 -0
- package/order/src/models/AnyForeorderCreationParameters.js +45 -0
- package/order/src/models/AnyForeorderWarning.d.ts +26 -0
- package/order/src/models/AnyForeorderWarning.js +50 -0
- package/order/src/models/AnyOrderCreationParameters.d.ts +26 -0
- package/order/src/models/AnyOrderCreationParameters.js +50 -0
- package/order/src/models/AnySource.d.ts +26 -0
- package/order/src/models/AnySource.js +50 -0
- package/order/src/models/CartForeorderCreationParameters.d.ts +37 -0
- package/order/src/models/CartForeorderCreationParameters.js +51 -0
- package/order/src/models/CartSource.d.ts +37 -0
- package/order/src/models/CartSource.js +49 -0
- package/order/src/models/CloneOrderCreationParameters.d.ts +37 -0
- package/order/src/models/CloneOrderCreationParameters.js +51 -0
- package/order/src/models/Foreorder.d.ts +155 -0
- package/order/src/models/Foreorder.js +128 -0
- package/order/src/models/ForeorderCreationParameters.d.ts +31 -0
- package/order/src/models/ForeorderCreationParameters.js +47 -0
- package/order/src/models/ForeorderItemWarning.d.ts +77 -0
- package/order/src/models/{OrderItemWarning.js → ForeorderItemWarning.js} +21 -18
- package/order/src/models/ForeorderOrderCreationParameters.d.ts +37 -0
- package/order/src/models/ForeorderOrderCreationParameters.js +51 -0
- package/order/src/models/ForeorderWarning.d.ts +51 -0
- package/order/src/models/{OrderWarning.js → ForeorderWarning.js} +12 -12
- package/order/src/models/ForeorderWarningBase.d.ts +37 -0
- package/order/src/models/ForeorderWarningBase.js +51 -0
- package/order/src/models/ForeordersWithWarnings.d.ts +39 -0
- package/order/src/models/ForeordersWithWarnings.js +53 -0
- package/order/src/models/Order.d.ts +80 -75
- package/order/src/models/Order.js +53 -48
- package/order/src/models/OrderAddedItem.d.ts +9 -9
- package/order/src/models/OrderAddedItem.js +18 -0
- package/order/src/models/OrderCreationParameters.d.ts +31 -0
- package/order/src/models/OrderCreationParameters.js +47 -0
- package/order/src/models/OrderItem.d.ts +9 -9
- package/order/src/models/OrderItem.js +18 -0
- package/order/src/models/OrderItemPrices.d.ts +8 -8
- package/order/src/models/OrderItemPrices.js +10 -0
- package/order/src/models/OrderPrices.d.ts +9 -9
- package/order/src/models/OrderPrices.js +18 -0
- package/order/src/models/OrderRefundedItem.d.ts +9 -9
- package/order/src/models/OrderRefundedItem.js +18 -0
- package/order/src/models/OrderRemovedItem.d.ts +9 -9
- package/order/src/models/OrderRemovedItem.js +18 -0
- package/order/src/models/OrderSource.d.ts +37 -0
- package/order/src/models/OrderSource.js +49 -0
- package/order/src/models/Reservation.d.ts +7 -7
- package/order/src/models/Reservation.js +14 -0
- package/order/src/models/RestError.d.ts +3 -5
- package/order/src/models/RestError.js +3 -5
- package/order/src/models/ShoppedOffer.d.ts +2 -2
- package/order/src/models/ShoppedOffer.js +2 -2
- package/order/src/models/Source.d.ts +31 -0
- package/order/src/models/Source.js +45 -0
- package/order/src/models/index.d.ts +17 -9
- package/order/src/models/index.js +17 -9
- package/package.json +1 -1
- package/product/src/models/RestError.d.ts +3 -5
- package/product/src/models/RestError.js +3 -5
- package/pub/src/models/RestError.d.ts +3 -5
- package/pub/src/models/RestError.js +3 -5
- package/rfx/src/models/RestError.d.ts +3 -5
- package/rfx/src/models/RestError.js +3 -5
- package/sale-offer/src/models/RestError.d.ts +3 -5
- package/sale-offer/src/models/RestError.js +3 -5
- package/servant/src/models/RestError.d.ts +3 -5
- package/servant/src/models/RestError.js +3 -5
- package/shipment/src/models/RestError.d.ts +3 -5
- package/shipment/src/models/RestError.js +3 -5
- package/shopping-cart/src/apis/ManageCartApi.d.ts +35 -24
- package/shopping-cart/src/apis/ManageCartApi.js +57 -120
- package/shopping-cart/src/apis/ManageCartLineApi.d.ts +45 -0
- package/shopping-cart/src/apis/ManageCartLineApi.js +238 -0
- package/shopping-cart/src/apis/SearchCartApi.d.ts +59 -0
- package/shopping-cart/src/apis/SearchCartApi.js +267 -0
- package/shopping-cart/src/apis/SearchCartLineApi.d.ts +41 -0
- package/{order/src/apis/ManageMetaOrderApi.js → shopping-cart/src/apis/SearchCartLineApi.js} +46 -41
- package/shopping-cart/src/apis/index.d.ts +3 -2
- package/shopping-cart/src/apis/index.js +3 -2
- package/shopping-cart/src/models/Cart.d.ts +61 -4
- package/shopping-cart/src/models/Cart.js +47 -2
- package/shopping-cart/src/models/CartCreationParameters.d.ts +44 -0
- package/shopping-cart/src/models/CartCreationParameters.js +56 -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/CartLineUpdateParameters.d.ts +37 -0
- package/shopping-cart/src/models/CartLineUpdateParameters.js +49 -0
- package/shopping-cart/src/models/CartLineWithWarnings.d.ts +39 -0
- package/shopping-cart/src/models/CartLineWithWarnings.js +49 -0
- package/shopping-cart/src/models/CartSummary.d.ts +31 -0
- package/shopping-cart/src/models/CartSummary.js +47 -0
- package/shopping-cart/src/models/{CartSubCartTransport.d.ts → CartTransport.d.ts} +12 -12
- package/shopping-cart/src/models/{CartSubCartTransport.js → CartTransport.js} +11 -11
- package/shopping-cart/src/models/CartUpdateParameters.d.ts +31 -0
- package/shopping-cart/src/models/CartUpdateParameters.js +45 -0
- package/shopping-cart/src/models/CartWarning.d.ts +76 -0
- package/shopping-cart/src/models/CartWarning.js +69 -0
- package/shopping-cart/src/models/CartsWithWarnings.d.ts +39 -0
- package/shopping-cart/src/models/CartsWithWarnings.js +49 -0
- package/shopping-cart/src/models/OwnerLink.d.ts +43 -0
- package/shopping-cart/src/models/OwnerLink.js +53 -0
- 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/RestError.d.ts +3 -5
- package/shopping-cart/src/models/RestError.js +3 -5
- package/shopping-cart/src/models/ShoppedOffer.d.ts +2 -2
- package/shopping-cart/src/models/ShoppedOffer.js +2 -2
- package/shopping-cart/src/models/index.d.ts +12 -4
- package/shopping-cart/src/models/index.js +12 -4
- package/smuggler/src/models/RestError.d.ts +3 -5
- package/smuggler/src/models/RestError.js +3 -5
- package/statistic/src/models/RestError.d.ts +3 -5
- package/statistic/src/models/RestError.js +3 -5
- package/third-party/src/models/RestError.d.ts +3 -5
- package/third-party/src/models/RestError.js +3 -5
- package/ubo/src/apis/ManageUboDeclarationApi.d.ts +2 -2
- package/ubo/src/apis/ManageUboDeclarationApi.js +2 -2
- package/ubo/src/models/RestError.d.ts +3 -5
- package/ubo/src/models/RestError.js +3 -5
- package/user/src/models/NotificationTypeId.d.ts +0 -1
- package/user/src/models/NotificationTypeId.js +0 -1
- package/user/src/models/RestError.d.ts +3 -5
- package/user/src/models/RestError.js +3 -5
- package/user/src/models/User.d.ts +7 -0
- package/user/src/models/User.js +3 -0
- package/user/src/models/UserMangopayUbo.d.ts +31 -0
- package/user/src/models/UserMangopayUbo.js +45 -0
- package/user/src/models/index.d.ts +1 -0
- package/user/src/models/index.js +1 -0
- package/wish/src/models/RestError.d.ts +3 -5
- package/wish/src/models/RestError.js +3 -5
- package/magic-cart/src/models/SaleOfferProposal.d.ts +0 -51
- package/magic-cart/src/models/SaleOfferProposal.js +0 -61
- package/magic-cart/src/models/SellerProposal.d.ts +0 -45
- package/magic-cart/src/models/SellerProposal.js +0 -57
- package/order/src/apis/ManageMetaOrderApi.d.ts +0 -45
- package/order/src/models/AnyMetaOrderWarning.d.ts +0 -26
- package/order/src/models/AnyMetaOrderWarning.js +0 -50
- 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/MetaOrderWarning.js +0 -47
- package/order/src/models/MetaOrderWithWarnings.d.ts +0 -39
- package/order/src/models/MetaOrderWithWarnings.js +0 -49
- package/order/src/models/OrderItemWarning.d.ts +0 -72
- package/order/src/models/OrderWarning.d.ts +0 -51
- package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +0 -107
- package/shopping-cart/src/apis/ManageCartSubCartApi.js +0 -556
- 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
|
@@ -1,879 +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.ManageCartSubCartLineApi = void 0;
|
|
68
|
-
var runtime = require("../runtime");
|
|
69
|
-
var index_1 = require("../models/index");
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
*/
|
|
73
|
-
var ManageCartSubCartLineApi = /** @class */ (function (_super) {
|
|
74
|
-
__extends(ManageCartSubCartLineApi, _super);
|
|
75
|
-
function ManageCartSubCartLineApi() {
|
|
76
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
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
|
|
81
|
-
*/
|
|
82
|
-
ManageCartSubCartLineApi.prototype.createOrUpdateCartSubCartLinesRaw = function (requestParameters, initOverrides) {
|
|
83
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_1;
|
|
85
|
-
return __generator(this, function (_c) {
|
|
86
|
-
switch (_c.label) {
|
|
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
|
-
}
|
|
91
|
-
if (requestParameters['subCartId'] == null) {
|
|
92
|
-
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling createOrUpdateCartSubCartLines().');
|
|
93
|
-
}
|
|
94
|
-
if (requestParameters['shoppedOffer'] == null) {
|
|
95
|
-
throw new runtime.RequiredError('shoppedOffer', 'Required parameter "shoppedOffer" was null or undefined when calling createOrUpdateCartSubCartLines().');
|
|
96
|
-
}
|
|
97
|
-
queryParameters = {};
|
|
98
|
-
headerParameters = {};
|
|
99
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
100
|
-
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
101
|
-
_a = headerParameters;
|
|
102
|
-
_b = "x-api-key";
|
|
103
|
-
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
104
|
-
case 1:
|
|
105
|
-
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
106
|
-
_c.label = 2;
|
|
107
|
-
case 2:
|
|
108
|
-
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
109
|
-
token = this.configuration.accessToken;
|
|
110
|
-
return [4 /*yield*/, token("bearerAuth", [])];
|
|
111
|
-
case 3:
|
|
112
|
-
tokenString = _c.sent();
|
|
113
|
-
if (tokenString) {
|
|
114
|
-
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
115
|
-
}
|
|
116
|
-
_c.label = 4;
|
|
117
|
-
case 4:
|
|
118
|
-
_c.trys.push([4, 6, , 7]);
|
|
119
|
-
return [4 /*yield*/, this.request({
|
|
120
|
-
path: "/carts/{cartId}/sub-carts/{subCartId}/lines".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
|
|
121
|
-
method: 'POST',
|
|
122
|
-
headers: headerParameters,
|
|
123
|
-
query: queryParameters,
|
|
124
|
-
body: (0, index_1.ShoppedOfferToJSON)(requestParameters['shoppedOffer']),
|
|
125
|
-
}, initOverrides)];
|
|
126
|
-
case 5:
|
|
127
|
-
response = _c.sent();
|
|
128
|
-
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
129
|
-
case 6:
|
|
130
|
-
response_1 = _c.sent();
|
|
131
|
-
console.debug(response_1);
|
|
132
|
-
throw response_1;
|
|
133
|
-
case 7: return [2 /*return*/];
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
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
|
-
};
|
|
211
|
-
/**
|
|
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
|
|
213
|
-
* Create or update a cart line if its already exist
|
|
214
|
-
*/
|
|
215
|
-
ManageCartSubCartLineApi.prototype.createOrUpdateCurrentCartSubCartLines = function (requestParameters, initOverrides) {
|
|
216
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
217
|
-
return __generator(this, function (_a) {
|
|
218
|
-
switch (_a.label) {
|
|
219
|
-
case 0: return [4 /*yield*/, this.createOrUpdateCurrentCartSubCartLinesRaw(requestParameters, initOverrides)];
|
|
220
|
-
case 1:
|
|
221
|
-
_a.sent();
|
|
222
|
-
return [2 /*return*/];
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
});
|
|
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
|
-
};
|
|
301
|
-
/**
|
|
302
|
-
* Permit to delete a shopping cart line who is in current user shopping cart
|
|
303
|
-
* Delete user cart line
|
|
304
|
-
*/
|
|
305
|
-
ManageCartSubCartLineApi.prototype.deleteCurrentCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
306
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
307
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_4;
|
|
308
|
-
return __generator(this, function (_c) {
|
|
309
|
-
switch (_c.label) {
|
|
310
|
-
case 0:
|
|
311
|
-
if (requestParameters['subCartId'] == null) {
|
|
312
|
-
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling deleteCurrentCartSubCartLine().');
|
|
313
|
-
}
|
|
314
|
-
if (requestParameters['lineId'] == null) {
|
|
315
|
-
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling deleteCurrentCartSubCartLine().');
|
|
316
|
-
}
|
|
317
|
-
queryParameters = {};
|
|
318
|
-
headerParameters = {};
|
|
319
|
-
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
320
|
-
_a = headerParameters;
|
|
321
|
-
_b = "x-api-key";
|
|
322
|
-
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
323
|
-
case 1:
|
|
324
|
-
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
325
|
-
_c.label = 2;
|
|
326
|
-
case 2:
|
|
327
|
-
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
328
|
-
token = this.configuration.accessToken;
|
|
329
|
-
return [4 /*yield*/, token("bearerAuth", [])];
|
|
330
|
-
case 3:
|
|
331
|
-
tokenString = _c.sent();
|
|
332
|
-
if (tokenString) {
|
|
333
|
-
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
334
|
-
}
|
|
335
|
-
_c.label = 4;
|
|
336
|
-
case 4:
|
|
337
|
-
_c.trys.push([4, 6, , 7]);
|
|
338
|
-
return [4 /*yield*/, this.request({
|
|
339
|
-
path: "/carts/me/sub-carts/{subCartId}/lines/{lineId}".replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
340
|
-
method: 'DELETE',
|
|
341
|
-
headers: headerParameters,
|
|
342
|
-
query: queryParameters,
|
|
343
|
-
}, initOverrides)];
|
|
344
|
-
case 5:
|
|
345
|
-
response = _c.sent();
|
|
346
|
-
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
347
|
-
case 6:
|
|
348
|
-
response_4 = _c.sent();
|
|
349
|
-
console.debug(response_4);
|
|
350
|
-
throw response_4;
|
|
351
|
-
case 7: return [2 /*return*/];
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
};
|
|
356
|
-
/**
|
|
357
|
-
* Permit to delete a shopping cart line who is in current user shopping cart
|
|
358
|
-
* Delete user cart line
|
|
359
|
-
*/
|
|
360
|
-
ManageCartSubCartLineApi.prototype.deleteCurrentCartSubCartLine = function (requestParameters, initOverrides) {
|
|
361
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
362
|
-
return __generator(this, function (_a) {
|
|
363
|
-
switch (_a.label) {
|
|
364
|
-
case 0: return [4 /*yield*/, this.deleteCurrentCartSubCartLineRaw(requestParameters, initOverrides)];
|
|
365
|
-
case 1:
|
|
366
|
-
_a.sent();
|
|
367
|
-
return [2 /*return*/];
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
});
|
|
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
|
-
};
|
|
539
|
-
/**
|
|
540
|
-
* Get user cart line
|
|
541
|
-
*/
|
|
542
|
-
ManageCartSubCartLineApi.prototype.getCurrentCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
543
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
544
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_7;
|
|
545
|
-
return __generator(this, function (_c) {
|
|
546
|
-
switch (_c.label) {
|
|
547
|
-
case 0:
|
|
548
|
-
if (requestParameters['subCartId'] == null) {
|
|
549
|
-
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling getCurrentCartSubCartLine().');
|
|
550
|
-
}
|
|
551
|
-
if (requestParameters['lineId'] == null) {
|
|
552
|
-
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling getCurrentCartSubCartLine().');
|
|
553
|
-
}
|
|
554
|
-
queryParameters = {};
|
|
555
|
-
headerParameters = {};
|
|
556
|
-
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
557
|
-
_a = headerParameters;
|
|
558
|
-
_b = "x-api-key";
|
|
559
|
-
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
560
|
-
case 1:
|
|
561
|
-
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
562
|
-
_c.label = 2;
|
|
563
|
-
case 2:
|
|
564
|
-
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
565
|
-
token = this.configuration.accessToken;
|
|
566
|
-
return [4 /*yield*/, token("bearerAuth", [])];
|
|
567
|
-
case 3:
|
|
568
|
-
tokenString = _c.sent();
|
|
569
|
-
if (tokenString) {
|
|
570
|
-
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
571
|
-
}
|
|
572
|
-
_c.label = 4;
|
|
573
|
-
case 4:
|
|
574
|
-
_c.trys.push([4, 6, , 7]);
|
|
575
|
-
return [4 /*yield*/, this.request({
|
|
576
|
-
path: "/carts/me/sub-carts/{subCartId}/lines/{lineId}".replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
577
|
-
method: 'GET',
|
|
578
|
-
headers: headerParameters,
|
|
579
|
-
query: queryParameters,
|
|
580
|
-
}, initOverrides)];
|
|
581
|
-
case 5:
|
|
582
|
-
response = _c.sent();
|
|
583
|
-
contentType = response.headers.get("content-type");
|
|
584
|
-
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
585
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartSubCartLineFromJSON)(jsonValue); })];
|
|
586
|
-
}
|
|
587
|
-
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
588
|
-
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
// TODO : Better handling of others application types
|
|
592
|
-
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
593
|
-
}
|
|
594
|
-
return [3 /*break*/, 7];
|
|
595
|
-
case 6:
|
|
596
|
-
response_7 = _c.sent();
|
|
597
|
-
console.debug(response_7);
|
|
598
|
-
throw response_7;
|
|
599
|
-
case 7: return [2 /*return*/];
|
|
600
|
-
}
|
|
601
|
-
});
|
|
602
|
-
});
|
|
603
|
-
};
|
|
604
|
-
/**
|
|
605
|
-
* Get user cart line
|
|
606
|
-
*/
|
|
607
|
-
ManageCartSubCartLineApi.prototype.getCurrentCartSubCartLine = function (requestParameters, initOverrides) {
|
|
608
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
609
|
-
var response;
|
|
610
|
-
return __generator(this, function (_a) {
|
|
611
|
-
switch (_a.label) {
|
|
612
|
-
case 0: return [4 /*yield*/, this.getCurrentCartSubCartLineRaw(requestParameters, initOverrides)];
|
|
613
|
-
case 1:
|
|
614
|
-
response = _a.sent();
|
|
615
|
-
return [4 /*yield*/, response.value()];
|
|
616
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
});
|
|
620
|
-
};
|
|
621
|
-
/**
|
|
622
|
-
* Get all cart lines for a SubCart
|
|
623
|
-
*/
|
|
624
|
-
ManageCartSubCartLineApi.prototype.getCurrentCartSubCartLinesRaw = function (requestParameters, initOverrides) {
|
|
625
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
626
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_8;
|
|
627
|
-
return __generator(this, function (_c) {
|
|
628
|
-
switch (_c.label) {
|
|
629
|
-
case 0:
|
|
630
|
-
if (requestParameters['subCartId'] == null) {
|
|
631
|
-
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling getCurrentCartSubCartLines().');
|
|
632
|
-
}
|
|
633
|
-
queryParameters = {};
|
|
634
|
-
headerParameters = {};
|
|
635
|
-
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
636
|
-
_a = headerParameters;
|
|
637
|
-
_b = "x-api-key";
|
|
638
|
-
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
639
|
-
case 1:
|
|
640
|
-
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
641
|
-
_c.label = 2;
|
|
642
|
-
case 2:
|
|
643
|
-
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
644
|
-
token = this.configuration.accessToken;
|
|
645
|
-
return [4 /*yield*/, token("bearerAuth", [])];
|
|
646
|
-
case 3:
|
|
647
|
-
tokenString = _c.sent();
|
|
648
|
-
if (tokenString) {
|
|
649
|
-
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
650
|
-
}
|
|
651
|
-
_c.label = 4;
|
|
652
|
-
case 4:
|
|
653
|
-
_c.trys.push([4, 6, , 7]);
|
|
654
|
-
return [4 /*yield*/, this.request({
|
|
655
|
-
path: "/carts/me/sub-carts/{subCartId}/lines".replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
|
|
656
|
-
method: 'GET',
|
|
657
|
-
headers: headerParameters,
|
|
658
|
-
query: queryParameters,
|
|
659
|
-
}, initOverrides)];
|
|
660
|
-
case 5:
|
|
661
|
-
response = _c.sent();
|
|
662
|
-
contentType = response.headers.get("content-type");
|
|
663
|
-
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
664
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.CartSubCartLineFromJSON); })];
|
|
665
|
-
}
|
|
666
|
-
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
667
|
-
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
668
|
-
}
|
|
669
|
-
else {
|
|
670
|
-
// TODO : Better handling of others application types
|
|
671
|
-
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
672
|
-
}
|
|
673
|
-
return [3 /*break*/, 7];
|
|
674
|
-
case 6:
|
|
675
|
-
response_8 = _c.sent();
|
|
676
|
-
console.debug(response_8);
|
|
677
|
-
throw response_8;
|
|
678
|
-
case 7: return [2 /*return*/];
|
|
679
|
-
}
|
|
680
|
-
});
|
|
681
|
-
});
|
|
682
|
-
};
|
|
683
|
-
/**
|
|
684
|
-
* Get all cart lines for a SubCart
|
|
685
|
-
*/
|
|
686
|
-
ManageCartSubCartLineApi.prototype.getCurrentCartSubCartLines = function (requestParameters, initOverrides) {
|
|
687
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
688
|
-
var response;
|
|
689
|
-
return __generator(this, function (_a) {
|
|
690
|
-
switch (_a.label) {
|
|
691
|
-
case 0: return [4 /*yield*/, this.getCurrentCartSubCartLinesRaw(requestParameters, initOverrides)];
|
|
692
|
-
case 1:
|
|
693
|
-
response = _a.sent();
|
|
694
|
-
return [4 /*yield*/, response.value()];
|
|
695
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
});
|
|
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
|
-
};
|
|
790
|
-
/**
|
|
791
|
-
* Update user cart line
|
|
792
|
-
*/
|
|
793
|
-
ManageCartSubCartLineApi.prototype.updateCurrentCartSubCartLineRaw = function (requestParameters, initOverrides) {
|
|
794
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
795
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_10;
|
|
796
|
-
return __generator(this, function (_c) {
|
|
797
|
-
switch (_c.label) {
|
|
798
|
-
case 0:
|
|
799
|
-
if (requestParameters['subCartId'] == null) {
|
|
800
|
-
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling updateCurrentCartSubCartLine().');
|
|
801
|
-
}
|
|
802
|
-
if (requestParameters['lineId'] == null) {
|
|
803
|
-
throw new runtime.RequiredError('lineId', 'Required parameter "lineId" was null or undefined when calling updateCurrentCartSubCartLine().');
|
|
804
|
-
}
|
|
805
|
-
if (requestParameters['cartSubCartLineUpdateParameters'] == null) {
|
|
806
|
-
throw new runtime.RequiredError('cartSubCartLineUpdateParameters', 'Required parameter "cartSubCartLineUpdateParameters" was null or undefined when calling updateCurrentCartSubCartLine().');
|
|
807
|
-
}
|
|
808
|
-
queryParameters = {};
|
|
809
|
-
headerParameters = {};
|
|
810
|
-
headerParameters['Content-Type'] = 'application/merge-patch+json';
|
|
811
|
-
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
812
|
-
_a = headerParameters;
|
|
813
|
-
_b = "x-api-key";
|
|
814
|
-
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
815
|
-
case 1:
|
|
816
|
-
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
817
|
-
_c.label = 2;
|
|
818
|
-
case 2:
|
|
819
|
-
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
820
|
-
token = this.configuration.accessToken;
|
|
821
|
-
return [4 /*yield*/, token("bearerAuth", [])];
|
|
822
|
-
case 3:
|
|
823
|
-
tokenString = _c.sent();
|
|
824
|
-
if (tokenString) {
|
|
825
|
-
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
826
|
-
}
|
|
827
|
-
_c.label = 4;
|
|
828
|
-
case 4:
|
|
829
|
-
_c.trys.push([4, 6, , 7]);
|
|
830
|
-
return [4 /*yield*/, this.request({
|
|
831
|
-
path: "/carts/me/sub-carts/{subCartId}/lines/{lineId}".replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))).replace("{".concat("lineId", "}"), encodeURIComponent(String(requestParameters['lineId']))),
|
|
832
|
-
method: 'PATCH',
|
|
833
|
-
headers: headerParameters,
|
|
834
|
-
query: queryParameters,
|
|
835
|
-
body: (0, index_1.CartSubCartLineUpdateParametersToJSON)(requestParameters['cartSubCartLineUpdateParameters']),
|
|
836
|
-
}, initOverrides)];
|
|
837
|
-
case 5:
|
|
838
|
-
response = _c.sent();
|
|
839
|
-
contentType = response.headers.get("content-type");
|
|
840
|
-
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
841
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartSubCartLineFromJSON)(jsonValue); })];
|
|
842
|
-
}
|
|
843
|
-
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
844
|
-
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
845
|
-
}
|
|
846
|
-
else {
|
|
847
|
-
// TODO : Better handling of others application types
|
|
848
|
-
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
849
|
-
}
|
|
850
|
-
return [3 /*break*/, 7];
|
|
851
|
-
case 6:
|
|
852
|
-
response_10 = _c.sent();
|
|
853
|
-
console.debug(response_10);
|
|
854
|
-
throw response_10;
|
|
855
|
-
case 7: return [2 /*return*/];
|
|
856
|
-
}
|
|
857
|
-
});
|
|
858
|
-
});
|
|
859
|
-
};
|
|
860
|
-
/**
|
|
861
|
-
* Update user cart line
|
|
862
|
-
*/
|
|
863
|
-
ManageCartSubCartLineApi.prototype.updateCurrentCartSubCartLine = function (requestParameters, initOverrides) {
|
|
864
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
865
|
-
var response;
|
|
866
|
-
return __generator(this, function (_a) {
|
|
867
|
-
switch (_a.label) {
|
|
868
|
-
case 0: return [4 /*yield*/, this.updateCurrentCartSubCartLineRaw(requestParameters, initOverrides)];
|
|
869
|
-
case 1:
|
|
870
|
-
response = _a.sent();
|
|
871
|
-
return [4 /*yield*/, response.value()];
|
|
872
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
873
|
-
}
|
|
874
|
-
});
|
|
875
|
-
});
|
|
876
|
-
};
|
|
877
|
-
return ManageCartSubCartLineApi;
|
|
878
|
-
}(runtime.BaseAPI));
|
|
879
|
-
exports.ManageCartSubCartLineApi = ManageCartSubCartLineApi;
|