@lcdp/api-react-rest-client 3.0.4-LDS-4910-rde2e-mettre-a-jour-les-tests.20373226962 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/shopping-cart/src/apis/ManageCartApi.d.ts +0 -22
- package/shopping-cart/src/apis/ManageCartApi.js +6 -164
- package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +0 -46
- package/shopping-cart/src/apis/ManageCartSubCartApi.js +12 -254
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.d.ts +0 -69
- package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +20 -427
- package/user/src/models/OffisanteStatus.d.ts +3 -1
- package/user/src/models/OffisanteStatus.js +4 -2
package/package.json
CHANGED
|
@@ -11,24 +11,10 @@
|
|
|
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
|
-
}
|
|
20
14
|
/**
|
|
21
15
|
*
|
|
22
16
|
*/
|
|
23
17
|
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>;
|
|
32
18
|
/**
|
|
33
19
|
* Create current cart if get cart return object not found
|
|
34
20
|
*/
|
|
@@ -37,14 +23,6 @@ export declare class ManageCartApi extends runtime.BaseAPI {
|
|
|
37
23
|
* Create current cart if get cart return object not found
|
|
38
24
|
*/
|
|
39
25
|
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>;
|
|
48
26
|
/**
|
|
49
27
|
* Get current cart
|
|
50
28
|
*/
|
|
@@ -78,15 +78,12 @@ 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.createCurrentCartRaw = function (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
|
-
}
|
|
90
87
|
queryParameters = {};
|
|
91
88
|
headerParameters = {};
|
|
92
89
|
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
@@ -109,7 +106,7 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
109
106
|
case 4:
|
|
110
107
|
_c.trys.push([4, 6, , 7]);
|
|
111
108
|
return [4 /*yield*/, this.request({
|
|
112
|
-
path: "/carts/
|
|
109
|
+
path: "/carts/me",
|
|
113
110
|
method: 'POST',
|
|
114
111
|
headers: headerParameters,
|
|
115
112
|
query: queryParameters,
|
|
@@ -137,82 +134,6 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
137
134
|
});
|
|
138
135
|
});
|
|
139
136
|
};
|
|
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
|
-
};
|
|
216
137
|
/**
|
|
217
138
|
* Create current cart if get cart return object not found
|
|
218
139
|
*/
|
|
@@ -230,91 +151,12 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
230
151
|
});
|
|
231
152
|
});
|
|
232
153
|
};
|
|
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
|
-
};
|
|
312
154
|
/**
|
|
313
155
|
* Get current cart
|
|
314
156
|
*/
|
|
315
157
|
ManageCartApi.prototype.getCurrentCartRaw = function (initOverrides) {
|
|
316
158
|
return __awaiter(this, void 0, void 0, function () {
|
|
317
|
-
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType,
|
|
159
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_2;
|
|
318
160
|
return __generator(this, function (_c) {
|
|
319
161
|
switch (_c.label) {
|
|
320
162
|
case 0:
|
|
@@ -360,9 +202,9 @@ var ManageCartApi = /** @class */ (function (_super) {
|
|
|
360
202
|
}
|
|
361
203
|
return [3 /*break*/, 7];
|
|
362
204
|
case 6:
|
|
363
|
-
|
|
364
|
-
console.debug(
|
|
365
|
-
throw
|
|
205
|
+
response_2 = _c.sent();
|
|
206
|
+
console.debug(response_2);
|
|
207
|
+
throw response_2;
|
|
366
208
|
case 7: return [2 /*return*/];
|
|
367
209
|
}
|
|
368
210
|
});
|
|
@@ -11,21 +11,9 @@
|
|
|
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
|
-
}
|
|
18
14
|
export interface DeleteCurrentCartSubCartRequest {
|
|
19
15
|
subCartId: number;
|
|
20
16
|
}
|
|
21
|
-
export interface GetCartSubCartRequest {
|
|
22
|
-
cartId: number;
|
|
23
|
-
subCartId: number;
|
|
24
|
-
}
|
|
25
|
-
export interface GetCartSubCartsRequest {
|
|
26
|
-
cartId: number;
|
|
27
|
-
orderBy?: GetCartSubCartsOrderByEnum;
|
|
28
|
-
}
|
|
29
17
|
export interface GetCurrentCartSubCartRequest {
|
|
30
18
|
subCartId: number;
|
|
31
19
|
}
|
|
@@ -36,14 +24,6 @@ export interface GetCurrentCartSubCartsRequest {
|
|
|
36
24
|
*
|
|
37
25
|
*/
|
|
38
26
|
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>;
|
|
47
27
|
/**
|
|
48
28
|
* Delete a SubCart for user cart
|
|
49
29
|
*/
|
|
@@ -52,22 +32,6 @@ export declare class ManageCartSubCartApi extends runtime.BaseAPI {
|
|
|
52
32
|
* Delete a SubCart for user cart
|
|
53
33
|
*/
|
|
54
34
|
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>;
|
|
71
35
|
/**
|
|
72
36
|
* Get user sub cart for a specific SubCart
|
|
73
37
|
*/
|
|
@@ -85,16 +49,6 @@ export declare class ManageCartSubCartApi extends runtime.BaseAPI {
|
|
|
85
49
|
*/
|
|
86
50
|
getCurrentCartSubCarts(requestParameters?: GetCurrentCartSubCartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CartSubCart> | runtime.BlobWithMeta>;
|
|
87
51
|
}
|
|
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];
|
|
98
52
|
/**
|
|
99
53
|
* @export
|
|
100
54
|
*/
|