@lcdp/api-react-rest-client 2.11.5 → 2.12.0

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 (98) hide show
  1. package/auth/src/models/PagingMetadata.d.ts +4 -4
  2. package/auth/src/models/PagingMetadata.js +0 -4
  3. package/banking-operation/src/models/PagingMetadata.d.ts +4 -4
  4. package/banking-operation/src/models/PagingMetadata.js +0 -4
  5. package/catalog/src/models/PagingMetadata.d.ts +4 -4
  6. package/catalog/src/models/PagingMetadata.js +0 -4
  7. package/factory/src/models/PagingMetadata.d.ts +4 -4
  8. package/factory/src/models/PagingMetadata.js +0 -4
  9. package/favorite/src/models/PagingMetadata.d.ts +4 -4
  10. package/favorite/src/models/PagingMetadata.js +0 -4
  11. package/inventory/src/apis/ManageInventoryApi.d.ts +1 -28
  12. package/inventory/src/apis/ManageInventoryApi.js +8 -165
  13. package/inventory/src/apis/ManageInventorySynchronizationApi.d.ts +93 -0
  14. package/inventory/src/apis/ManageInventorySynchronizationApi.js +515 -0
  15. package/inventory/src/apis/index.d.ts +1 -0
  16. package/inventory/src/apis/index.js +1 -0
  17. package/inventory/src/models/AnyBuffer.d.ts +26 -0
  18. package/inventory/src/models/AnyBuffer.js +50 -0
  19. package/inventory/src/models/Buffer.d.ts +33 -0
  20. package/inventory/src/models/Buffer.js +47 -0
  21. package/inventory/src/models/FixedBuffer.d.ts +37 -0
  22. package/inventory/src/models/FixedBuffer.js +49 -0
  23. package/inventory/src/models/IdentifiedSynchronization.d.ts +52 -0
  24. package/inventory/src/models/IdentifiedSynchronization.js +62 -0
  25. package/inventory/src/models/PagingMetadata.d.ts +4 -4
  26. package/inventory/src/models/PagingMetadata.js +0 -4
  27. package/inventory/src/models/SalesForecastBuffer.d.ts +37 -0
  28. package/inventory/src/models/SalesForecastBuffer.js +49 -0
  29. package/inventory/src/models/Synchronization.d.ts +48 -0
  30. package/inventory/src/models/Synchronization.js +58 -0
  31. package/inventory/src/models/SynchronizationMode.d.ts +3 -3
  32. package/inventory/src/models/SynchronizationMode.js +3 -3
  33. package/inventory/src/models/SynchronizationProposal.d.ts +56 -0
  34. package/inventory/src/models/SynchronizationProposal.js +63 -0
  35. package/inventory/src/models/index.d.ts +7 -1
  36. package/inventory/src/models/index.js +7 -1
  37. package/invoice/src/models/Invoice.d.ts +2 -2
  38. package/invoice/src/models/OrderTally.d.ts +4 -4
  39. package/invoice/src/models/PagingMetadata.d.ts +4 -4
  40. package/invoice/src/models/PagingMetadata.js +0 -4
  41. package/laboratory/src/models/PagingMetadata.d.ts +4 -4
  42. package/laboratory/src/models/PagingMetadata.js +0 -4
  43. package/laboratory-store/src/models/PagingMetadata.d.ts +4 -4
  44. package/laboratory-store/src/models/PagingMetadata.js +0 -4
  45. package/laboratory-store-log/src/models/PagingMetadata.d.ts +4 -4
  46. package/laboratory-store-log/src/models/PagingMetadata.js +0 -4
  47. package/lexicon/src/models/PagingMetadata.d.ts +4 -4
  48. package/lexicon/src/models/PagingMetadata.js +0 -4
  49. package/message/src/models/PagingMetadata.d.ts +4 -4
  50. package/message/src/models/PagingMetadata.js +0 -4
  51. package/notification/src/models/PagingMetadata.d.ts +4 -4
  52. package/notification/src/models/PagingMetadata.js +0 -4
  53. package/order/src/models/Order.d.ts +1 -1
  54. package/order/src/models/Order.js +0 -2
  55. package/order/src/models/PagingMetadata.d.ts +4 -4
  56. package/order/src/models/PagingMetadata.js +0 -4
  57. package/order/src/models/UserLink.d.ts +1 -1
  58. package/order-log/src/models/PagingMetadata.d.ts +4 -4
  59. package/order-log/src/models/PagingMetadata.js +0 -4
  60. package/outrage-message/src/models/PagingMetadata.d.ts +4 -4
  61. package/outrage-message/src/models/PagingMetadata.js +0 -4
  62. package/package.json +1 -1
  63. package/product/src/models/PagingMetadata.d.ts +4 -4
  64. package/product/src/models/PagingMetadata.js +0 -4
  65. package/pub/src/models/Image.d.ts +0 -6
  66. package/pub/src/models/Image.js +0 -4
  67. package/pub/src/models/PagingMetadata.d.ts +4 -4
  68. package/pub/src/models/PagingMetadata.js +0 -4
  69. package/recommendation/src/models/PagingMetadata.d.ts +4 -4
  70. package/recommendation/src/models/PagingMetadata.js +0 -4
  71. package/rfx/src/models/PagingMetadata.d.ts +4 -4
  72. package/rfx/src/models/PagingMetadata.js +0 -4
  73. package/sale-offer/src/models/PagingMetadata.d.ts +4 -4
  74. package/sale-offer/src/models/PagingMetadata.js +0 -4
  75. package/sale-offer-log/src/models/PagingMetadata.d.ts +4 -4
  76. package/sale-offer-log/src/models/PagingMetadata.js +0 -4
  77. package/shipment/src/models/PagingMetadata.d.ts +4 -4
  78. package/shipment/src/models/PagingMetadata.js +0 -4
  79. package/shopping-cart/src/models/ProductLink.d.ts +1 -1
  80. package/statistic/src/models/PagingMetadata.d.ts +4 -4
  81. package/statistic/src/models/PagingMetadata.js +0 -4
  82. package/subscription/src/models/PagingMetadata.d.ts +4 -4
  83. package/subscription/src/models/PagingMetadata.js +0 -4
  84. package/thread/src/models/PagingMetadata.d.ts +4 -4
  85. package/thread/src/models/PagingMetadata.js +0 -4
  86. package/ubo/src/models/Birthplace.d.ts +38 -0
  87. package/ubo/src/models/Birthplace.js +52 -0
  88. package/ubo/src/models/Ubo.d.ts +3 -2
  89. package/ubo/src/models/Ubo.js +3 -2
  90. package/ubo/src/models/index.d.ts +1 -0
  91. package/ubo/src/models/index.js +1 -0
  92. package/user/src/models/PagingMetadata.d.ts +4 -4
  93. package/user/src/models/PagingMetadata.js +0 -4
  94. package/user/src/models/UserUpdateParameters.d.ts +1 -1
  95. package/wish/src/models/PagingMetadata.d.ts +4 -4
  96. package/wish/src/models/PagingMetadata.js +0 -4
  97. package/inventory/src/models/ActiveProductUpdateParameters.d.ts +0 -32
  98. package/inventory/src/models/ActiveProductUpdateParameters.js +0 -46
