@lcdp/api-react-rest-client 3.0.10 → 3.0.11
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/mandate/src/apis/ManageMandatesApi.d.ts +33 -11
- package/mandate/src/apis/ManageMandatesApi.js +164 -19
- package/mandate/src/models/MandateCreationParameters.d.ts +8 -2
- package/mandate/src/models/MandateCreationParameters.js +8 -0
- package/package.json +1 -1
- package/sale-offer/src/models/SaleOfferJournal.d.ts +6 -0
- package/sale-offer/src/models/SaleOfferJournal.js +4 -0
- package/sale-offer/src/models/SaleOfferStatusReason.d.ts +2 -0
- package/sale-offer/src/models/SaleOfferStatusReason.js +2 -0
- package/sale-offer-log/src/models/SaleOfferLog.d.ts +13 -0
- package/sale-offer-log/src/models/SaleOfferLog.js +9 -0
- package/sale-offer-log/src/models/SaleOfferStatusReason.d.ts +30 -0
- package/sale-offer-log/src/models/SaleOfferStatusReason.js +53 -0
- package/sale-offer-log/src/models/index.d.ts +1 -0
- package/sale-offer-log/src/models/index.js +1 -0
- 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
- package/user/src/apis/SearchUserApi.d.ts +1 -0
- package/user/src/apis/SearchUserApi.js +3 -0
|
@@ -11,10 +11,24 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import type { Cart } from '../models/index';
|
|
14
|
+
export interface CreateCartRequest {
|
|
15
|
+
cartId: number;
|
|
16
|
+
}
|
|
17
|
+
export interface GetCartRequest {
|
|
18
|
+
cartId: number;
|
|
19
|
+
}
|
|
14
20
|
/**
|
|
15
21
|
*
|
|
16
22
|
*/
|
|
17
23
|
export declare class ManageCartApi extends runtime.BaseAPI {
|
|
24
|
+
/**
|
|
25
|
+
* Create current cart if get cart return object not found
|
|
26
|
+
*/
|
|
27
|
+
createCartRaw(requestParameters: CreateCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Cart | runtime.BlobWithMeta>>;
|
|
28
|
+
/**
|
|
29
|
+
* Create current cart if get cart return object not found
|
|
30
|
+
*/
|
|
31
|
+
createCart(requestParameters: CreateCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Cart | runtime.BlobWithMeta>;
|
|
18
32
|
/**
|
|
19
33
|
* Create current cart if get cart return object not found
|
|
20
34
|
*/
|
|
@@ -23,6 +37,14 @@ export declare class ManageCartApi extends runtime.BaseAPI {
|
|
|
23
37
|
* Create current cart if get cart return object not found
|
|
24
38
|
*/
|
|
25
39
|
createCurrentCart(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Cart | runtime.BlobWithMeta>;
|
|
40
|
+
/**
|
|
41
|
+
* Get current cart
|
|
42
|
+
*/
|
|
43
|
+
getCartRaw(requestParameters: GetCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Cart | runtime.BlobWithMeta>>;
|
|
44
|
+
/**
|
|
45
|
+
* Get current cart
|
|
46
|
+
*/
|
|
47
|
+
getCart(requestParameters: GetCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Cart | runtime.BlobWithMeta>;
|
|
26
48
|
/**
|
|
27
49
|
* Get current cart
|
|
28
50
|
*/
|
|
@@ -78,12 +78,15 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
78
78
|
/**
|
|
79
79
|
* Create current cart if get cart return object not found
|
|
80
80
|
*/
|
|
81
|
-
ManageCartApi.prototype.
|
|
81
|
+
ManageCartApi.prototype.createCartRaw = function (requestParameters, initOverrides) {
|
|
82
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
83
83
|
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_1;
|
|
84
84
|
return __generator(this, function (_c) {
|
|
85
85
|
switch (_c.label) {
|
|
86
86
|
case 0:
|
|
87
|
+
if (requestParameters['cartId'] == null) {
|
|
88
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling createCart().');
|
|
89
|
+
}
|
|
87
90
|
queryParameters = {};
|
|
88
91
|
headerParameters = {};
|
|
89
92
|
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
@@ -106,7 +109,7 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
106
109
|
case 4:
|
|
107
110
|
_c.trys.push([4, 6, , 7]);
|
|
108
111
|
return [4 /*yield*/, this.request({
|
|
109
|
-
path: "/carts/
|
|
112
|
+
path: "/carts/{cartId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))),
|
|
110
113
|
method: 'POST',
|
|
111
114
|
headers: headerParameters,
|
|
112
115
|
query: queryParameters,
|
|
@@ -134,6 +137,82 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
134
137
|
});
|
|
135
138
|
});
|
|
136
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* Create current cart if get cart return object not found
|
|
142
|
+
*/
|
|
143
|
+
ManageCartApi.prototype.createCart = function (requestParameters, initOverrides) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
+
var response;
|
|
146
|
+
return __generator(this, function (_a) {
|
|
147
|
+
switch (_a.label) {
|
|
148
|
+
case 0: return [4 /*yield*/, this.createCartRaw(requestParameters, initOverrides)];
|
|
149
|
+
case 1:
|
|
150
|
+
response = _a.sent();
|
|
151
|
+
return [4 /*yield*/, response.value()];
|
|
152
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Create current cart if get cart return object not found
|
|
159
|
+
*/
|
|
160
|
+
ManageCartApi.prototype.createCurrentCartRaw = function (initOverrides) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_2;
|
|
163
|
+
return __generator(this, function (_c) {
|
|
164
|
+
switch (_c.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
queryParameters = {};
|
|
167
|
+
headerParameters = {};
|
|
168
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
169
|
+
_a = headerParameters;
|
|
170
|
+
_b = "x-api-key";
|
|
171
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
172
|
+
case 1:
|
|
173
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
174
|
+
_c.label = 2;
|
|
175
|
+
case 2:
|
|
176
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
177
|
+
token = this.configuration.accessToken;
|
|
178
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
179
|
+
case 3:
|
|
180
|
+
tokenString = _c.sent();
|
|
181
|
+
if (tokenString) {
|
|
182
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
183
|
+
}
|
|
184
|
+
_c.label = 4;
|
|
185
|
+
case 4:
|
|
186
|
+
_c.trys.push([4, 6, , 7]);
|
|
187
|
+
return [4 /*yield*/, this.request({
|
|
188
|
+
path: "/carts/me",
|
|
189
|
+
method: 'POST',
|
|
190
|
+
headers: headerParameters,
|
|
191
|
+
query: queryParameters,
|
|
192
|
+
}, initOverrides)];
|
|
193
|
+
case 5:
|
|
194
|
+
response = _c.sent();
|
|
195
|
+
contentType = response.headers.get("content-type");
|
|
196
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
197
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartFromJSON)(jsonValue); })];
|
|
198
|
+
}
|
|
199
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
200
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
// TODO : Better handling of others application types
|
|
204
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
205
|
+
}
|
|
206
|
+
return [3 /*break*/, 7];
|
|
207
|
+
case 6:
|
|
208
|
+
response_2 = _c.sent();
|
|
209
|
+
console.debug(response_2);
|
|
210
|
+
throw response_2;
|
|
211
|
+
case 7: return [2 /*return*/];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
};
|
|
137
216
|
/**
|
|
138
217
|
* Create current cart if get cart return object not found
|
|
139
218
|
*/
|
|
@@ -151,12 +230,91 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
151
230
|
});
|
|
152
231
|
});
|
|
153
232
|
};
|
|
233
|
+
/**
|
|
234
|
+
* Get current cart
|
|
235
|
+
*/
|
|
236
|
+
ManageCartApi.prototype.getCartRaw = function (requestParameters, initOverrides) {
|
|
237
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
238
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_3;
|
|
239
|
+
return __generator(this, function (_c) {
|
|
240
|
+
switch (_c.label) {
|
|
241
|
+
case 0:
|
|
242
|
+
if (requestParameters['cartId'] == null) {
|
|
243
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCart().');
|
|
244
|
+
}
|
|
245
|
+
queryParameters = {};
|
|
246
|
+
headerParameters = {};
|
|
247
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
248
|
+
_a = headerParameters;
|
|
249
|
+
_b = "x-api-key";
|
|
250
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
251
|
+
case 1:
|
|
252
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
253
|
+
_c.label = 2;
|
|
254
|
+
case 2:
|
|
255
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
256
|
+
token = this.configuration.accessToken;
|
|
257
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
258
|
+
case 3:
|
|
259
|
+
tokenString = _c.sent();
|
|
260
|
+
if (tokenString) {
|
|
261
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
262
|
+
}
|
|
263
|
+
_c.label = 4;
|
|
264
|
+
case 4:
|
|
265
|
+
_c.trys.push([4, 6, , 7]);
|
|
266
|
+
return [4 /*yield*/, this.request({
|
|
267
|
+
path: "/carts/{cartId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))),
|
|
268
|
+
method: 'GET',
|
|
269
|
+
headers: headerParameters,
|
|
270
|
+
query: queryParameters,
|
|
271
|
+
}, initOverrides)];
|
|
272
|
+
case 5:
|
|
273
|
+
response = _c.sent();
|
|
274
|
+
contentType = response.headers.get("content-type");
|
|
275
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
276
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartFromJSON)(jsonValue); })];
|
|
277
|
+
}
|
|
278
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
279
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
// TODO : Better handling of others application types
|
|
283
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
284
|
+
}
|
|
285
|
+
return [3 /*break*/, 7];
|
|
286
|
+
case 6:
|
|
287
|
+
response_3 = _c.sent();
|
|
288
|
+
console.debug(response_3);
|
|
289
|
+
throw response_3;
|
|
290
|
+
case 7: return [2 /*return*/];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Get current cart
|
|
297
|
+
*/
|
|
298
|
+
ManageCartApi.prototype.getCart = function (requestParameters, initOverrides) {
|
|
299
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
300
|
+
var response;
|
|
301
|
+
return __generator(this, function (_a) {
|
|
302
|
+
switch (_a.label) {
|
|
303
|
+
case 0: return [4 /*yield*/, this.getCartRaw(requestParameters, initOverrides)];
|
|
304
|
+
case 1:
|
|
305
|
+
response = _a.sent();
|
|
306
|
+
return [4 /*yield*/, response.value()];
|
|
307
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
};
|
|
154
312
|
/**
|
|
155
313
|
* Get current cart
|
|
156
314
|
*/
|
|
157
315
|
ManageCartApi.prototype.getCurrentCartRaw = function (initOverrides) {
|
|
158
316
|
return __awaiter(this, void 0, void 0, function () {
|
|
159
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType,
|
|
317
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_4;
|
|
160
318
|
return __generator(this, function (_c) {
|
|
161
319
|
switch (_c.label) {
|
|
162
320
|
case 0:
|
|
@@ -202,9 +360,9 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
202
360
|
}
|
|
203
361
|
return [3 /*break*/, 7];
|
|
204
362
|
case 6:
|
|
205
|
-
|
|
206
|
-
console.debug(
|
|
207
|
-
throw
|
|
363
|
+
response_4 = _c.sent();
|
|
364
|
+
console.debug(response_4);
|
|
365
|
+
throw response_4;
|
|
208
366
|
case 7: return [2 /*return*/];
|
|
209
367
|
}
|
|
210
368
|
});
|
|
@@ -11,9 +11,21 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import type { CartSubCart } from '../models/index';
|
|
14
|
+
export interface DeleteCartSubCartRequest {
|
|
15
|
+
cartId: number;
|
|
16
|
+
subCartId: number;
|
|
17
|
+
}
|
|
14
18
|
export interface DeleteCurrentCartSubCartRequest {
|
|
15
19
|
subCartId: number;
|
|
16
20
|
}
|
|
21
|
+
export interface GetCartSubCartRequest {
|
|
22
|
+
cartId: number;
|
|
23
|
+
subCartId: number;
|
|
24
|
+
}
|
|
25
|
+
export interface GetCartSubCartsRequest {
|
|
26
|
+
cartId: number;
|
|
27
|
+
orderBy?: GetCartSubCartsOrderByEnum;
|
|
28
|
+
}
|
|
17
29
|
export interface GetCurrentCartSubCartRequest {
|
|
18
30
|
subCartId: number;
|
|
19
31
|
}
|
|
@@ -24,6 +36,14 @@ export interface GetCurrentCartSubCartsRequest {
|
|
|
24
36
|
*
|
|
25
37
|
*/
|
|
26
38
|
export declare class ManageCartSubCartApi extends runtime.BaseAPI {
|
|
39
|
+
/**
|
|
40
|
+
* Delete a SubCart for user cart
|
|
41
|
+
*/
|
|
42
|
+
deleteCartSubCartRaw(requestParameters: DeleteCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
43
|
+
/**
|
|
44
|
+
* Delete a SubCart for user cart
|
|
45
|
+
*/
|
|
46
|
+
deleteCartSubCart(requestParameters: DeleteCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
27
47
|
/**
|
|
28
48
|
* Delete a SubCart for user cart
|
|
29
49
|
*/
|
|
@@ -32,6 +52,22 @@ export declare class ManageCartSubCartApi extends runtime.BaseAPI {
|
|
|
32
52
|
* Delete a SubCart for user cart
|
|
33
53
|
*/
|
|
34
54
|
deleteCurrentCartSubCart(requestParameters: DeleteCurrentCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Get user sub cart for a specific SubCart
|
|
57
|
+
*/
|
|
58
|
+
getCartSubCartRaw(requestParameters: GetCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CartSubCart | runtime.BlobWithMeta>>;
|
|
59
|
+
/**
|
|
60
|
+
* Get user sub cart for a specific SubCart
|
|
61
|
+
*/
|
|
62
|
+
getCartSubCart(requestParameters: GetCartSubCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CartSubCart | runtime.BlobWithMeta>;
|
|
63
|
+
/**
|
|
64
|
+
* Get user cart split by SubCart
|
|
65
|
+
*/
|
|
66
|
+
getCartSubCartsRaw(requestParameters: GetCartSubCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CartSubCart> | runtime.BlobWithMeta>>;
|
|
67
|
+
/**
|
|
68
|
+
* Get user cart split by SubCart
|
|
69
|
+
*/
|
|
70
|
+
getCartSubCarts(requestParameters: GetCartSubCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CartSubCart> | runtime.BlobWithMeta>;
|
|
35
71
|
/**
|
|
36
72
|
* Get user sub cart for a specific SubCart
|
|
37
73
|
*/
|
|
@@ -49,6 +85,16 @@ export declare class ManageCartSubCartApi extends runtime.BaseAPI {
|
|
|
49
85
|
*/
|
|
50
86
|
getCurrentCartSubCarts(requestParameters?: GetCurrentCartSubCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CartSubCart> | runtime.BlobWithMeta>;
|
|
51
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* @export
|
|
90
|
+
*/
|
|
91
|
+
export declare const GetCartSubCartsOrderByEnum: {
|
|
92
|
+
readonly UPDATED_AT_ASC: "UPDATED_AT:asc";
|
|
93
|
+
readonly UPDATED_AT_DESC: "UPDATED_AT:desc";
|
|
94
|
+
readonly TOTAL_EXCLUDING_TAXES_ASC: "TOTAL_EXCLUDING_TAXES:asc";
|
|
95
|
+
readonly TOTAL_EXCLUDING_TAXES_DESC: "TOTAL_EXCLUDING_TAXES:desc";
|
|
96
|
+
};
|
|
97
|
+
export declare type GetCartSubCartsOrderByEnum = typeof GetCartSubCartsOrderByEnum[keyof typeof GetCartSubCartsOrderByEnum];
|
|
52
98
|
/**
|
|
53
99
|
* @export
|
|
54
100
|
*/
|
|
@@ -64,7 +64,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
-
exports.GetCurrentCartSubCartsOrderByEnum = exports.ManageCartSubCartApi = void 0;
|
|
67
|
+
exports.GetCurrentCartSubCartsOrderByEnum = exports.GetCartSubCartsOrderByEnum = exports.ManageCartSubCartApi = void 0;
|
|
68
68
|
var runtime = require("../runtime");
|
|
69
69
|
var index_1 = require("../models/index");
|
|
70
70
|
/**
|
|
@@ -78,14 +78,17 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
78
78
|
/**
|
|
79
79
|
* Delete a SubCart for user cart
|
|
80
80
|
*/
|
|
81
|
-
ManageCartSubCartApi.prototype.
|
|
81
|
+
ManageCartSubCartApi.prototype.deleteCartSubCartRaw = function (requestParameters, initOverrides) {
|
|
82
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
83
83
|
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_1;
|
|
84
84
|
return __generator(this, function (_c) {
|
|
85
85
|
switch (_c.label) {
|
|
86
86
|
case 0:
|
|
87
|
+
if (requestParameters['cartId'] == null) {
|
|
88
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling deleteCartSubCart().');
|
|
89
|
+
}
|
|
87
90
|
if (requestParameters['subCartId'] == null) {
|
|
88
|
-
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling
|
|
91
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling deleteCartSubCart().');
|
|
89
92
|
}
|
|
90
93
|
queryParameters = {};
|
|
91
94
|
headerParameters = {};
|
|
@@ -109,7 +112,7 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
109
112
|
case 4:
|
|
110
113
|
_c.trys.push([4, 6, , 7]);
|
|
111
114
|
return [4 /*yield*/, this.request({
|
|
112
|
-
path: "/carts/
|
|
115
|
+
path: "/carts/{cartId}/sub-carts/{subCartId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
|
|
113
116
|
method: 'DELETE',
|
|
114
117
|
headers: headerParameters,
|
|
115
118
|
query: queryParameters,
|
|
@@ -126,6 +129,72 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
126
129
|
});
|
|
127
130
|
});
|
|
128
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* Delete a SubCart for user cart
|
|
134
|
+
*/
|
|
135
|
+
ManageCartSubCartApi.prototype.deleteCartSubCart = function (requestParameters, initOverrides) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
137
|
+
return __generator(this, function (_a) {
|
|
138
|
+
switch (_a.label) {
|
|
139
|
+
case 0: return [4 /*yield*/, this.deleteCartSubCartRaw(requestParameters, initOverrides)];
|
|
140
|
+
case 1:
|
|
141
|
+
_a.sent();
|
|
142
|
+
return [2 /*return*/];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Delete a SubCart for user cart
|
|
149
|
+
*/
|
|
150
|
+
ManageCartSubCartApi.prototype.deleteCurrentCartSubCartRaw = function (requestParameters, initOverrides) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_2;
|
|
153
|
+
return __generator(this, function (_c) {
|
|
154
|
+
switch (_c.label) {
|
|
155
|
+
case 0:
|
|
156
|
+
if (requestParameters['subCartId'] == null) {
|
|
157
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling deleteCurrentCartSubCart().');
|
|
158
|
+
}
|
|
159
|
+
queryParameters = {};
|
|
160
|
+
headerParameters = {};
|
|
161
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
162
|
+
_a = headerParameters;
|
|
163
|
+
_b = "x-api-key";
|
|
164
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
165
|
+
case 1:
|
|
166
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
167
|
+
_c.label = 2;
|
|
168
|
+
case 2:
|
|
169
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
170
|
+
token = this.configuration.accessToken;
|
|
171
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
172
|
+
case 3:
|
|
173
|
+
tokenString = _c.sent();
|
|
174
|
+
if (tokenString) {
|
|
175
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
176
|
+
}
|
|
177
|
+
_c.label = 4;
|
|
178
|
+
case 4:
|
|
179
|
+
_c.trys.push([4, 6, , 7]);
|
|
180
|
+
return [4 /*yield*/, this.request({
|
|
181
|
+
path: "/carts/me/sub-carts/{subCartId}".replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
|
|
182
|
+
method: 'DELETE',
|
|
183
|
+
headers: headerParameters,
|
|
184
|
+
query: queryParameters,
|
|
185
|
+
}, initOverrides)];
|
|
186
|
+
case 5:
|
|
187
|
+
response = _c.sent();
|
|
188
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
189
|
+
case 6:
|
|
190
|
+
response_2 = _c.sent();
|
|
191
|
+
console.debug(response_2);
|
|
192
|
+
throw response_2;
|
|
193
|
+
case 7: return [2 /*return*/];
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
};
|
|
129
198
|
/**
|
|
130
199
|
* Delete a SubCart for user cart
|
|
131
200
|
*/
|
|
@@ -141,12 +210,176 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
141
210
|
});
|
|
142
211
|
});
|
|
143
212
|
};
|
|
213
|
+
/**
|
|
214
|
+
* Get user sub cart for a specific SubCart
|
|
215
|
+
*/
|
|
216
|
+
ManageCartSubCartApi.prototype.getCartSubCartRaw = function (requestParameters, initOverrides) {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
218
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_3;
|
|
219
|
+
return __generator(this, function (_c) {
|
|
220
|
+
switch (_c.label) {
|
|
221
|
+
case 0:
|
|
222
|
+
if (requestParameters['cartId'] == null) {
|
|
223
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCartSubCart().');
|
|
224
|
+
}
|
|
225
|
+
if (requestParameters['subCartId'] == null) {
|
|
226
|
+
throw new runtime.RequiredError('subCartId', 'Required parameter "subCartId" was null or undefined when calling getCartSubCart().');
|
|
227
|
+
}
|
|
228
|
+
queryParameters = {};
|
|
229
|
+
headerParameters = {};
|
|
230
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
231
|
+
_a = headerParameters;
|
|
232
|
+
_b = "x-api-key";
|
|
233
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
234
|
+
case 1:
|
|
235
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
236
|
+
_c.label = 2;
|
|
237
|
+
case 2:
|
|
238
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
239
|
+
token = this.configuration.accessToken;
|
|
240
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
241
|
+
case 3:
|
|
242
|
+
tokenString = _c.sent();
|
|
243
|
+
if (tokenString) {
|
|
244
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
245
|
+
}
|
|
246
|
+
_c.label = 4;
|
|
247
|
+
case 4:
|
|
248
|
+
_c.trys.push([4, 6, , 7]);
|
|
249
|
+
return [4 /*yield*/, this.request({
|
|
250
|
+
path: "/carts/{cartId}/sub-carts/{subCartId}".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))).replace("{".concat("subCartId", "}"), encodeURIComponent(String(requestParameters['subCartId']))),
|
|
251
|
+
method: 'GET',
|
|
252
|
+
headers: headerParameters,
|
|
253
|
+
query: queryParameters,
|
|
254
|
+
}, initOverrides)];
|
|
255
|
+
case 5:
|
|
256
|
+
response = _c.sent();
|
|
257
|
+
contentType = response.headers.get("content-type");
|
|
258
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
259
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartSubCartFromJSON)(jsonValue); })];
|
|
260
|
+
}
|
|
261
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
262
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
// TODO : Better handling of others application types
|
|
266
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
267
|
+
}
|
|
268
|
+
return [3 /*break*/, 7];
|
|
269
|
+
case 6:
|
|
270
|
+
response_3 = _c.sent();
|
|
271
|
+
console.debug(response_3);
|
|
272
|
+
throw response_3;
|
|
273
|
+
case 7: return [2 /*return*/];
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* Get user sub cart for a specific SubCart
|
|
280
|
+
*/
|
|
281
|
+
ManageCartSubCartApi.prototype.getCartSubCart = function (requestParameters, initOverrides) {
|
|
282
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
283
|
+
var response;
|
|
284
|
+
return __generator(this, function (_a) {
|
|
285
|
+
switch (_a.label) {
|
|
286
|
+
case 0: return [4 /*yield*/, this.getCartSubCartRaw(requestParameters, initOverrides)];
|
|
287
|
+
case 1:
|
|
288
|
+
response = _a.sent();
|
|
289
|
+
return [4 /*yield*/, response.value()];
|
|
290
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Get user cart split by SubCart
|
|
297
|
+
*/
|
|
298
|
+
ManageCartSubCartApi.prototype.getCartSubCartsRaw = function (requestParameters, initOverrides) {
|
|
299
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
300
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_4;
|
|
301
|
+
return __generator(this, function (_c) {
|
|
302
|
+
switch (_c.label) {
|
|
303
|
+
case 0:
|
|
304
|
+
if (requestParameters['cartId'] == null) {
|
|
305
|
+
throw new runtime.RequiredError('cartId', 'Required parameter "cartId" was null or undefined when calling getCartSubCarts().');
|
|
306
|
+
}
|
|
307
|
+
queryParameters = {};
|
|
308
|
+
if (requestParameters['orderBy'] != null) {
|
|
309
|
+
queryParameters['orderBy'] = requestParameters['orderBy'];
|
|
310
|
+
}
|
|
311
|
+
headerParameters = {};
|
|
312
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
313
|
+
_a = headerParameters;
|
|
314
|
+
_b = "x-api-key";
|
|
315
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
316
|
+
case 1:
|
|
317
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
318
|
+
_c.label = 2;
|
|
319
|
+
case 2:
|
|
320
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
321
|
+
token = this.configuration.accessToken;
|
|
322
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
323
|
+
case 3:
|
|
324
|
+
tokenString = _c.sent();
|
|
325
|
+
if (tokenString) {
|
|
326
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
327
|
+
}
|
|
328
|
+
_c.label = 4;
|
|
329
|
+
case 4:
|
|
330
|
+
_c.trys.push([4, 6, , 7]);
|
|
331
|
+
return [4 /*yield*/, this.request({
|
|
332
|
+
path: "/carts/{cartId}/sub-carts".replace("{".concat("cartId", "}"), encodeURIComponent(String(requestParameters['cartId']))),
|
|
333
|
+
method: 'GET',
|
|
334
|
+
headers: headerParameters,
|
|
335
|
+
query: queryParameters,
|
|
336
|
+
}, initOverrides)];
|
|
337
|
+
case 5:
|
|
338
|
+
response = _c.sent();
|
|
339
|
+
contentType = response.headers.get("content-type");
|
|
340
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
341
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.CartSubCartFromJSON); })];
|
|
342
|
+
}
|
|
343
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
344
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
// TODO : Better handling of others application types
|
|
348
|
+
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
349
|
+
}
|
|
350
|
+
return [3 /*break*/, 7];
|
|
351
|
+
case 6:
|
|
352
|
+
response_4 = _c.sent();
|
|
353
|
+
console.debug(response_4);
|
|
354
|
+
throw response_4;
|
|
355
|
+
case 7: return [2 /*return*/];
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Get user cart split by SubCart
|
|
362
|
+
*/
|
|
363
|
+
ManageCartSubCartApi.prototype.getCartSubCarts = function (requestParameters, initOverrides) {
|
|
364
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
365
|
+
var response;
|
|
366
|
+
return __generator(this, function (_a) {
|
|
367
|
+
switch (_a.label) {
|
|
368
|
+
case 0: return [4 /*yield*/, this.getCartSubCartsRaw(requestParameters, initOverrides)];
|
|
369
|
+
case 1:
|
|
370
|
+
response = _a.sent();
|
|
371
|
+
return [4 /*yield*/, response.value()];
|
|
372
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
};
|
|
144
377
|
/**
|
|
145
378
|
* Get user sub cart for a specific SubCart
|
|
146
379
|
*/
|
|
147
380
|
ManageCartSubCartApi.prototype.getCurrentCartSubCartRaw = function (requestParameters, initOverrides) {
|
|
148
381
|
return __awaiter(this, void 0, void 0, function () {
|
|
149
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType,
|
|
382
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_5;
|
|
150
383
|
return __generator(this, function (_c) {
|
|
151
384
|
switch (_c.label) {
|
|
152
385
|
case 0:
|
|
@@ -195,9 +428,9 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
195
428
|
}
|
|
196
429
|
return [3 /*break*/, 7];
|
|
197
430
|
case 6:
|
|
198
|
-
|
|
199
|
-
console.debug(
|
|
200
|
-
throw
|
|
431
|
+
response_5 = _c.sent();
|
|
432
|
+
console.debug(response_5);
|
|
433
|
+
throw response_5;
|
|
201
434
|
case 7: return [2 /*return*/];
|
|
202
435
|
}
|
|
203
436
|
});
|
|
@@ -225,7 +458,7 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
225
458
|
*/
|
|
226
459
|
ManageCartSubCartApi.prototype.getCurrentCartSubCartsRaw = function (requestParameters, initOverrides) {
|
|
227
460
|
return __awaiter(this, void 0, void 0, function () {
|
|
228
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType,
|
|
461
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_6;
|
|
229
462
|
return __generator(this, function (_c) {
|
|
230
463
|
switch (_c.label) {
|
|
231
464
|
case 0:
|
|
@@ -274,9 +507,9 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
274
507
|
}
|
|
275
508
|
return [3 /*break*/, 7];
|
|
276
509
|
case 6:
|
|
277
|
-
|
|
278
|
-
console.debug(
|
|
279
|
-
throw
|
|
510
|
+
response_6 = _c.sent();
|
|
511
|
+
console.debug(response_6);
|
|
512
|
+
throw response_6;
|
|
280
513
|
case 7: return [2 /*return*/];
|
|
281
514
|
}
|
|
282
515
|
});
|
|
@@ -303,6 +536,15 @@ var ManageCartSubCartApi = /** @class */ (function (_super) {
|
|
|
303
536
|
return ManageCartSubCartApi;
|
|
304
537
|
}(runtime.BaseAPI));
|
|
305
538
|
exports.ManageCartSubCartApi = ManageCartSubCartApi;
|
|
539
|
+
/**
|
|
540
|
+
* @export
|
|
541
|
+
*/
|
|
542
|
+
exports.GetCartSubCartsOrderByEnum = {
|
|
543
|
+
UPDATED_AT_ASC: 'UPDATED_AT:asc',
|
|
544
|
+
UPDATED_AT_DESC: 'UPDATED_AT:desc',
|
|
545
|
+
TOTAL_EXCLUDING_TAXES_ASC: 'TOTAL_EXCLUDING_TAXES:asc',
|
|
546
|
+
TOTAL_EXCLUDING_TAXES_DESC: 'TOTAL_EXCLUDING_TAXES:desc'
|
|
547
|
+
};
|
|
306
548
|
/**
|
|
307
549
|
* @export
|
|
308
550
|
*/
|