@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.
Files changed (204) hide show
  1. package/auth/src/models/RestError.d.ts +3 -5
  2. package/auth/src/models/RestError.js +3 -5
  3. package/catalog/src/models/RestError.d.ts +3 -5
  4. package/catalog/src/models/RestError.js +3 -5
  5. package/chargebee-hook/src/models/RestError.d.ts +3 -5
  6. package/chargebee-hook/src/models/RestError.js +3 -5
  7. package/configuration/src/models/RestError.d.ts +3 -5
  8. package/configuration/src/models/RestError.js +3 -5
  9. package/content/src/models/RestError.d.ts +3 -5
  10. package/content/src/models/RestError.js +3 -5
  11. package/favorite/src/models/RestError.d.ts +3 -5
  12. package/favorite/src/models/RestError.js +3 -5
  13. package/inventory/src/models/RestError.d.ts +3 -5
  14. package/inventory/src/models/RestError.js +3 -5
  15. package/invoice/src/models/RestError.d.ts +3 -5
  16. package/invoice/src/models/RestError.js +3 -5
  17. package/laboratory-store/src/models/RestError.d.ts +3 -5
  18. package/laboratory-store/src/models/RestError.js +3 -5
  19. package/lexicon/src/models/RestError.d.ts +3 -5
  20. package/lexicon/src/models/RestError.js +3 -5
  21. package/litigation/src/models/RestError.d.ts +3 -5
  22. package/litigation/src/models/RestError.js +3 -5
  23. package/magic-cart/src/models/ExpressOrder.d.ts +4 -4
  24. package/magic-cart/src/models/ExpressOrder.js +7 -3
  25. package/magic-cart/src/models/ShoppedOffer.d.ts +43 -0
  26. package/magic-cart/src/models/ShoppedOffer.js +53 -0
  27. package/magic-cart/src/models/index.d.ts +1 -2
  28. package/magic-cart/src/models/index.js +1 -2
  29. package/mangopay-hook/src/models/RestError.d.ts +3 -5
  30. package/mangopay-hook/src/models/RestError.js +3 -5
  31. package/notification/src/models/NotificationTypeId.d.ts +0 -1
  32. package/notification/src/models/NotificationTypeId.js +0 -1
  33. package/notification/src/models/RestError.d.ts +3 -5
  34. package/notification/src/models/RestError.js +3 -5
  35. package/order/src/apis/ManageForeorderApi.d.ts +31 -0
  36. package/order/src/apis/ManageForeorderApi.js +163 -0
  37. package/order/src/apis/ManageOrderApi.d.ts +9 -9
  38. package/order/src/apis/ManageOrderApi.js +12 -13
  39. package/order/src/apis/SearchForeorderItemApi.d.ts +44 -0
  40. package/order/src/apis/SearchForeorderItemApi.js +175 -0
  41. package/order/src/apis/index.d.ts +2 -1
  42. package/order/src/apis/index.js +2 -1
  43. package/order/src/models/AnyForeorderCreationParameters.d.ts +23 -0
  44. package/order/src/models/AnyForeorderCreationParameters.js +45 -0
  45. package/order/src/models/AnyForeorderWarning.d.ts +26 -0
  46. package/order/src/models/AnyForeorderWarning.js +50 -0
  47. package/order/src/models/AnyOrderCreationParameters.d.ts +26 -0
  48. package/order/src/models/AnyOrderCreationParameters.js +50 -0
  49. package/order/src/models/AnySource.d.ts +26 -0
  50. package/order/src/models/AnySource.js +50 -0
  51. package/order/src/models/CartForeorderCreationParameters.d.ts +37 -0
  52. package/order/src/models/CartForeorderCreationParameters.js +51 -0
  53. package/order/src/models/CartSource.d.ts +37 -0
  54. package/order/src/models/CartSource.js +49 -0
  55. package/order/src/models/CloneOrderCreationParameters.d.ts +37 -0
  56. package/order/src/models/CloneOrderCreationParameters.js +51 -0
  57. package/order/src/models/Foreorder.d.ts +155 -0
  58. package/order/src/models/Foreorder.js +128 -0
  59. package/order/src/models/ForeorderCreationParameters.d.ts +31 -0
  60. package/order/src/models/ForeorderCreationParameters.js +47 -0
  61. package/order/src/models/ForeorderItemWarning.d.ts +77 -0
  62. package/order/src/models/{OrderItemWarning.js → ForeorderItemWarning.js} +21 -18
  63. package/order/src/models/ForeorderOrderCreationParameters.d.ts +37 -0
  64. package/order/src/models/ForeorderOrderCreationParameters.js +51 -0
  65. package/order/src/models/ForeorderWarning.d.ts +51 -0
  66. package/order/src/models/{OrderWarning.js → ForeorderWarning.js} +12 -12
  67. package/order/src/models/ForeorderWarningBase.d.ts +37 -0
  68. package/order/src/models/ForeorderWarningBase.js +51 -0
  69. package/order/src/models/ForeordersWithWarnings.d.ts +39 -0
  70. package/order/src/models/ForeordersWithWarnings.js +53 -0
  71. package/order/src/models/Order.d.ts +80 -75
  72. package/order/src/models/Order.js +53 -48
  73. package/order/src/models/OrderAddedItem.d.ts +9 -9
  74. package/order/src/models/OrderAddedItem.js +18 -0
  75. package/order/src/models/OrderCreationParameters.d.ts +31 -0
  76. package/order/src/models/OrderCreationParameters.js +47 -0
  77. package/order/src/models/OrderItem.d.ts +9 -9
  78. package/order/src/models/OrderItem.js +18 -0
  79. package/order/src/models/OrderItemPrices.d.ts +8 -8
  80. package/order/src/models/OrderItemPrices.js +10 -0
  81. package/order/src/models/OrderPrices.d.ts +9 -9
  82. package/order/src/models/OrderPrices.js +18 -0
  83. package/order/src/models/OrderRefundedItem.d.ts +9 -9
  84. package/order/src/models/OrderRefundedItem.js +18 -0
  85. package/order/src/models/OrderRemovedItem.d.ts +9 -9
  86. package/order/src/models/OrderRemovedItem.js +18 -0
  87. package/order/src/models/OrderSource.d.ts +37 -0
  88. package/order/src/models/OrderSource.js +49 -0
  89. package/order/src/models/Reservation.d.ts +7 -7
  90. package/order/src/models/Reservation.js +14 -0
  91. package/order/src/models/RestError.d.ts +3 -5
  92. package/order/src/models/RestError.js +3 -5
  93. package/order/src/models/ShoppedOffer.d.ts +2 -2
  94. package/order/src/models/ShoppedOffer.js +2 -2
  95. package/order/src/models/Source.d.ts +31 -0
  96. package/order/src/models/Source.js +45 -0
  97. package/order/src/models/index.d.ts +17 -9
  98. package/order/src/models/index.js +17 -9
  99. package/package.json +1 -1
  100. package/product/src/models/RestError.d.ts +3 -5
  101. package/product/src/models/RestError.js +3 -5
  102. package/pub/src/models/RestError.d.ts +3 -5
  103. package/pub/src/models/RestError.js +3 -5
  104. package/rfx/src/models/RestError.d.ts +3 -5
  105. package/rfx/src/models/RestError.js +3 -5
  106. package/sale-offer/src/models/RestError.d.ts +3 -5
  107. package/sale-offer/src/models/RestError.js +3 -5
  108. package/servant/src/models/RestError.d.ts +3 -5
  109. package/servant/src/models/RestError.js +3 -5
  110. package/shipment/src/models/RestError.d.ts +3 -5
  111. package/shipment/src/models/RestError.js +3 -5
  112. package/shopping-cart/src/apis/ManageCartApi.d.ts +35 -24
  113. package/shopping-cart/src/apis/ManageCartApi.js +57 -120
  114. package/shopping-cart/src/apis/ManageCartLineApi.d.ts +45 -0
  115. package/shopping-cart/src/apis/ManageCartLineApi.js +238 -0
  116. package/shopping-cart/src/apis/SearchCartApi.d.ts +59 -0
  117. package/shopping-cart/src/apis/SearchCartApi.js +267 -0
  118. package/shopping-cart/src/apis/SearchCartLineApi.d.ts +41 -0
  119. package/{order/src/apis/ManageMetaOrderApi.js → shopping-cart/src/apis/SearchCartLineApi.js} +46 -41
  120. package/shopping-cart/src/apis/index.d.ts +3 -2
  121. package/shopping-cart/src/apis/index.js +3 -2
  122. package/shopping-cart/src/models/Cart.d.ts +61 -4
  123. package/shopping-cart/src/models/Cart.js +47 -2
  124. package/shopping-cart/src/models/CartCreationParameters.d.ts +44 -0
  125. package/shopping-cart/src/models/CartCreationParameters.js +56 -0
  126. package/shopping-cart/src/models/{CartSubCartLine.d.ts → CartLine.d.ts} +13 -13
  127. package/shopping-cart/src/models/{CartSubCartLine.js → CartLine.js} +11 -11
  128. package/shopping-cart/src/models/CartLineUpdateParameters.d.ts +37 -0
  129. package/shopping-cart/src/models/CartLineUpdateParameters.js +49 -0
  130. package/shopping-cart/src/models/CartLineWithWarnings.d.ts +39 -0
  131. package/shopping-cart/src/models/CartLineWithWarnings.js +49 -0
  132. package/shopping-cart/src/models/CartSummary.d.ts +31 -0
  133. package/shopping-cart/src/models/CartSummary.js +47 -0
  134. package/shopping-cart/src/models/{CartSubCartTransport.d.ts → CartTransport.d.ts} +12 -12
  135. package/shopping-cart/src/models/{CartSubCartTransport.js → CartTransport.js} +11 -11
  136. package/shopping-cart/src/models/CartUpdateParameters.d.ts +31 -0
  137. package/shopping-cart/src/models/CartUpdateParameters.js +45 -0
  138. package/shopping-cart/src/models/CartWarning.d.ts +76 -0
  139. package/shopping-cart/src/models/CartWarning.js +69 -0
  140. package/shopping-cart/src/models/CartsWithWarnings.d.ts +39 -0
  141. package/shopping-cart/src/models/CartsWithWarnings.js +49 -0
  142. package/shopping-cart/src/models/OwnerLink.d.ts +43 -0
  143. package/shopping-cart/src/models/OwnerLink.js +53 -0
  144. package/shopping-cart/src/models/PaginatedCarts.d.ts +46 -0
  145. package/shopping-cart/src/models/PaginatedCarts.js +58 -0
  146. package/shopping-cart/src/models/PagingMetadata.d.ts +49 -0
  147. package/shopping-cart/src/models/PagingMetadata.js +55 -0
  148. package/shopping-cart/src/models/RestError.d.ts +3 -5
  149. package/shopping-cart/src/models/RestError.js +3 -5
  150. package/shopping-cart/src/models/ShoppedOffer.d.ts +2 -2
  151. package/shopping-cart/src/models/ShoppedOffer.js +2 -2
  152. package/shopping-cart/src/models/index.d.ts +12 -4
  153. package/shopping-cart/src/models/index.js +12 -4
  154. package/smuggler/src/models/RestError.d.ts +3 -5
  155. package/smuggler/src/models/RestError.js +3 -5
  156. package/statistic/src/models/RestError.d.ts +3 -5
  157. package/statistic/src/models/RestError.js +3 -5
  158. package/third-party/src/models/RestError.d.ts +3 -5
  159. package/third-party/src/models/RestError.js +3 -5
  160. package/ubo/src/apis/ManageUboDeclarationApi.d.ts +2 -2
  161. package/ubo/src/apis/ManageUboDeclarationApi.js +2 -2
  162. package/ubo/src/models/RestError.d.ts +3 -5
  163. package/ubo/src/models/RestError.js +3 -5
  164. package/user/src/models/NotificationTypeId.d.ts +0 -1
  165. package/user/src/models/NotificationTypeId.js +0 -1
  166. package/user/src/models/RestError.d.ts +3 -5
  167. package/user/src/models/RestError.js +3 -5
  168. package/user/src/models/User.d.ts +7 -0
  169. package/user/src/models/User.js +3 -0
  170. package/user/src/models/UserMangopayUbo.d.ts +31 -0
  171. package/user/src/models/UserMangopayUbo.js +45 -0
  172. package/user/src/models/index.d.ts +1 -0
  173. package/user/src/models/index.js +1 -0
  174. package/wish/src/models/RestError.d.ts +3 -5
  175. package/wish/src/models/RestError.js +3 -5
  176. package/magic-cart/src/models/SaleOfferProposal.d.ts +0 -51
  177. package/magic-cart/src/models/SaleOfferProposal.js +0 -61
  178. package/magic-cart/src/models/SellerProposal.d.ts +0 -45
  179. package/magic-cart/src/models/SellerProposal.js +0 -57
  180. package/order/src/apis/ManageMetaOrderApi.d.ts +0 -45
  181. package/order/src/models/AnyMetaOrderWarning.d.ts +0 -26
  182. package/order/src/models/AnyMetaOrderWarning.js +0 -50
  183. package/order/src/models/MetaOrder.d.ts +0 -64
  184. package/order/src/models/MetaOrder.js +0 -70
  185. package/order/src/models/MetaOrderCreationParameters.d.ts +0 -38
  186. package/order/src/models/MetaOrderCreationParameters.js +0 -52
  187. package/order/src/models/MetaOrderCreationSubCartParameters.d.ts +0 -31
  188. package/order/src/models/MetaOrderCreationSubCartParameters.js +0 -47
  189. package/order/src/models/MetaOrderPrices.d.ts +0 -79
  190. package/order/src/models/MetaOrderPrices.js +0 -79
  191. package/order/src/models/MetaOrderWarning.d.ts +0 -31
  192. package/order/src/models/MetaOrderWarning.js +0 -47
  193. package/order/src/models/MetaOrderWithWarnings.d.ts +0 -39
  194. package/order/src/models/MetaOrderWithWarnings.js +0 -49
  195. package/order/src/models/OrderItemWarning.d.ts +0 -72
  196. package/order/src/models/OrderWarning.d.ts +0 -51
  197. package/shopping-cart/src/apis/ManageCartSubCartApi.d.ts +0 -107
  198. package/shopping-cart/src/apis/ManageCartSubCartApi.js +0 -556
  199. package/shopping-cart/src/apis/ManageCartSubCartLineApi.d.ts +0 -151
  200. package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +0 -879
  201. package/shopping-cart/src/models/CartSubCart.d.ts +0 -76
  202. package/shopping-cart/src/models/CartSubCart.js +0 -78
  203. package/shopping-cart/src/models/CartSubCartLineUpdateParameters.d.ts +0 -37
  204. package/shopping-cart/src/models/CartSubCartLineUpdateParameters.js +0 -49
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * lcdp-monolith-service
6
+ * This is the REST API of LCDP orders
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.ManageForeorderApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var ManageForeorderApi = /** @class */ (function (_super) {
74
+ __extends(ManageForeorderApi, _super);
75
+ function ManageForeorderApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Create foreorders from a given source. A foreorder represents a pre-order state before it becomes an actual order.
80
+ * Create foreorders
81
+ */
82
+ ManageForeorderApi.prototype.createForeordersRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_1;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ if (requestParameters['cartForeorderCreationParameters'] == null) {
89
+ throw new runtime.RequiredError('cartForeorderCreationParameters', 'Required parameter "cartForeorderCreationParameters" was null or undefined when calling createForeorders().');
90
+ }
91
+ queryParameters = {};
92
+ headerParameters = {};
93
+ headerParameters['Content-Type'] = 'application/json';
94
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
95
+ _a = headerParameters;
96
+ _b = "x-api-key";
97
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
98
+ case 1:
99
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
100
+ _c.label = 2;
101
+ case 2:
102
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
103
+ token = this.configuration.accessToken;
104
+ return [4 /*yield*/, token("bearerAuth", [])];
105
+ case 3:
106
+ tokenString = _c.sent();
107
+ if (tokenString) {
108
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
109
+ }
110
+ _c.label = 4;
111
+ case 4:
112
+ _c.trys.push([4, 6, , 7]);
113
+ return [4 /*yield*/, this.request({
114
+ path: "/foreorders",
115
+ method: 'POST',
116
+ headers: headerParameters,
117
+ query: queryParameters,
118
+ body: (0, index_1.CartForeorderCreationParametersToJSON)(requestParameters['cartForeorderCreationParameters']),
119
+ }, initOverrides)];
120
+ case 5:
121
+ response = _c.sent();
122
+ contentType = response.headers.get("content-type");
123
+ if (contentType && contentType.indexOf("application/json") !== -1) {
124
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ForeordersWithWarningsFromJSON)(jsonValue); })];
125
+ }
126
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
127
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
128
+ }
129
+ else {
130
+ // TODO : Better handling of others application types
131
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
132
+ }
133
+ return [3 /*break*/, 7];
134
+ case 6:
135
+ response_1 = _c.sent();
136
+ console.debug(response_1);
137
+ throw response_1;
138
+ case 7: return [2 /*return*/];
139
+ }
140
+ });
141
+ });
142
+ };
143
+ /**
144
+ * Create foreorders from a given source. A foreorder represents a pre-order state before it becomes an actual order.
145
+ * Create foreorders
146
+ */
147
+ ManageForeorderApi.prototype.createForeorders = function (requestParameters, initOverrides) {
148
+ return __awaiter(this, void 0, void 0, function () {
149
+ var response;
150
+ return __generator(this, function (_a) {
151
+ switch (_a.label) {
152
+ case 0: return [4 /*yield*/, this.createForeordersRaw(requestParameters, initOverrides)];
153
+ case 1:
154
+ response = _a.sent();
155
+ return [4 /*yield*/, response.value()];
156
+ case 2: return [2 /*return*/, _a.sent()];
157
+ }
158
+ });
159
+ });
160
+ };
161
+ return ManageForeorderApi;
162
+ }(runtime.BaseAPI));
163
+ exports.ManageForeorderApi = ManageForeorderApi;
@@ -10,9 +10,9 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AnomaliesUpdateParameters, Order, OrderUpdateParameters, Reservation, ReservationUpdateParameters } from '../models/index';
14
- export interface CreateOrderRequest {
15
- from: string;
13
+ import type { AnomaliesUpdateParameters, AnyOrderCreationParameters, Order, OrderUpdateParameters, Reservation, ReservationUpdateParameters } from '../models/index';
14
+ export interface CreateOrdersRequest {
15
+ anyOrderCreationParameters: AnyOrderCreationParameters;
16
16
  }
17
17
  export interface SetOrderAcceptedRequest {
18
18
  orderReference: string;
@@ -50,15 +50,15 @@ export interface UpdateOrderReservationRequest {
50
50
  */
51
51
  export declare class ManageOrderApi extends runtime.BaseAPI {
52
52
  /**
53
- * Create a new order. *IMPORTANT NOTE : As for the moment, this route can only create order from another one (clone). In order to create new order from shopping cart, please use \"meta-order\" creation.
54
- * Create a new order
53
+ * Create orders from a given source. Notes : - foreorder : - \"Source\" field of \"foreorder\" will pass through - order : - Will clone existing orders - Only usable by ADMINISTRATOR
54
+ * Create orders
55
55
  */
56
- createOrderRaw(requestParameters: CreateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Order | runtime.BlobWithMeta>>;
56
+ createOrdersRaw(requestParameters: CreateOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Order> | runtime.BlobWithMeta>>;
57
57
  /**
58
- * Create a new order. *IMPORTANT NOTE : As for the moment, this route can only create order from another one (clone). In order to create new order from shopping cart, please use \"meta-order\" creation.
59
- * Create a new order
58
+ * Create orders from a given source. Notes : - foreorder : - \"Source\" field of \"foreorder\" will pass through - order : - Will clone existing orders - Only usable by ADMINISTRATOR
59
+ * Create orders
60
60
  */
61
- createOrder(requestParameters: CreateOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Order | runtime.BlobWithMeta>;
61
+ createOrders(requestParameters: CreateOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Order> | runtime.BlobWithMeta>;
62
62
  /**
63
63
  * Set the accepted flag for order identified by OrderId. # Preconditions : ## Common - \'paused\' property is false - \'accepted\' property is false (Limitation that may be removed in the future) - Status in (WAITING_FOR_SELLER_ACCEPTANCE, WAITING_FOR_BUYER_ACCEPTANCE, SELLER_ACCEPTANCE_DELAY, BUYER_ACCEPTANCE_DELAY) ## As seller - Status in (WAITING_FOR_SELLER_ACCEPTANCE, SELLER_ACCEPTANCE_DELAY) ## As buyer - Status in (WAITING_FOR_BUYER_ACCEPTANCE, BUYER_ACCEPTANCE_DELAY) ## As admin - No additional
64
64
  * Set order accepted flag
@@ -76,23 +76,21 @@ var ManageOrderApi = /** @class */ (function (_super) {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
78
  /**
79
- * Create a new order. *IMPORTANT NOTE : As for the moment, this route can only create order from another one (clone). In order to create new order from shopping cart, please use \"meta-order\" creation.
80
- * Create a new order
79
+ * Create orders from a given source. Notes : - foreorder : - \"Source\" field of \"foreorder\" will pass through - order : - Will clone existing orders - Only usable by ADMINISTRATOR
80
+ * Create orders
81
81
  */
82
- ManageOrderApi.prototype.createOrderRaw = function (requestParameters, initOverrides) {
82
+ ManageOrderApi.prototype.createOrdersRaw = function (requestParameters, initOverrides) {
83
83
  return __awaiter(this, void 0, void 0, function () {
84
84
  var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_1;
85
85
  return __generator(this, function (_c) {
86
86
  switch (_c.label) {
87
87
  case 0:
88
- if (requestParameters['from'] == null) {
89
- throw new runtime.RequiredError('from', 'Required parameter "from" was null or undefined when calling createOrder().');
88
+ if (requestParameters['anyOrderCreationParameters'] == null) {
89
+ throw new runtime.RequiredError('anyOrderCreationParameters', 'Required parameter "anyOrderCreationParameters" was null or undefined when calling createOrders().');
90
90
  }
91
91
  queryParameters = {};
92
- if (requestParameters['from'] != null) {
93
- queryParameters['from'] = requestParameters['from'];
94
- }
95
92
  headerParameters = {};
93
+ headerParameters['Content-Type'] = 'application/json';
96
94
  if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
97
95
  _a = headerParameters;
98
96
  _b = "x-api-key";
@@ -117,12 +115,13 @@ var ManageOrderApi = /** @class */ (function (_super) {
117
115
  method: 'POST',
118
116
  headers: headerParameters,
119
117
  query: queryParameters,
118
+ body: (0, index_1.AnyOrderCreationParametersToJSON)(requestParameters['anyOrderCreationParameters']),
120
119
  }, initOverrides)];
121
120
  case 5:
122
121
  response = _c.sent();
123
122
  contentType = response.headers.get("content-type");
124
123
  if (contentType && contentType.indexOf("application/json") !== -1) {
125
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.OrderFromJSON)(jsonValue); })];
124
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.OrderFromJSON); })];
126
125
  }
127
126
  else if (contentType && contentType.indexOf("text/plain") !== -1) {
128
127
  return [2 /*return*/, new runtime.TextApiResponse(response)];
@@ -142,15 +141,15 @@ var ManageOrderApi = /** @class */ (function (_super) {
142
141
  });
143
142
  };
144
143
  /**
145
- * Create a new order. *IMPORTANT NOTE : As for the moment, this route can only create order from another one (clone). In order to create new order from shopping cart, please use \"meta-order\" creation.
146
- * Create a new order
144
+ * Create orders from a given source. Notes : - foreorder : - \"Source\" field of \"foreorder\" will pass through - order : - Will clone existing orders - Only usable by ADMINISTRATOR
145
+ * Create orders
147
146
  */
148
- ManageOrderApi.prototype.createOrder = function (requestParameters, initOverrides) {
147
+ ManageOrderApi.prototype.createOrders = function (requestParameters, initOverrides) {
149
148
  return __awaiter(this, void 0, void 0, function () {
150
149
  var response;
151
150
  return __generator(this, function (_a) {
152
151
  switch (_a.label) {
153
- case 0: return [4 /*yield*/, this.createOrderRaw(requestParameters, initOverrides)];
152
+ case 0: return [4 /*yield*/, this.createOrdersRaw(requestParameters, initOverrides)];
154
153
  case 1:
155
154
  response = _a.sent();
156
155
  return [4 /*yield*/, response.value()];
@@ -0,0 +1,44 @@
1
+ /**
2
+ * lcdp-monolith-service
3
+ * This is the REST API of LCDP orders
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 { OrderItem } from '../models/index';
14
+ export interface GetForeorderItemsRequest {
15
+ orderReference: string;
16
+ orderBy?: GetForeorderItemsOrderByEnum;
17
+ }
18
+ /**
19
+ *
20
+ */
21
+ export declare class SearchForeorderItemApi extends runtime.BaseAPI {
22
+ /**
23
+ *
24
+ * Get items for foreorder identified by orderReference
25
+ */
26
+ getForeorderItemsRaw(requestParameters: GetForeorderItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OrderItem> | runtime.BlobWithMeta>>;
27
+ /**
28
+ *
29
+ * Get items for foreorder identified by orderReference
30
+ */
31
+ getForeorderItems(requestParameters: GetForeorderItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OrderItem> | runtime.BlobWithMeta>;
32
+ }
33
+ /**
34
+ * @export
35
+ */
36
+ export declare const GetForeorderItemsOrderByEnum: {
37
+ readonly PRODUCT_NAME_ASC: "PRODUCT_NAME:ASC";
38
+ readonly PRODUCT_NAME_DESC: "PRODUCT_NAME:DESC";
39
+ readonly CREATED_AT_ASC: "CREATED_AT:ASC";
40
+ readonly CREATED_AT_DESC: "CREATED_AT:DESC";
41
+ readonly UPDATED_AT_ASC: "UPDATED_AT:ASC";
42
+ readonly UPDATED_AT_DESC: "UPDATED_AT:DESC";
43
+ };
44
+ export declare type GetForeorderItemsOrderByEnum = typeof GetForeorderItemsOrderByEnum[keyof typeof GetForeorderItemsOrderByEnum];
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * lcdp-monolith-service
6
+ * This is the REST API of LCDP orders
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.GetForeorderItemsOrderByEnum = exports.SearchForeorderItemApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var SearchForeorderItemApi = /** @class */ (function (_super) {
74
+ __extends(SearchForeorderItemApi, _super);
75
+ function SearchForeorderItemApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ *
80
+ * Get items for foreorder identified by orderReference
81
+ */
82
+ SearchForeorderItemApi.prototype.getForeorderItemsRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_1;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ if (requestParameters['orderReference'] == null) {
89
+ throw new runtime.RequiredError('orderReference', 'Required parameter "orderReference" was null or undefined when calling getForeorderItems().');
90
+ }
91
+ queryParameters = {};
92
+ if (requestParameters['orderBy'] != null) {
93
+ queryParameters['orderBy'] = requestParameters['orderBy'];
94
+ }
95
+ headerParameters = {};
96
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
97
+ _a = headerParameters;
98
+ _b = "x-api-key";
99
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
100
+ case 1:
101
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
102
+ _c.label = 2;
103
+ case 2:
104
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
105
+ token = this.configuration.accessToken;
106
+ return [4 /*yield*/, token("bearerAuth", [])];
107
+ case 3:
108
+ tokenString = _c.sent();
109
+ if (tokenString) {
110
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
111
+ }
112
+ _c.label = 4;
113
+ case 4:
114
+ _c.trys.push([4, 6, , 7]);
115
+ return [4 /*yield*/, this.request({
116
+ path: "/foreorders/{orderReference}/items".replace("{".concat("orderReference", "}"), encodeURIComponent(String(requestParameters['orderReference']))),
117
+ method: 'GET',
118
+ headers: headerParameters,
119
+ query: queryParameters,
120
+ }, initOverrides)];
121
+ case 5:
122
+ response = _c.sent();
123
+ contentType = response.headers.get("content-type");
124
+ if (contentType && contentType.indexOf("application/json") !== -1) {
125
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.OrderItemFromJSON); })];
126
+ }
127
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
128
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
129
+ }
130
+ else {
131
+ // TODO : Better handling of others application types
132
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
133
+ }
134
+ return [3 /*break*/, 7];
135
+ case 6:
136
+ response_1 = _c.sent();
137
+ console.debug(response_1);
138
+ throw response_1;
139
+ case 7: return [2 /*return*/];
140
+ }
141
+ });
142
+ });
143
+ };
144
+ /**
145
+ *
146
+ * Get items for foreorder identified by orderReference
147
+ */
148
+ SearchForeorderItemApi.prototype.getForeorderItems = function (requestParameters, initOverrides) {
149
+ return __awaiter(this, void 0, void 0, function () {
150
+ var response;
151
+ return __generator(this, function (_a) {
152
+ switch (_a.label) {
153
+ case 0: return [4 /*yield*/, this.getForeorderItemsRaw(requestParameters, initOverrides)];
154
+ case 1:
155
+ response = _a.sent();
156
+ return [4 /*yield*/, response.value()];
157
+ case 2: return [2 /*return*/, _a.sent()];
158
+ }
159
+ });
160
+ });
161
+ };
162
+ return SearchForeorderItemApi;
163
+ }(runtime.BaseAPI));
164
+ exports.SearchForeorderItemApi = SearchForeorderItemApi;
165
+ /**
166
+ * @export
167
+ */
168
+ exports.GetForeorderItemsOrderByEnum = {
169
+ PRODUCT_NAME_ASC: 'PRODUCT_NAME:ASC',
170
+ PRODUCT_NAME_DESC: 'PRODUCT_NAME:DESC',
171
+ CREATED_AT_ASC: 'CREATED_AT:ASC',
172
+ CREATED_AT_DESC: 'CREATED_AT:DESC',
173
+ UPDATED_AT_ASC: 'UPDATED_AT:ASC',
174
+ UPDATED_AT_DESC: 'UPDATED_AT:DESC'
175
+ };
@@ -1,7 +1,8 @@
1
+ export * from './ManageForeorderApi';
1
2
  export * from './ManageFreeCarriageCouponApi';
2
- export * from './ManageMetaOrderApi';
3
3
  export * from './ManageOrderApi';
4
4
  export * from './ManageOrderItemApi';
5
+ export * from './SearchForeorderItemApi';
5
6
  export * from './SearchFreeCarriageCouponApi';
6
7
  export * from './SearchOrderApi';
7
8
  export * from './SearchOrderItemApi';
@@ -16,10 +16,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
+ __exportStar(require("./ManageForeorderApi"), exports);
19
20
  __exportStar(require("./ManageFreeCarriageCouponApi"), exports);
20
- __exportStar(require("./ManageMetaOrderApi"), exports);
21
21
  __exportStar(require("./ManageOrderApi"), exports);
22
22
  __exportStar(require("./ManageOrderItemApi"), exports);
23
+ __exportStar(require("./SearchForeorderItemApi"), exports);
23
24
  __exportStar(require("./SearchFreeCarriageCouponApi"), exports);
24
25
  __exportStar(require("./SearchOrderApi"), exports);
25
26
  __exportStar(require("./SearchOrderItemApi"), exports);
@@ -0,0 +1,23 @@
1
+ /**
2
+ * lcdp-monolith-service
3
+ * This is the REST API of LCDP orders
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 type { CartForeorderCreationParameters } from './CartForeorderCreationParameters';
13
+ /**
14
+ * @type AnyForeorderCreationParameters
15
+ *
16
+ * @export
17
+ */
18
+ export declare type AnyForeorderCreationParameters = {
19
+ source: 'cart';
20
+ } & CartForeorderCreationParameters;
21
+ export declare function AnyForeorderCreationParametersFromJSON(json: any): AnyForeorderCreationParameters;
22
+ export declare function AnyForeorderCreationParametersFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnyForeorderCreationParameters;
23
+ export declare function AnyForeorderCreationParametersToJSON(value?: AnyForeorderCreationParameters | null): any;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * lcdp-monolith-service
6
+ * This is the REST API of LCDP orders
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AnyForeorderCreationParametersToJSON = exports.AnyForeorderCreationParametersFromJSONTyped = exports.AnyForeorderCreationParametersFromJSON = void 0;
17
+ var CartForeorderCreationParameters_1 = require("./CartForeorderCreationParameters");
18
+ function AnyForeorderCreationParametersFromJSON(json) {
19
+ return AnyForeorderCreationParametersFromJSONTyped(json, false);
20
+ }
21
+ exports.AnyForeorderCreationParametersFromJSON = AnyForeorderCreationParametersFromJSON;
22
+ function AnyForeorderCreationParametersFromJSONTyped(json, ignoreDiscriminator) {
23
+ if (json == null) {
24
+ return json;
25
+ }
26
+ switch (json['source']) {
27
+ case 'cart':
28
+ return Object.assign({}, (0, CartForeorderCreationParameters_1.CartForeorderCreationParametersFromJSONTyped)(json, true), { source: 'cart' });
29
+ default:
30
+ throw new Error("No variant of AnyForeorderCreationParameters exists with 'source=".concat(json['source'], "'"));
31
+ }
32
+ }
33
+ exports.AnyForeorderCreationParametersFromJSONTyped = AnyForeorderCreationParametersFromJSONTyped;
34
+ function AnyForeorderCreationParametersToJSON(value) {
35
+ if (value == null) {
36
+ return value;
37
+ }
38
+ switch (value['source']) {
39
+ case 'cart':
40
+ return (0, CartForeorderCreationParameters_1.CartForeorderCreationParametersToJSON)(value);
41
+ default:
42
+ throw new Error("No variant of AnyForeorderCreationParameters exists with 'source=".concat(value['source'], "'"));
43
+ }
44
+ }
45
+ exports.AnyForeorderCreationParametersToJSON = AnyForeorderCreationParametersToJSON;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * lcdp-monolith-service
3
+ * This is the REST API of LCDP orders
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 type { ForeorderItemWarning } from './ForeorderItemWarning';
13
+ import type { ForeorderWarning } from './ForeorderWarning';
14
+ /**
15
+ * @type AnyForeorderWarning
16
+ *
17
+ * @export
18
+ */
19
+ export declare type AnyForeorderWarning = {
20
+ type: 'foreorder';
21
+ } & ForeorderWarning | {
22
+ type: 'foreorder_item';
23
+ } & ForeorderItemWarning;
24
+ export declare function AnyForeorderWarningFromJSON(json: any): AnyForeorderWarning;
25
+ export declare function AnyForeorderWarningFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnyForeorderWarning;
26
+ export declare function AnyForeorderWarningToJSON(value?: AnyForeorderWarning | null): any;