@@ -0,0 +1,515 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * lcdp-pharmaide-service
6
+ * This is the REST API of LCDP products
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: contact@lecomptoirdespharmacies.fr
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
41
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (_) try {
46
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.ManageInventorySynchronizationApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var ManageInventorySynchronizationApi = /** @class */ (function (_super) {
74
+ __extends(ManageInventorySynchronizationApi, _super);
75
+ function ManageInventorySynchronizationApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Change synchronization mode on products for current user
80
+ */
81
+ ManageInventorySynchronizationApi.prototype.createOrUpdateCurrentInventorySynchronizationRaw = function (requestParameters, initOverrides) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_1;
84
+ return __generator(this, function (_c) {
85
+ switch (_c.label) {
86
+ case 0:
87
+ if (requestParameters['synchronizationId'] == null) {
88
+ throw new runtime.RequiredError('synchronizationId', 'Required parameter "synchronizationId" was null or undefined when calling createOrUpdateCurrentInventorySynchronization().');
89
+ }
90
+ if (requestParameters['synchronization'] == null) {
91
+ throw new runtime.RequiredError('synchronization', 'Required parameter "synchronization" was null or undefined when calling createOrUpdateCurrentInventorySynchronization().');
92
+ }
93
+ queryParameters = {};
94
+ headerParameters = {};
95
+ headerParameters['Content-Type'] = 'application/json';
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: "/inventories/me/synchronizations/{synchronizationId}".replace("{".concat("synchronizationId", "}"), encodeURIComponent(String(requestParameters['synchronizationId']))),
117
+ method: 'PUT',
118
+ headers: headerParameters,
119
+ query: queryParameters,
120
+ body: (0, index_1.SynchronizationToJSON)(requestParameters['synchronization']),
121
+ }, initOverrides)];
122
+ case 5:
123
+ response = _c.sent();
124
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
125
+ case 6:
126
+ response_1 = _c.sent();
127
+ console.debug(response_1);
128
+ throw response_1;
129
+ case 7: return [2 /*return*/];
130
+ }
131
+ });
132
+ });
133
+ };
134
+ /**
135
+ * Change synchronization mode on products for current user
136
+ */
137
+ ManageInventorySynchronizationApi.prototype.createOrUpdateCurrentInventorySynchronization = function (requestParameters, initOverrides) {
138
+ return __awaiter(this, void 0, void 0, function () {
139
+ return __generator(this, function (_a) {
140
+ switch (_a.label) {
141
+ case 0: return [4 /*yield*/, this.createOrUpdateCurrentInventorySynchronizationRaw(requestParameters, initOverrides)];
142
+ case 1:
143
+ _a.sent();
144
+ return [2 /*return*/];
145
+ }
146
+ });
147
+ });
148
+ };
149
+ /**
150
+ * Replace the list of product synchronizations for the current user
151
+ */
152
+ ManageInventorySynchronizationApi.prototype.createOrUpdateCurrentInventorySynchronizationsRaw = function (requestParameters, initOverrides) {
153
+ return __awaiter(this, void 0, void 0, function () {
154
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_2;
155
+ return __generator(this, function (_c) {
156
+ switch (_c.label) {
157
+ case 0:
158
+ if (requestParameters['identifiedSynchronization'] == null) {
159
+ throw new runtime.RequiredError('identifiedSynchronization', 'Required parameter "identifiedSynchronization" was null or undefined when calling createOrUpdateCurrentInventorySynchronizations().');
160
+ }
161
+ queryParameters = {};
162
+ headerParameters = {};
163
+ headerParameters['Content-Type'] = 'application/json';
164
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
165
+ _a = headerParameters;
166
+ _b = "x-api-key";
167
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
168
+ case 1:
169
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
170
+ _c.label = 2;
171
+ case 2:
172
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
173
+ token = this.configuration.accessToken;
174
+ return [4 /*yield*/, token("bearerAuth", [])];
175
+ case 3:
176
+ tokenString = _c.sent();
177
+ if (tokenString) {
178
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
179
+ }
180
+ _c.label = 4;
181
+ case 4:
182
+ _c.trys.push([4, 6, , 7]);
183
+ return [4 /*yield*/, this.request({
184
+ path: "/inventories/me/synchronizations",
185
+ method: 'PUT',
186
+ headers: headerParameters,
187
+ query: queryParameters,
188
+ body: requestParameters['identifiedSynchronization'].map(index_1.IdentifiedSynchronizationToJSON),
189
+ }, initOverrides)];
190
+ case 5:
191
+ response = _c.sent();
192
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
193
+ case 6:
194
+ response_2 = _c.sent();
195
+ console.debug(response_2);
196
+ throw response_2;
197
+ case 7: return [2 /*return*/];
198
+ }
199
+ });
200
+ });
201
+ };
202
+ /**
203
+ * Replace the list of product synchronizations for the current user
204
+ */
205
+ ManageInventorySynchronizationApi.prototype.createOrUpdateCurrentInventorySynchronizations = function (requestParameters, initOverrides) {
206
+ return __awaiter(this, void 0, void 0, function () {
207
+ return __generator(this, function (_a) {
208
+ switch (_a.label) {
209
+ case 0: return [4 /*yield*/, this.createOrUpdateCurrentInventorySynchronizationsRaw(requestParameters, initOverrides)];
210
+ case 1:
211
+ _a.sent();
212
+ return [2 /*return*/];
213
+ }
214
+ });
215
+ });
216
+ };
217
+ /**
218
+ * Change synchronization mode on products for a user
219
+ */
220
+ ManageInventorySynchronizationApi.prototype.createOrUpdateInventorySynchronizationRaw = function (requestParameters, initOverrides) {
221
+ return __awaiter(this, void 0, void 0, function () {
222
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_3;
223
+ return __generator(this, function (_c) {
224
+ switch (_c.label) {
225
+ case 0:
226
+ if (requestParameters['inventoryId'] == null) {
227
+ throw new runtime.RequiredError('inventoryId', 'Required parameter "inventoryId" was null or undefined when calling createOrUpdateInventorySynchronization().');
228
+ }
229
+ if (requestParameters['synchronizationId'] == null) {
230
+ throw new runtime.RequiredError('synchronizationId', 'Required parameter "synchronizationId" was null or undefined when calling createOrUpdateInventorySynchronization().');
231
+ }
232
+ if (requestParameters['synchronization'] == null) {
233
+ throw new runtime.RequiredError('synchronization', 'Required parameter "synchronization" was null or undefined when calling createOrUpdateInventorySynchronization().');
234
+ }
235
+ queryParameters = {};
236
+ headerParameters = {};
237
+ headerParameters['Content-Type'] = 'application/json';
238
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
239
+ _a = headerParameters;
240
+ _b = "x-api-key";
241
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
242
+ case 1:
243
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
244
+ _c.label = 2;
245
+ case 2:
246
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
247
+ token = this.configuration.accessToken;
248
+ return [4 /*yield*/, token("bearerAuth", [])];
249
+ case 3:
250
+ tokenString = _c.sent();
251
+ if (tokenString) {
252
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
253
+ }
254
+ _c.label = 4;
255
+ case 4:
256
+ _c.trys.push([4, 6, , 7]);
257
+ return [4 /*yield*/, this.request({
258
+ path: "/inventories/{inventoryId}/synchronizations/{synchronizationId}".replace("{".concat("inventoryId", "}"), encodeURIComponent(String(requestParameters['inventoryId']))).replace("{".concat("synchronizationId", "}"), encodeURIComponent(String(requestParameters['synchronizationId']))),
259
+ method: 'PUT',
260
+ headers: headerParameters,
261
+ query: queryParameters,
262
+ body: (0, index_1.SynchronizationToJSON)(requestParameters['synchronization']),
263
+ }, initOverrides)];
264
+ case 5:
265
+ response = _c.sent();
266
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
267
+ case 6:
268
+ response_3 = _c.sent();
269
+ console.debug(response_3);
270
+ throw response_3;
271
+ case 7: return [2 /*return*/];
272
+ }
273
+ });
274
+ });
275
+ };
276
+ /**
277
+ * Change synchronization mode on products for a user
278
+ */
279
+ ManageInventorySynchronizationApi.prototype.createOrUpdateInventorySynchronization = function (requestParameters, initOverrides) {
280
+ return __awaiter(this, void 0, void 0, function () {
281
+ return __generator(this, function (_a) {
282
+ switch (_a.label) {
283
+ case 0: return [4 /*yield*/, this.createOrUpdateInventorySynchronizationRaw(requestParameters, initOverrides)];
284
+ case 1:
285
+ _a.sent();
286
+ return [2 /*return*/];
287
+ }
288
+ });
289
+ });
290
+ };
291
+ /**
292
+ * Replace the list of product synchronizations for a user
293
+ */
294
+ ManageInventorySynchronizationApi.prototype.createOrUpdateInventorySynchronizationsRaw = function (requestParameters, initOverrides) {
295
+ return __awaiter(this, void 0, void 0, function () {
296
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_4;
297
+ return __generator(this, function (_c) {
298
+ switch (_c.label) {
299
+ case 0:
300
+ if (requestParameters['inventoryId'] == null) {
301
+ throw new runtime.RequiredError('inventoryId', 'Required parameter "inventoryId" was null or undefined when calling createOrUpdateInventorySynchronizations().');
302
+ }
303
+ if (requestParameters['identifiedSynchronization'] == null) {
304
+ throw new runtime.RequiredError('identifiedSynchronization', 'Required parameter "identifiedSynchronization" was null or undefined when calling createOrUpdateInventorySynchronizations().');
305
+ }
306
+ queryParameters = {};
307
+ headerParameters = {};
308
+ headerParameters['Content-Type'] = 'application/json';
309
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
310
+ _a = headerParameters;
311
+ _b = "x-api-key";
312
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
313
+ case 1:
314
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
315
+ _c.label = 2;
316
+ case 2:
317
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
318
+ token = this.configuration.accessToken;
319
+ return [4 /*yield*/, token("bearerAuth", [])];
320
+ case 3:
321
+ tokenString = _c.sent();
322
+ if (tokenString) {
323
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
324
+ }
325
+ _c.label = 4;
326
+ case 4:
327
+ _c.trys.push([4, 6, , 7]);
328
+ return [4 /*yield*/, this.request({
329
+ path: "/inventories/{inventoryId}/synchronizations".replace("{".concat("inventoryId", "}"), encodeURIComponent(String(requestParameters['inventoryId']))),
330
+ method: 'PUT',
331
+ headers: headerParameters,
332
+ query: queryParameters,
333
+ body: requestParameters['identifiedSynchronization'].map(index_1.IdentifiedSynchronizationToJSON),
334
+ }, initOverrides)];
335
+ case 5:
336
+ response = _c.sent();
337
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
338
+ case 6:
339
+ response_4 = _c.sent();
340
+ console.debug(response_4);
341
+ throw response_4;
342
+ case 7: return [2 /*return*/];
343
+ }
344
+ });
345
+ });
346
+ };
347
+ /**
348
+ * Replace the list of product synchronizations for a user
349
+ */
350
+ ManageInventorySynchronizationApi.prototype.createOrUpdateInventorySynchronizations = function (requestParameters, initOverrides) {
351
+ return __awaiter(this, void 0, void 0, function () {
352
+ return __generator(this, function (_a) {
353
+ switch (_a.label) {
354
+ case 0: return [4 /*yield*/, this.createOrUpdateInventorySynchronizationsRaw(requestParameters, initOverrides)];
355
+ case 1:
356
+ _a.sent();
357
+ return [2 /*return*/];
358
+ }
359
+ });
360
+ });
361
+ };
362
+ /**
363
+ * Replace synchronization for each product matched by syncMode: If syncMode is not defined, so replace all product synchronization
364
+ */
365
+ ManageInventorySynchronizationApi.prototype.updateCurrentInventorySynchronizationsRaw = function (requestParameters, initOverrides) {
366
+ return __awaiter(this, void 0, void 0, function () {
367
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_5;
368
+ return __generator(this, function (_c) {
369
+ switch (_c.label) {
370
+ case 0:
371
+ if (requestParameters['synchronization'] == null) {
372
+ throw new runtime.RequiredError('synchronization', 'Required parameter "synchronization" was null or undefined when calling updateCurrentInventorySynchronizations().');
373
+ }
374
+ queryParameters = {};
375
+ if (requestParameters['idEq'] != null) {
376
+ queryParameters['id[eq]'] = requestParameters['idEq'];
377
+ }
378
+ if (requestParameters['modeEq'] != null) {
379
+ queryParameters['mode[eq]'] = requestParameters['modeEq'];
380
+ }
381
+ headerParameters = {};
382
+ headerParameters['Content-Type'] = 'application/json';
383
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
384
+ _a = headerParameters;
385
+ _b = "x-api-key";
386
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
387
+ case 1:
388
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
389
+ _c.label = 2;
390
+ case 2:
391
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
392
+ token = this.configuration.accessToken;
393
+ return [4 /*yield*/, token("bearerAuth", [])];
394
+ case 3:
395
+ tokenString = _c.sent();
396
+ if (tokenString) {
397
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
398
+ }
399
+ _c.label = 4;
400
+ case 4:
401
+ _c.trys.push([4, 6, , 7]);
402
+ return [4 /*yield*/, this.request({
403
+ path: "/inventories/me/synchronizations",
404
+ method: 'PATCH',
405
+ headers: headerParameters,
406
+ query: queryParameters,
407
+ body: (0, index_1.SynchronizationToJSON)(requestParameters['synchronization']),
408
+ }, initOverrides)];
409
+ case 5:
410
+ response = _c.sent();
411
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
412
+ case 6:
413
+ response_5 = _c.sent();
414
+ console.debug(response_5);
415
+ throw response_5;
416
+ case 7: return [2 /*return*/];
417
+ }
418
+ });
419
+ });
420
+ };
421
+ /**
422
+ * Replace synchronization for each product matched by syncMode: If syncMode is not defined, so replace all product synchronization
423
+ */
424
+ ManageInventorySynchronizationApi.prototype.updateCurrentInventorySynchronizations = function (requestParameters, initOverrides) {
425
+ return __awaiter(this, void 0, void 0, function () {
426
+ return __generator(this, function (_a) {
427
+ switch (_a.label) {
428
+ case 0: return [4 /*yield*/, this.updateCurrentInventorySynchronizationsRaw(requestParameters, initOverrides)];
429
+ case 1:
430
+ _a.sent();
431
+ return [2 /*return*/];
432
+ }
433
+ });
434
+ });
435
+ };
436
+ /**
437
+ * Replace synchronization for each product matched by syncMode: If syncMode is not defined, so replace all product synchronization
438
+ */
439
+ ManageInventorySynchronizationApi.prototype.updateInventorySynchronizationsRaw = function (requestParameters, initOverrides) {
440
+ return __awaiter(this, void 0, void 0, function () {
441
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_6;
442
+ return __generator(this, function (_c) {
443
+ switch (_c.label) {
444
+ case 0:
445
+ if (requestParameters['inventoryId'] == null) {
446
+ throw new runtime.RequiredError('inventoryId', 'Required parameter "inventoryId" was null or undefined when calling updateInventorySynchronizations().');
447
+ }
448
+ if (requestParameters['synchronization'] == null) {
449
+ throw new runtime.RequiredError('synchronization', 'Required parameter "synchronization" was null or undefined when calling updateInventorySynchronizations().');
450
+ }
451
+ queryParameters = {};
452
+ if (requestParameters['idEq'] != null) {
453
+ queryParameters['id[eq]'] = requestParameters['idEq'];
454
+ }
455
+ if (requestParameters['modeEq'] != null) {
456
+ queryParameters['mode[eq]'] = requestParameters['modeEq'];
457
+ }
458
+ headerParameters = {};
459
+ headerParameters['Content-Type'] = 'application/json';
460
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
461
+ _a = headerParameters;
462
+ _b = "x-api-key";
463
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
464
+ case 1:
465
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
466
+ _c.label = 2;
467
+ case 2:
468
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
469
+ token = this.configuration.accessToken;
470
+ return [4 /*yield*/, token("bearerAuth", [])];
471
+ case 3:
472
+ tokenString = _c.sent();
473
+ if (tokenString) {
474
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
475
+ }
476
+ _c.label = 4;
477
+ case 4:
478
+ _c.trys.push([4, 6, , 7]);
479
+ return [4 /*yield*/, this.request({
480
+ path: "/inventories/{inventoryId}/synchronizations".replace("{".concat("inventoryId", "}"), encodeURIComponent(String(requestParameters['inventoryId']))),
481
+ method: 'PATCH',
482
+ headers: headerParameters,
483
+ query: queryParameters,
484
+ body: (0, index_1.SynchronizationToJSON)(requestParameters['synchronization']),
485
+ }, initOverrides)];
486
+ case 5:
487
+ response = _c.sent();
488
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
489
+ case 6:
490
+ response_6 = _c.sent();
491
+ console.debug(response_6);
492
+ throw response_6;
493
+ case 7: return [2 /*return*/];
494
+ }
495
+ });
496
+ });
497
+ };
498
+ /**
499
+ * Replace synchronization for each product matched by syncMode: If syncMode is not defined, so replace all product synchronization
500
+ */
501
+ ManageInventorySynchronizationApi.prototype.updateInventorySynchronizations = function (requestParameters, initOverrides) {
502
+ return __awaiter(this, void 0, void 0, function () {
503
+ return __generator(this, function (_a) {
504
+ switch (_a.label) {
505
+ case 0: return [4 /*yield*/, this.updateInventorySynchronizationsRaw(requestParameters, initOverrides)];
506
+ case 1:
507
+ _a.sent();
508
+ return [2 /*return*/];
509
+ }
510
+ });
511
+ });
512
+ };
513
+ return ManageInventorySynchronizationApi;
514
+ }(runtime.BaseAPI));
515
+ exports.ManageInventorySynchronizationApi = ManageInventorySynchronizationApi;
@@ -1,2 +1,3 @@
1
1
  export * from './ManageInventoryApi';
