@lcdp/api-react-rest-client 3.1.2 → 3.1.3-LDS-5369-api-modifications-routes-et-sch.21861896537
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/order/src/apis/ManageForeorderApi.d.ts +31 -0
- package/order/src/apis/{ManageMetaOrderApi.js → ManageForeorderApi.js} +18 -91
- package/order/src/apis/ManageOrderApi.d.ts +8 -8
- package/order/src/apis/ManageOrderApi.js +9 -10
- package/order/src/apis/index.d.ts +1 -1
- package/order/src/apis/index.js +1 -1
- package/order/src/models/{AnyMetaOrderWarning.d.ts → AnyForeorderWarning.d.ts} +5 -5
- package/order/src/models/{AnyMetaOrderWarning.js → AnyForeorderWarning.js} +10 -10
- package/order/src/models/Foreorder.d.ts +241 -0
- package/order/src/models/Foreorder.js +180 -0
- package/order/src/models/ForeorderCreationParameters.d.ts +45 -0
- package/order/src/models/ForeorderCreationParameters.js +58 -0
- package/order/src/models/ForeorderCreationResponse.d.ts +39 -0
- package/order/src/models/ForeorderCreationResponse.js +53 -0
- package/order/src/models/ForeorderWarning.d.ts +31 -0
- package/order/src/models/{MetaOrderWarning.js → ForeorderWarning.js} +11 -11
- package/order/src/models/Order.d.ts +9 -7
- package/order/src/models/Order.js +6 -4
- package/order/src/models/OrderCreationParameters.d.ts +46 -0
- package/order/src/models/OrderCreationParameters.js +59 -0
- package/order/src/models/index.d.ts +6 -7
- package/order/src/models/index.js +6 -7
- package/package.json +1 -1
- package/shopping-cart/src/apis/ManageCartApi.d.ts +30 -28
- package/shopping-cart/src/apis/ManageCartApi.js +43 -167
- package/shopping-cart/src/apis/ManageCartLineApi.d.ts +82 -0
- package/shopping-cart/src/apis/{ManageCartSubCartApi.js → ManageCartLineApi.js} +86 -157
- package/shopping-cart/src/apis/index.d.ts +1 -2
- package/shopping-cart/src/apis/index.js +1 -2
- package/shopping-cart/src/models/Cart.d.ts +6 -6
- package/shopping-cart/src/models/Cart.js +10 -4
- package/shopping-cart/src/models/CartCreationParameters.d.ts +44 -0
- package/shopping-cart/src/models/CartCreationParameters.js +56 -0
- package/shopping-cart/src/models/CartCreationResponse.d.ts +39 -0
- package/shopping-cart/src/models/CartCreationResponse.js +49 -0
- package/shopping-cart/src/models/{CartSubCartLine.d.ts → CartLine.d.ts} +13 -13
- package/shopping-cart/src/models/{CartSubCartLine.js → CartLine.js} +11 -11
- package/shopping-cart/src/models/CartLineResponse.d.ts +39 -0
- package/shopping-cart/src/models/CartLineResponse.js +49 -0
- package/shopping-cart/src/models/CartLineUpdateParameters.d.ts +37 -0
- package/shopping-cart/src/models/CartLineUpdateParameters.js +49 -0
- package/shopping-cart/src/models/CartLinesResponse.d.ts +39 -0
- package/shopping-cart/src/models/CartLinesResponse.js +49 -0
- package/shopping-cart/src/models/CartRecord.d.ts +70 -0
- package/shopping-cart/src/models/CartRecord.js +74 -0
- package/shopping-cart/src/models/{CartSubCartTransport.d.ts → CartRecordTransport.d.ts} +12 -12
- package/shopping-cart/src/models/{CartSubCartTransport.js → CartRecordTransport.js} +11 -11
- package/shopping-cart/src/models/CartSummary.d.ts +31 -0
- package/shopping-cart/src/models/CartSummary.js +47 -0
- package/shopping-cart/src/models/CartWarning.d.ts +68 -0
- package/shopping-cart/src/models/CartWarning.js +69 -0
- package/shopping-cart/src/models/OwnerLink.d.ts +43 -0
- package/shopping-cart/src/models/{SellerLink.js → OwnerLink.js} +13 -14
- package/shopping-cart/src/models/PaginatedCarts.d.ts +46 -0
- package/shopping-cart/src/models/PaginatedCarts.js +58 -0
- package/shopping-cart/src/models/PagingMetadata.d.ts +49 -0
- package/shopping-cart/src/models/PagingMetadata.js +55 -0
- package/shopping-cart/src/models/index.d.ts +13 -6
- package/shopping-cart/src/models/index.js +13 -6
- package/order/src/apis/ManageMetaOrderApi.d.ts +0 -45
- package/order/src/models/MetaOrder.d.ts +0 -64
- package/order/src/models/MetaOrder.js +0 -70
- package/order/src/models/MetaOrderCreationParameters.d.ts +0 -38
- package/order/src/models/MetaOrderCreationParameters.js +0 -52
- package/order/src/models/MetaOrderCreationSubCartParameters.d.ts +0 -31
- package/order/src/models/MetaOrderCreationSubCartParameters.js +0 -47
- package/order/src/models/MetaOrderPrices.d.ts +0 -79
- package/order/src/models/MetaOrderPrices.js +0 -79
- package/order/src/models/MetaOrderWarning.d.ts +0 -31
- package/order/src/models/MetaOrderWithWarnings.d.ts +0 -39
- package/order/src/models/MetaOrderWithWarnings.js +0 -49
- package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +0 -107
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.d.ts +0 -151
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +0 -879
- package/shopping-cart/src/models/CartSubCart.d.ts +0 -76
- package/shopping-cart/src/models/CartSubCart.js +0 -78
- package/shopping-cart/src/models/CartSubCartLineUpdateParameters.d.ts +0 -37
- package/shopping-cart/src/models/CartSubCartLineUpdateParameters.js +0 -49
- package/shopping-cart/src/models/SellerLink.d.ts +0 -50
- package/shopping-cart/src/models/UserRole.d.ts +0 -29
- package/shopping-cart/src/models/UserRole.js +0 -52
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
export * from './Address';
|
|
2
2
|
export * from './Anomalies';
|
|
3
3
|
export * from './AnomaliesUpdateParameters';
|
|
4
|
-
export * from './
|
|
4
|
+
export * from './AnyForeorderWarning';
|
|
5
5
|
export * from './Barcodes';
|
|
6
|
+
export * from './Foreorder';
|
|
7
|
+
export * from './ForeorderCreationParameters';
|
|
8
|
+
export * from './ForeorderCreationResponse';
|
|
9
|
+
export * from './ForeorderWarning';
|
|
6
10
|
export * from './FreeCarriageCoupon';
|
|
7
11
|
export * from './FreeCarriageCouponCreationParameters';
|
|
8
12
|
export * from './FreeCarriageCouponOwnerLink';
|
|
9
13
|
export * from './HttpLink';
|
|
10
|
-
export * from './MetaOrder';
|
|
11
|
-
export * from './MetaOrderCreationParameters';
|
|
12
|
-
export * from './MetaOrderCreationSubCartParameters';
|
|
13
|
-
export * from './MetaOrderPrices';
|
|
14
|
-
export * from './MetaOrderWarning';
|
|
15
|
-
export * from './MetaOrderWithWarnings';
|
|
16
14
|
export * from './Order';
|
|
17
15
|
export * from './OrderAddedItem';
|
|
16
|
+
export * from './OrderCreationParameters';
|
|
18
17
|
export * from './OrderItem';
|
|
19
18
|
export * from './OrderItemPrices';
|
|
20
19
|
export * from './OrderItemRefundedCreationParameters';
|
|
@@ -19,20 +19,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
__exportStar(require("./Address"), exports);
|
|
20
20
|
__exportStar(require("./Anomalies"), exports);
|
|
21
21
|
__exportStar(require("./AnomaliesUpdateParameters"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
22
|
+
__exportStar(require("./AnyForeorderWarning"), exports);
|
|
23
23
|
__exportStar(require("./Barcodes"), exports);
|
|
24
|
+
__exportStar(require("./Foreorder"), exports);
|
|
25
|
+
__exportStar(require("./ForeorderCreationParameters"), exports);
|
|
26
|
+
__exportStar(require("./ForeorderCreationResponse"), exports);
|
|
27
|
+
__exportStar(require("./ForeorderWarning"), exports);
|
|
24
28
|
__exportStar(require("./FreeCarriageCoupon"), exports);
|
|
25
29
|
__exportStar(require("./FreeCarriageCouponCreationParameters"), exports);
|
|
26
30
|
__exportStar(require("./FreeCarriageCouponOwnerLink"), exports);
|
|
27
31
|
__exportStar(require("./HttpLink"), exports);
|
|
28
|
-
__exportStar(require("./MetaOrder"), exports);
|
|
29
|
-
__exportStar(require("./MetaOrderCreationParameters"), exports);
|
|
30
|
-
__exportStar(require("./MetaOrderCreationSubCartParameters"), exports);
|
|
31
|
-
__exportStar(require("./MetaOrderPrices"), exports);
|
|
32
|
-
__exportStar(require("./MetaOrderWarning"), exports);
|
|
33
|
-
__exportStar(require("./MetaOrderWithWarnings"), exports);
|
|
34
32
|
__exportStar(require("./Order"), exports);
|
|
35
33
|
__exportStar(require("./OrderAddedItem"), exports);
|
|
34
|
+
__exportStar(require("./OrderCreationParameters"), exports);
|
|
36
35
|
__exportStar(require("./OrderItem"), exports);
|
|
37
36
|
__exportStar(require("./OrderItemPrices"), exports);
|
|
38
37
|
__exportStar(require("./OrderItemRefundedCreationParameters"), exports);
|
package/package.json
CHANGED
|
@@ -10,47 +10,49 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type {
|
|
13
|
+
import type { CartCreationParameters, CartCreationResponse, PaginatedCarts } from '../models/index';
|
|
14
14
|
export interface CreateCartRequest {
|
|
15
|
-
|
|
15
|
+
cartCreationParameters: CartCreationParameters;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
18
|
-
|
|
17
|
+
export interface GetCartsRequest {
|
|
18
|
+
oEq?: number;
|
|
19
|
+
channelEq?: string;
|
|
20
|
+
orderBy?: GetCartsOrderByEnum;
|
|
21
|
+
p?: number;
|
|
22
|
+
pp?: number;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
*
|
|
22
26
|
*/
|
|
23
27
|
export declare class ManageCartApi extends runtime.BaseAPI {
|
|
24
28
|
/**
|
|
25
|
-
* Create
|
|
29
|
+
* Create a new cart for the given owner with items from shopped offers. The cart is associated with a channel.
|
|
30
|
+
* Create a cart and add items
|
|
26
31
|
*/
|
|
27
|
-
createCartRaw(requestParameters: CreateCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
32
|
+
createCartRaw(requestParameters: CreateCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CartCreationResponse | runtime.BlobWithMeta>>;
|
|
28
33
|
/**
|
|
29
|
-
* Create
|
|
34
|
+
* Create a new cart for the given owner with items from shopped offers. The cart is associated with a channel.
|
|
35
|
+
* Create a cart and add items
|
|
30
36
|
*/
|
|
31
|
-
createCart(requestParameters: CreateCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
37
|
+
createCart(requestParameters: CreateCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CartCreationResponse | runtime.BlobWithMeta>;
|
|
32
38
|
/**
|
|
33
|
-
*
|
|
39
|
+
* Search and retrieve carts with filtering, sorting and pagination.
|
|
40
|
+
* Search carts
|
|
34
41
|
*/
|
|
35
|
-
|
|
42
|
+
getCartsRaw(requestParameters: GetCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedCarts | runtime.BlobWithMeta>>;
|
|
36
43
|
/**
|
|
37
|
-
*
|
|
44
|
+
* Search and retrieve carts with filtering, sorting and pagination.
|
|
45
|
+
* Search carts
|
|
38
46
|
*/
|
|
39
|
-
|
|
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>;
|
|
48
|
-
/**
|
|
49
|
-
* Get current cart
|
|
50
|
-
*/
|
|
51
|
-
getCurrentCartRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Cart | runtime.BlobWithMeta>>;
|
|
52
|
-
/**
|
|
53
|
-
* Get current cart
|
|
54
|
-
*/
|
|
55
|
-
getCurrentCart(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Cart | runtime.BlobWithMeta>;
|
|
47
|
+
getCarts(requestParameters?: GetCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedCarts | runtime.BlobWithMeta>;
|
|
56
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* @export
|
|
51
|
+
*/
|
|
52
|
+
export declare const GetCartsOrderByEnum: {
|
|
53
|
+
readonly UPDATED_AT_ASC: "UPDATED_AT:asc";
|
|
54
|
+
readonly UPDATED_AT_DESC: "UPDATED_AT:desc";
|
|
55
|
+
readonly TOTAL_EXCLUDING_TAXES_ASC: "TOTAL_EXCLUDING_TAXES:asc";
|
|
56
|
+
readonly TOTAL_EXCLUDING_TAXES_DESC: "TOTAL_EXCLUDING_TAXES:desc";
|
|
57
|
+
};
|
|
58
|
+
export declare type GetCartsOrderByEnum = typeof GetCartsOrderByEnum[keyof typeof GetCartsOrderByEnum];
|
|
@@ -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.ManageCartApi = void 0;
|
|
67
|
+
exports.GetCartsOrderByEnum = exports.ManageCartApi = void 0;
|
|
68
68
|
var runtime = require("../runtime");
|
|
69
69
|
var index_1 = require("../models/index");
|
|
70
70
|
/**
|
|
@@ -76,7 +76,8 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
76
76
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
|
-
* Create
|
|
79
|
+
* Create a new cart for the given owner with items from shopped offers. The cart is associated with a channel.
|
|
80
|
+
* Create a cart and add items
|
|
80
81
|
*/
|
|
81
82
|
ManageCartApi.prototype.createCartRaw = function (requestParameters, initOverrides) {
|
|
82
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -84,11 +85,12 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
84
85
|
return __generator(this, function (_c) {
|
|
85
86
|
switch (_c.label) {
|
|
86
87
|
case 0:
|
|
87
|
-
if (requestParameters['
|
|
88
|
-
throw new runtime.RequiredError('
|
|
88
|
+
if (requestParameters['cartCreationParameters'] == null) {
|
|
89
|
+
throw new runtime.RequiredError('cartCreationParameters', 'Required parameter "cartCreationParameters" was null or undefined when calling createCart().');
|
|
89
90
|
}
|
|
90
91
|
queryParameters = {};
|
|
91
92
|
headerParameters = {};
|
|
93
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
92
94
|
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
93
95
|
_a = headerParameters;
|
|
94
96
|
_b = "x-api-key";
|
|
@@ -109,16 +111,17 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
109
111
|
case 4:
|
|
110
112
|
_c.trys.push([4, 6, , 7]);
|
|
111
113
|
return [4 /*yield*/, this.request({
|
|
112
|
-
path: "/carts
|
|
114
|
+
path: "/carts",
|
|
113
115
|
method: 'POST',
|
|
114
116
|
headers: headerParameters,
|
|
115
117
|
query: queryParameters,
|
|
118
|
+
body: (0, index_1.CartCreationParametersToJSON)(requestParameters['cartCreationParameters']),
|
|
116
119
|
}, initOverrides)];
|
|
117
120
|
case 5:
|
|
118
121
|
response = _c.sent();
|
|
119
122
|
contentType = response.headers.get("content-type");
|
|
120
123
|
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
121
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
124
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartCreationResponseFromJSON)(jsonValue); })];
|
|
122
125
|
}
|
|
123
126
|
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
124
127
|
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
@@ -138,7 +141,8 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
138
141
|
});
|
|
139
142
|
};
|
|
140
143
|
/**
|
|
141
|
-
* Create
|
|
144
|
+
* Create a new cart for the given owner with items from shopped offers. The cart is associated with a channel.
|
|
145
|
+
* Create a cart and add items
|
|
142
146
|
*/
|
|
143
147
|
ManageCartApi.prototype.createCart = function (requestParameters, initOverrides) {
|
|
144
148
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -155,94 +159,31 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
155
159
|
});
|
|
156
160
|
};
|
|
157
161
|
/**
|
|
158
|
-
*
|
|
162
|
+
* Search and retrieve carts with filtering, sorting and pagination.
|
|
163
|
+
* Search carts
|
|
159
164
|
*/
|
|
160
|
-
ManageCartApi.prototype.
|
|
165
|
+
ManageCartApi.prototype.getCartsRaw = function (requestParameters, initOverrides) {
|
|
161
166
|
return __awaiter(this, void 0, void 0, function () {
|
|
162
167
|
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_2;
|
|
163
168
|
return __generator(this, function (_c) {
|
|
164
169
|
switch (_c.label) {
|
|
165
170
|
case 0:
|
|
166
171
|
queryParameters = {};
|
|
167
|
-
|
|
168
|
-
|
|
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);
|
|
172
|
+
if (requestParameters['oEq'] != null) {
|
|
173
|
+
queryParameters['o[eq]'] = requestParameters['oEq'];
|
|
183
174
|
}
|
|
184
|
-
|
|
185
|
-
|
|
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); })];
|
|
175
|
+
if (requestParameters['channelEq'] != null) {
|
|
176
|
+
queryParameters['channel[eq]'] = requestParameters['channelEq'];
|
|
198
177
|
}
|
|
199
|
-
|
|
200
|
-
|
|
178
|
+
if (requestParameters['orderBy'] != null) {
|
|
179
|
+
queryParameters['orderBy'] = requestParameters['orderBy'];
|
|
201
180
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
181
|
+
if (requestParameters['p'] != null) {
|
|
182
|
+
queryParameters['p'] = requestParameters['p'];
|
|
205
183
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
response_2 = _c.sent();
|
|
209
|
-
console.debug(response_2);
|
|
210
|
-
throw response_2;
|
|
211
|
-
case 7: return [2 /*return*/];
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
};
|
|
216
|
-
/**
|
|
217
|
-
* Create current cart if get cart return object not found
|
|
218
|
-
*/
|
|
219
|
-
ManageCartApi.prototype.createCurrentCart = function (initOverrides) {
|
|
220
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
221
|
-
var response;
|
|
222
|
-
return __generator(this, function (_a) {
|
|
223
|
-
switch (_a.label) {
|
|
224
|
-
case 0: return [4 /*yield*/, this.createCurrentCartRaw(initOverrides)];
|
|
225
|
-
case 1:
|
|
226
|
-
response = _a.sent();
|
|
227
|
-
return [4 /*yield*/, response.value()];
|
|
228
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
});
|
|
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().');
|
|
184
|
+
if (requestParameters['pp'] != null) {
|
|
185
|
+
queryParameters['pp'] = requestParameters['pp'];
|
|
244
186
|
}
|
|
245
|
-
queryParameters = {};
|
|
246
187
|
headerParameters = {};
|
|
247
188
|
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
248
189
|
_a = headerParameters;
|
|
@@ -264,7 +205,7 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
264
205
|
case 4:
|
|
265
206
|
_c.trys.push([4, 6, , 7]);
|
|
266
207
|
return [4 /*yield*/, this.request({
|
|
267
|
-
path: "/carts
|
|
208
|
+
path: "/carts",
|
|
268
209
|
method: 'GET',
|
|
269
210
|
headers: headerParameters,
|
|
270
211
|
query: queryParameters,
|
|
@@ -273,7 +214,7 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
273
214
|
response = _c.sent();
|
|
274
215
|
contentType = response.headers.get("content-type");
|
|
275
216
|
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
276
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
217
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.PaginatedCartsFromJSON)(jsonValue); })];
|
|
277
218
|
}
|
|
278
219
|
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
279
220
|
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
@@ -284,99 +225,25 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
284
225
|
}
|
|
285
226
|
return [3 /*break*/, 7];
|
|
286
227
|
case 6:
|
|
287
|
-
|
|
288
|
-
console.debug(
|
|
289
|
-
throw
|
|
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
|
-
};
|
|
312
|
-
/**
|
|
313
|
-
* Get current cart
|
|
314
|
-
*/
|
|
315
|
-
ManageCartApi.prototype.getCurrentCartRaw = function (initOverrides) {
|
|
316
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
317
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_4;
|
|
318
|
-
return __generator(this, function (_c) {
|
|
319
|
-
switch (_c.label) {
|
|
320
|
-
case 0:
|
|
321
|
-
queryParameters = {};
|
|
322
|
-
headerParameters = {};
|
|
323
|
-
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
324
|
-
_a = headerParameters;
|
|
325
|
-
_b = "x-api-key";
|
|
326
|
-
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
327
|
-
case 1:
|
|
328
|
-
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
329
|
-
_c.label = 2;
|
|
330
|
-
case 2:
|
|
331
|
-
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
332
|
-
token = this.configuration.accessToken;
|
|
333
|
-
return [4 /*yield*/, token("bearerAuth", [])];
|
|
334
|
-
case 3:
|
|
335
|
-
tokenString = _c.sent();
|
|
336
|
-
if (tokenString) {
|
|
337
|
-
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
338
|
-
}
|
|
339
|
-
_c.label = 4;
|
|
340
|
-
case 4:
|
|
341
|
-
_c.trys.push([4, 6, , 7]);
|
|
342
|
-
return [4 /*yield*/, this.request({
|
|
343
|
-
path: "/carts/me",
|
|
344
|
-
method: 'GET',
|
|
345
|
-
headers: headerParameters,
|
|
346
|
-
query: queryParameters,
|
|
347
|
-
}, initOverrides)];
|
|
348
|
-
case 5:
|
|
349
|
-
response = _c.sent();
|
|
350
|
-
contentType = response.headers.get("content-type");
|
|
351
|
-
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
352
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CartFromJSON)(jsonValue); })];
|
|
353
|
-
}
|
|
354
|
-
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
355
|
-
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
// TODO : Better handling of others application types
|
|
359
|
-
return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
|
|
360
|
-
}
|
|
361
|
-
return [3 /*break*/, 7];
|
|
362
|
-
case 6:
|
|
363
|
-
response_4 = _c.sent();
|
|
364
|
-
console.debug(response_4);
|
|
365
|
-
throw response_4;
|
|
228
|
+
response_2 = _c.sent();
|
|
229
|
+
console.debug(response_2);
|
|
230
|
+
throw response_2;
|
|
366
231
|
case 7: return [2 /*return*/];
|
|
367
232
|
}
|
|
368
233
|
});
|
|
369
234
|
});
|
|
370
235
|
};
|
|
371
236
|
/**
|
|
372
|
-
*
|
|
237
|
+
* Search and retrieve carts with filtering, sorting and pagination.
|
|
238
|
+
* Search carts
|
|
373
239
|
*/
|
|
374
|
-
ManageCartApi.prototype.
|
|
240
|
+
ManageCartApi.prototype.getCarts = function (requestParameters, initOverrides) {
|
|
241
|
+
if (requestParameters === void 0) { requestParameters = {}; }
|
|
375
242
|
return __awaiter(this, void 0, void 0, function () {
|
|
376
243
|
var response;
|
|
377
244
|
return __generator(this, function (_a) {
|
|
378
245
|
switch (_a.label) {
|
|
379
|
-
case 0: return [4 /*yield*/, this.
|
|
246
|
+
case 0: return [4 /*yield*/, this.getCartsRaw(requestParameters, initOverrides)];
|
|
380
247
|
case 1:
|
|
381
248
|
response = _a.sent();
|
|
382
249
|
return [4 /*yield*/, response.value()];
|
|
@@ -388,3 +255,12 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
388
255
|
return ManageCartApi;
|
|
389
256
|
}(runtime.BaseAPI));
|
|
390
257
|
exports.ManageCartApi = ManageCartApi;
|
|
258
|
+
/**
|
|
259
|
+
* @export
|
|
260
|
+
*/
|
|
261
|
+
exports.GetCartsOrderByEnum = {
|
|
262
|
+
UPDATED_AT_ASC: 'UPDATED_AT:asc',
|
|
263
|
+
UPDATED_AT_DESC: 'UPDATED_AT:desc',
|
|
264
|
+
TOTAL_EXCLUDING_TAXES_ASC: 'TOTAL_EXCLUDING_TAXES:asc',
|
|
265
|
+
TOTAL_EXCLUDING_TAXES_DESC: 'TOTAL_EXCLUDING_TAXES:desc'
|
|
266
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lcdp-monolith-service
|
|
3
|
+
* This is the REST API of LCDP products
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: contact@lecomptoirdespharmacies.fr
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { CartLine, CartLineResponse, CartLineUpdateParameters, CartLinesResponse, ShoppedOffer } from '../models/index';
|
|
14
|
+
export interface CreateOrUpdateCartLineRequest {
|
|
15
|
+
cartId: number;
|
|
16
|
+
shoppedOffer: Array<ShoppedOffer>;
|
|
17
|
+
}
|
|
18
|
+
export interface DeleteCartLineRequest {
|
|
19
|
+
cartId: number;
|
|
20
|
+
lineId: number;
|
|
21
|
+
}
|
|
22
|
+
export interface GetCartLineRequest {
|
|
23
|
+
cartId: number;
|
|
24
|
+
lineId: number;
|
|
25
|
+
}
|
|
26
|
+
export interface GetCartLinesRequest {
|
|
27
|
+
cartId: number;
|
|
28
|
+
}
|
|
29
|
+
export interface UpdateCartLineRequest {
|
|
30
|
+
cartId: number;
|
|
31
|
+
lineId: number;
|
|
32
|
+
cartLineUpdateParameters: CartLineUpdateParameters;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export declare class ManageCartLineApi extends runtime.BaseAPI {
|
|
38
|
+
/**
|
|
39
|
+
* If Sale Offer from \'offerReference\' is a distribution type \'RANGE\', then distributedRangeId should not be null. In any case, \'quantity\' field should be >= 0
|
|
40
|
+
* Create or update a cart line if its already exist
|
|
41
|
+
*/
|
|
42
|
+
createOrUpdateCartLineRaw(requestParameters: CreateOrUpdateCartLineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CartLinesResponse | runtime.BlobWithMeta>>;
|
|
43
|
+
/**
|
|
44
|
+
* If Sale Offer from \'offerReference\' is a distribution type \'RANGE\', then distributedRangeId should not be null. In any case, \'quantity\' field should be >= 0
|
|
45
|
+
* Create or update a cart line if its already exist
|
|
46
|
+
*/
|
|
47
|
+
createOrUpdateCartLine(requestParameters: CreateOrUpdateCartLineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CartLinesResponse | runtime.BlobWithMeta>;
|
|
48
|
+
/**
|
|
49
|
+
* Permit to delete a shopping cart line
|
|
50
|
+
* Delete a cart line
|
|
51
|
+
*/
|
|
52
|
+
deleteCartLineRaw(requestParameters: DeleteCartLineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
53
|
+
/**
|
|
54
|
+
* Permit to delete a shopping cart line
|
|
55
|
+
* Delete a cart line
|
|
56
|
+
*/
|
|
57
|
+
deleteCartLine(requestParameters: DeleteCartLineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Get a cart line
|
|
60
|
+
*/
|
|
61
|
+
getCartLineRaw(requestParameters: GetCartLineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CartLine | runtime.BlobWithMeta>>;
|
|
62
|
+
/**
|
|
63
|
+
* Get a cart line
|
|
64
|
+
*/
|
|
65
|
+
getCartLine(requestParameters: GetCartLineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CartLine | runtime.BlobWithMeta>;
|
|
66
|
+
/**
|
|
67
|
+
* Get all cart lines
|
|
68
|
+
*/
|
|
69
|
+
getCartLinesRaw(requestParameters: GetCartLinesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CartLine> | runtime.BlobWithMeta>>;
|
|
70
|
+
/**
|
|
71
|
+
* Get all cart lines
|
|
72
|
+
*/
|
|
73
|
+
getCartLines(requestParameters: GetCartLinesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CartLine> | runtime.BlobWithMeta>;
|
|
74
|
+
/**
|
|
75
|
+
* Update a cart line
|
|
76
|
+
*/
|
|
77
|
+
updateCartLineRaw(requestParameters: UpdateCartLineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CartLineResponse | runtime.BlobWithMeta>>;
|
|
78
|
+
/**
|
|
79
|
+
* Update a cart line
|
|
80
|
+
*/
|
|
81
|
+
updateCartLine(requestParameters: UpdateCartLineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CartLineResponse | runtime.BlobWithMeta>;
|
|
82
|
+
}
|