2
+ export * from './ManageInventorySynchronizationApi';
2
3
  export * from './SearchInventoryApi';
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
19
  __exportStar(require("./ManageInventoryApi"), exports);
20
+ __exportStar(require("./ManageInventorySynchronizationApi"), exports);
20
21
  __exportStar(require("./SearchInventoryApi"), exports);
@@ -0,0 +1,26 @@
1
+ /**
2
+ * lcdp-pharmaide-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 type { FixedBuffer } from './FixedBuffer';
13
+ import type { SalesForecastBuffer } from './SalesForecastBuffer';
14
+ /**
15
+ * @type AnyBuffer
16
+ *
17
+ * @export
18
+ */
19
+ export declare type AnyBuffer = {
20
+ strategy: 'FIXED';
21
+ } & FixedBuffer | {
22
+ strategy: 'SALES_FORECAST';
23
+ } & SalesForecastBuffer;
24
+ export declare function AnyBufferFromJSON(json: any): AnyBuffer;
25
+ export declare function AnyBufferFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnyBuffer;
26
+ export declare function AnyBufferToJSON(value?: AnyBuffer | null): any;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * lcdp-pharmaide-service
6
+ * This is the REST API of LCDP products
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: contact@lecomptoirdespharmacies.fr
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AnyBufferToJSON = exports.AnyBufferFromJSONTyped = exports.AnyBufferFromJSON = void 0;
17
+ var FixedBuffer_1 = require("./FixedBuffer");
18
+ var SalesForecastBuffer_1 = require("./SalesForecastBuffer");
19
+ function AnyBufferFromJSON(json) {
20
+ return AnyBufferFromJSONTyped(json, false);
21
+ }
22
+ exports.AnyBufferFromJSON = AnyBufferFromJSON;
23
+ function AnyBufferFromJSONTyped(json, ignoreDiscriminator) {
24
+ if (json == null) {
25
+ return json;
26
+ }
27
+ switch (json['strategy']) {
28
+ case 'FIXED':
29
+ return Object.assign({}, (0, FixedBuffer_1.FixedBufferFromJSONTyped)(json, true), { strategy: 'FIXED' });
30
+ case 'SALES_FORECAST':
31
+ return Object.assign({}, (0, SalesForecastBuffer_1.SalesForecastBufferFromJSONTyped)(json, true), { strategy: 'SALES_FORECAST' });
32
+ default:
33
+ throw new Error("No variant of AnyBuffer exists with 'strategy=".concat(json['strategy'], "'"));
34
+ }
35
+ }
36
+ exports.AnyBufferFromJSONTyped = AnyBufferFromJSONTyped;
37
+ function AnyBufferToJSON(value) {
38
+ if (value == null) {
39
+ return value;
40
+ }
41
+ switch (value['strategy']) {
42
+ case 'FIXED':
43
+ return (0, FixedBuffer_1.FixedBufferToJSON)(value);
44
+ case 'SALES_FORECAST':
45
+ return (0, SalesForecastBuffer_1.SalesForecastBufferToJSON)(value);
46
+ default:
47
+ throw new Error("No variant of AnyBuffer exists with 'strategy=".concat(value['strategy'], "'"));
48
+ }
49
+ }
50
+ exports.AnyBufferToJSON = AnyBufferToJSON;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * lcdp-pharmaide-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
+ /**
13
+ * Buffer to apply on current inventory stock when synchronizing user stock with his offer.
14
+ * For example, if buffer is raw 10 units and stock is 15 units, the final offer on platform should be 5 units
15
+ *
16
+ * @export
17
+ * @interface Buffer
18
+ */
19
+ export interface Buffer {
20
+ /**
21
+ * Buffer strategy
22
+ * @type {string}
23
+ * @memberof Buffer
24
+ */
25
+ strategy: string;
26
+ }
27
+ /**
28
+ * Check if a given object implements the Buffer interface.
29
+ */
30
+ export declare function instanceOfBuffer(value: object): value is Buffer;
31
+ export declare function BufferFromJSON(json: any): Buffer;
32
+ export declare function BufferFromJSONTyped(json: any, ignoreDiscriminator: boolean): Buffer;
33
+ export declare function BufferToJSON(value?: Buffer | null): any;