@lcdp/api-react-rest-client 2.5.14-develop.7801552709 → 2.5.14-develop.8064013522

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 (39) hide show
  1. package/configuration/src/apis/ManageVariableApi.d.ts +28 -1
  2. package/configuration/src/apis/ManageVariableApi.js +160 -4
  3. package/configuration/src/models/Variable.d.ts +2 -2
  4. package/configuration/src/models/Variable.js +2 -3
  5. package/configuration/src/models/Vat.d.ts +3 -3
  6. package/configuration/src/models/Vat.js +3 -4
  7. package/order/src/apis/ManageFreeCarriageCouponApi.d.ts +42 -0
  8. package/order/src/apis/ManageFreeCarriageCouponApi.js +233 -0
  9. package/order/src/apis/SearchFreeCarriageCouponApi.d.ts +49 -0
  10. package/order/src/apis/SearchFreeCarriageCouponApi.js +202 -0
  11. package/order/src/apis/SearchOrderApi.d.ts +1 -1
  12. package/order/src/apis/SearchOrderApi.js +2 -2
  13. package/order/src/apis/index.d.ts +2 -0
  14. package/order/src/apis/index.js +2 -0
  15. package/order/src/models/FreeCarriageCoupon.d.ts +82 -0
  16. package/order/src/models/FreeCarriageCoupon.js +61 -0
  17. package/order/src/models/FreeCarriageCouponCreationParameters.d.ts +57 -0
  18. package/order/src/models/FreeCarriageCouponCreationParameters.js +52 -0
  19. package/order/src/models/FreeCarriageCouponOwnerLink.d.ts +28 -0
  20. package/order/src/models/FreeCarriageCouponOwnerLink.js +49 -0
  21. package/order/src/models/FreeCarriageCouponOwnerLinkAllOf.d.ts +27 -0
  22. package/order/src/models/FreeCarriageCouponOwnerLinkAllOf.js +41 -0
  23. package/order/src/models/OrderJournal.d.ts +1 -1
  24. package/order/src/models/OrderJournal.js +2 -2
  25. package/order/src/models/PaginatedFreeCarriageCoupons.d.ts +29 -0
  26. package/order/src/models/PaginatedFreeCarriageCoupons.js +50 -0
  27. package/order/src/models/PaginatedFreeCarriageCouponsAllOf.d.ts +28 -0
  28. package/order/src/models/PaginatedFreeCarriageCouponsAllOf.js +42 -0
  29. package/order/src/models/index.d.ts +6 -0
  30. package/order/src/models/index.js +6 -0
  31. package/package.json +1 -1
  32. package/product/src/apis/SearchProductApi.d.ts +1 -1
  33. package/product/src/apis/SearchProductApi.js +2 -2
  34. package/product/src/models/Vat.d.ts +3 -3
  35. package/product/src/models/Vat.js +3 -4
  36. package/pub/src/apis/SearchPubApi.d.ts +1 -1
  37. package/pub/src/apis/SearchPubApi.js +2 -2
  38. package/user/src/apis/SearchUserApi.d.ts +1 -1
  39. package/user/src/apis/SearchUserApi.js +2 -2
@@ -9,7 +9,14 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { BaseAPI, ApiResponse } from '../runtime';
12
+ import { BaseAPI, ApiResponse, BlobWithMeta } from '../runtime';
13
+ import { Variable } from '../models';
14
+ export interface CreateVariableRequest {
15
+ body: Variable;
16
+ }
17
+ export interface DeleteVariableRequest {
18
+ variableId: string;
19
+ }
13
20
  export interface SetVariableValueRequest {
14
21
  variableId: string;
15
22
  body: string;
@@ -18,6 +25,26 @@ export interface SetVariableValueRequest {
18
25
  * no description
19
26
  */
20
27
  export declare class ManageVariableApi extends BaseAPI {
28
+ /**
29
+ * Important Note : - Only variabledId prefixed by \'free.carriage.threshold.*\' and \'free.carriage.monthly.*\' can be created.
30
+ * Create new variable
31
+ */
32
+ createVariableRaw(requestParameters: CreateVariableRequest): Promise<ApiResponse<Variable | BlobWithMeta>>;
33
+ /**
34
+ * Important Note : - Only variabledId prefixed by \'free.carriage.threshold.*\' and \'free.carriage.monthly.*\' can be created.
35
+ * Create new variable
36
+ */
37
+ createVariable(requestParameters: CreateVariableRequest): Promise<Variable | BlobWithMeta>;
38
+ /**
39
+ * Important Note : - Only variabledId prefixed by \'free.carriage.threshold.*\' and \'free.carriage.monthly.*\' can be deleted.
40
+ * Delete existing variable
41
+ */
42
+ deleteVariableRaw(requestParameters: DeleteVariableRequest): Promise<ApiResponse<void>>;
43
+ /**
44
+ * Important Note : - Only variabledId prefixed by \'free.carriage.threshold.*\' and \'free.carriage.monthly.*\' can be deleted.
45
+ * Delete existing variable
46
+ */
47
+ deleteVariable(requestParameters: DeleteVariableRequest): Promise<void>;
21
48
  /**
22
49
  * Update variable value
23
50
  */
@@ -66,6 +66,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
66
66
  Object.defineProperty(exports, "__esModule", { value: true });
67
67
  exports.ManageVariableApi = void 0;
68
68
  var runtime_1 = require("../runtime");
69
+ var models_1 = require("../models");
69
70
  /**
70
71
  * no description
71
72
  */
@@ -74,12 +75,167 @@ var ManageVariableApi = /** @class */ (function (_super) {
74
75
  function ManageVariableApi() {
75
76
  return _super !== null && _super.apply(this, arguments) || this;
76
77
  }
78
+ /**
79
+ * Important Note : - Only variabledId prefixed by \'free.carriage.threshold.*\' and \'free.carriage.monthly.*\' can be created.
80
+ * Create new variable
81
+ */
82
+ ManageVariableApi.prototype.createVariableRaw = function (requestParameters) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, token, tokenString, _a, response, contentType, response_1;
85
+ return __generator(this, function (_b) {
86
+ switch (_b.label) {
87
+ case 0:
88
+ if (requestParameters.body === null || requestParameters.body === undefined) {
89
+ throw new runtime_1.RequiredError('body', 'Required parameter requestParameters.body was null or undefined when calling createVariable.');
90
+ }
91
+ queryParameters = {};
92
+ headerParameters = {};
93
+ headerParameters['Content-Type'] = 'application/json';
94
+ if (this.configuration && this.configuration.apiKey) {
95
+ headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
96
+ }
97
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
98
+ token = this.configuration.accessToken;
99
+ if (!(typeof token === 'function')) return [3 /*break*/, 2];
100
+ return [4 /*yield*/, token("bearerAuth", [])];
101
+ case 1:
102
+ _a = _b.sent();
103
+ return [3 /*break*/, 3];
104
+ case 2:
105
+ _a = token;
106
+ _b.label = 3;
107
+ case 3:
108
+ tokenString = _a;
109
+ if (tokenString) {
110
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
111
+ }
112
+ _b.label = 4;
113
+ case 4:
114
+ _b.trys.push([4, 6, , 7]);
115
+ return [4 /*yield*/, this.request({
116
+ path: "/variables",
117
+ method: 'POST',
118
+ headers: headerParameters,
119
+ query: queryParameters,
120
+ body: requestParameters.body,
121
+ })];
122
+ case 5:
123
+ response = _b.sent();
124
+ contentType = response.headers.get("content-type");
125
+ if (contentType && contentType.indexOf("application/json") !== -1) {
126
+ return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.VariableFromJSON)(jsonValue); })];
127
+ }
128
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
129
+ return [2 /*return*/, new runtime_1.TextApiResponse(response)];
130
+ }
131
+ else {
132
+ // TODO : Better handling of others application types
133
+ return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
134
+ }
135
+ return [3 /*break*/, 7];
136
+ case 6:
137
+ response_1 = _b.sent();
138
+ console.debug(response_1);
139
+ throw response_1;
140
+ case 7: return [2 /*return*/];
141
+ }
142
+ });
143
+ });
144
+ };
145
+ /**
146
+ * Important Note : - Only variabledId prefixed by \'free.carriage.threshold.*\' and \'free.carriage.monthly.*\' can be created.
147
+ * Create new variable
148
+ */
149
+ ManageVariableApi.prototype.createVariable = function (requestParameters) {
150
+ return __awaiter(this, void 0, void 0, function () {
151
+ var response;
152
+ return __generator(this, function (_a) {
153
+ switch (_a.label) {
154
+ case 0: return [4 /*yield*/, this.createVariableRaw(requestParameters)];
155
+ case 1:
156
+ response = _a.sent();
157
+ return [4 /*yield*/, response.value()];
158
+ case 2: return [2 /*return*/, _a.sent()];
159
+ }
160
+ });
161
+ });
162
+ };
163
+ /**
164
+ * Important Note : - Only variabledId prefixed by \'free.carriage.threshold.*\' and \'free.carriage.monthly.*\' can be deleted.
165
+ * Delete existing variable
166
+ */
167
+ ManageVariableApi.prototype.deleteVariableRaw = function (requestParameters) {
168
+ return __awaiter(this, void 0, void 0, function () {
169
+ var queryParameters, headerParameters, token, tokenString, _a, response, response_2;
170
+ return __generator(this, function (_b) {
171
+ switch (_b.label) {
172
+ case 0:
173
+ if (requestParameters.variableId === null || requestParameters.variableId === undefined) {
174
+ throw new runtime_1.RequiredError('variableId', 'Required parameter requestParameters.variableId was null or undefined when calling deleteVariable.');
175
+ }
176
+ queryParameters = {};
177
+ headerParameters = {};
178
+ if (this.configuration && this.configuration.apiKey) {
179
+ headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
180
+ }
181
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
182
+ token = this.configuration.accessToken;
183
+ if (!(typeof token === 'function')) return [3 /*break*/, 2];
184
+ return [4 /*yield*/, token("bearerAuth", [])];
185
+ case 1:
186
+ _a = _b.sent();
187
+ return [3 /*break*/, 3];
188
+ case 2:
189
+ _a = token;
190
+ _b.label = 3;
191
+ case 3:
192
+ tokenString = _a;
193
+ if (tokenString) {
194
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
195
+ }
196
+ _b.label = 4;
197
+ case 4:
198
+ _b.trys.push([4, 6, , 7]);
199
+ return [4 /*yield*/, this.request({
200
+ path: "/variables/{variableId}".replace("{".concat("variableId", "}"), encodeURIComponent(String(requestParameters.variableId))),
201
+ method: 'DELETE',
202
+ headers: headerParameters,
203
+ query: queryParameters,
204
+ })];
205
+ case 5:
206
+ response = _b.sent();
207
+ return [2 /*return*/, new runtime_1.VoidApiResponse(response)];
208
+ case 6:
209
+ response_2 = _b.sent();
210
+ console.debug(response_2);
211
+ throw response_2;
212
+ case 7: return [2 /*return*/];
213
+ }
214
+ });
215
+ });
216
+ };
217
+ /**
218
+ * Important Note : - Only variabledId prefixed by \'free.carriage.threshold.*\' and \'free.carriage.monthly.*\' can be deleted.
219
+ * Delete existing variable
220
+ */
221
+ ManageVariableApi.prototype.deleteVariable = function (requestParameters) {
222
+ return __awaiter(this, void 0, void 0, function () {
223
+ return __generator(this, function (_a) {
224
+ switch (_a.label) {
225
+ case 0: return [4 /*yield*/, this.deleteVariableRaw(requestParameters)];
226
+ case 1:
227
+ _a.sent();
228
+ return [2 /*return*/];
229
+ }
230
+ });
231
+ });
232
+ };
77
233
  /**
78
234
  * Update variable value
79
235
  */
80
236
  ManageVariableApi.prototype.setVariableValueRaw = function (requestParameters) {
81
237
  return __awaiter(this, void 0, void 0, function () {
82
- var queryParameters, headerParameters, token, tokenString, _a, response, response_1;
238
+ var queryParameters, headerParameters, token, tokenString, _a, response, response_3;
83
239
  return __generator(this, function (_b) {
84
240
  switch (_b.label) {
85
241
  case 0:
@@ -124,9 +280,9 @@ var ManageVariableApi = /** @class */ (function (_super) {
124
280
  response = _b.sent();
125
281
  return [2 /*return*/, new runtime_1.VoidApiResponse(response)];
126
282
  case 6:
127
- response_1 = _b.sent();
128
- console.debug(response_1);
129
- throw response_1;
283
+ response_3 = _b.sent();
284
+ console.debug(response_3);
285
+ throw response_3;
130
286
  case 7: return [2 /*return*/];
131
287
  }
132
288
  });
@@ -20,13 +20,13 @@ export interface Variable {
20
20
  * @type {string}
21
21
  * @memberof Variable
22
22
  */
23
- id?: string;
23
+ id: string;
24
24
  /**
25
25
  * variable value
26
26
  * @type {string}
27
27
  * @memberof Variable
28
28
  */
29
- value?: string;
29
+ value: string;
30
30
  }
31
31
  export declare function VariableFromJSON(json: any): Variable;
32
32
  export declare function VariableFromJSONTyped(json: any, ignoreDiscriminator: boolean): Variable;
@@ -14,7 +14,6 @@
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.VariableToJSON = exports.VariableFromJSONTyped = exports.VariableFromJSON = void 0;
17
- var runtime_1 = require("../runtime");
18
17
  function VariableFromJSON(json) {
19
18
  return VariableFromJSONTyped(json, false);
20
19
  }
@@ -24,8 +23,8 @@ function VariableFromJSONTyped(json, ignoreDiscriminator) {
24
23
  return json;
25
24
  }
26
25
  return {
27
- 'id': !(0, runtime_1.exists)(json, 'id') ? undefined : json['id'],
28
- 'value': !(0, runtime_1.exists)(json, 'value') ? undefined : json['value'],
26
+ 'id': json['id'],
27
+ 'value': json['value'],
29
28
  };
30
29
  }
31
30
  exports.VariableFromJSONTyped = VariableFromJSONTyped;
@@ -20,19 +20,19 @@ export interface Vat {
20
20
  * @type {string}
21
21
  * @memberof Vat
22
22
  */
23
- id?: string;
23
+ id: string;
24
24
  /**
25
25
  * Vat name
26
26
  * @type {string}
27
27
  * @memberof Vat
28
28
  */
29
- name?: string;
29
+ name: string;
30
30
  /**
31
31
  * Vat value
32
32
  * @type {number}
33
33
  * @memberof Vat
34
34
  */
35
- value?: number;
35
+ value: number;
36
36
  }
37
37
  export declare function VatFromJSON(json: any): Vat;
38
38
  export declare function VatFromJSONTyped(json: any, ignoreDiscriminator: boolean): Vat;
@@ -14,7 +14,6 @@
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.VatToJSON = exports.VatFromJSONTyped = exports.VatFromJSON = void 0;
17
- var runtime_1 = require("../runtime");
18
17
  function VatFromJSON(json) {
19
18
  return VatFromJSONTyped(json, false);
20
19
  }
@@ -24,9 +23,9 @@ function VatFromJSONTyped(json, ignoreDiscriminator) {
24
23
  return json;
25
24
  }
26
25
  return {
27
- 'id': !(0, runtime_1.exists)(json, 'id') ? undefined : json['id'],
28
- 'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'],
29
- 'value': !(0, runtime_1.exists)(json, 'value') ? undefined : json['value'],
26
+ 'id': json['id'],
27
+ 'name': json['name'],
28
+ 'value': json['value'],
30
29
  };
31
30
  }
32
31
  exports.VatFromJSONTyped = VatFromJSONTyped;
@@ -0,0 +1,42 @@
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 { BaseAPI, ApiResponse, BlobWithMeta } from '../runtime';
13
+ import { FreeCarriageCoupon, FreeCarriageCouponCreationParameters } from '../models';
14
+ export interface CreateFreeCarriageCouponsRequest {
15
+ freeCarriageCouponCreationParameters: Array<FreeCarriageCouponCreationParameters>;
16
+ }
17
+ export interface DeleteFreeCarriageCouponRequest {
18
+ freeCarriageCouponId: number;
19
+ }
20
+ /**
21
+ * no description
22
+ */
23
+ export declare class ManageFreeCarriageCouponApi extends BaseAPI {
24
+ /**
25
+ * This endpoint allow you to create one or multiple coupons in one API call
26
+ * Create free carriage coupons
27
+ */
28
+ createFreeCarriageCouponsRaw(requestParameters: CreateFreeCarriageCouponsRequest): Promise<ApiResponse<Array<FreeCarriageCoupon> | BlobWithMeta>>;
29
+ /**
30
+ * This endpoint allow you to create one or multiple coupons in one API call
31
+ * Create free carriage coupons
32
+ */
33
+ createFreeCarriageCoupons(requestParameters: CreateFreeCarriageCouponsRequest): Promise<Array<FreeCarriageCoupon> | BlobWithMeta>;
34
+ /**
35
+ * Remove a coupon from the system
36
+ */
37
+ deleteFreeCarriageCouponRaw(requestParameters: DeleteFreeCarriageCouponRequest): Promise<ApiResponse<void>>;
38
+ /**
39
+ * Remove a coupon from the system
40
+ */
41
+ deleteFreeCarriageCoupon(requestParameters: DeleteFreeCarriageCouponRequest): Promise<void>;
42
+ }
@@ -0,0 +1,233 @@
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.ManageFreeCarriageCouponApi = void 0;
68
+ var runtime_1 = require("../runtime");
69
+ var models_1 = require("../models");
70
+ /**
71
+ * no description
72
+ */
73
+ var ManageFreeCarriageCouponApi = /** @class */ (function (_super) {
74
+ __extends(ManageFreeCarriageCouponApi, _super);
75
+ function ManageFreeCarriageCouponApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * This endpoint allow you to create one or multiple coupons in one API call
80
+ * Create free carriage coupons
81
+ */
82
+ ManageFreeCarriageCouponApi.prototype.createFreeCarriageCouponsRaw = function (requestParameters) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, token, tokenString, _a, response, contentType, response_1;
85
+ return __generator(this, function (_b) {
86
+ switch (_b.label) {
87
+ case 0:
88
+ if (requestParameters.freeCarriageCouponCreationParameters === null || requestParameters.freeCarriageCouponCreationParameters === undefined) {
89
+ throw new runtime_1.RequiredError('freeCarriageCouponCreationParameters', 'Required parameter requestParameters.freeCarriageCouponCreationParameters was null or undefined when calling createFreeCarriageCoupons.');
90
+ }
91
+ queryParameters = {};
92
+ headerParameters = {};
93
+ headerParameters['Content-Type'] = 'application/json';
94
+ if (this.configuration && this.configuration.apiKey) {
95
+ headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
96
+ }
97
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
98
+ token = this.configuration.accessToken;
99
+ if (!(typeof token === 'function')) return [3 /*break*/, 2];
100
+ return [4 /*yield*/, token("bearerAuth", [])];
101
+ case 1:
102
+ _a = _b.sent();
103
+ return [3 /*break*/, 3];
104
+ case 2:
105
+ _a = token;
106
+ _b.label = 3;
107
+ case 3:
108
+ tokenString = _a;
109
+ if (tokenString) {
110
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
111
+ }
112
+ _b.label = 4;
113
+ case 4:
114
+ _b.trys.push([4, 6, , 7]);
115
+ return [4 /*yield*/, this.request({
116
+ path: "/free-carriage-coupons",
117
+ method: 'POST',
118
+ headers: headerParameters,
119
+ query: queryParameters,
120
+ body: requestParameters.freeCarriageCouponCreationParameters.map(models_1.FreeCarriageCouponCreationParametersToJSON),
121
+ })];
122
+ case 5:
123
+ response = _b.sent();
124
+ contentType = response.headers.get("content-type");
125
+ if (contentType && contentType.indexOf("application/json") !== -1) {
126
+ return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(models_1.FreeCarriageCouponFromJSON); })];
127
+ }
128
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
129
+ return [2 /*return*/, new runtime_1.TextApiResponse(response)];
130
+ }
131
+ else {
132
+ // TODO : Better handling of others application types
133
+ return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
134
+ }
135
+ return [3 /*break*/, 7];
136
+ case 6:
137
+ response_1 = _b.sent();
138
+ console.debug(response_1);
139
+ throw response_1;
140
+ case 7: return [2 /*return*/];
141
+ }
142
+ });
143
+ });
144
+ };
145
+ /**
146
+ * This endpoint allow you to create one or multiple coupons in one API call
147
+ * Create free carriage coupons
148
+ */
149
+ ManageFreeCarriageCouponApi.prototype.createFreeCarriageCoupons = function (requestParameters) {
150
+ return __awaiter(this, void 0, void 0, function () {
151
+ var response;
152
+ return __generator(this, function (_a) {
153
+ switch (_a.label) {
154
+ case 0: return [4 /*yield*/, this.createFreeCarriageCouponsRaw(requestParameters)];
155
+ case 1:
156
+ response = _a.sent();
157
+ return [4 /*yield*/, response.value()];
158
+ case 2: return [2 /*return*/, _a.sent()];
159
+ }
160
+ });
161
+ });
162
+ };
163
+ /**
164
+ * Remove a coupon from the system
165
+ */
166
+ ManageFreeCarriageCouponApi.prototype.deleteFreeCarriageCouponRaw = function (requestParameters) {
167
+ return __awaiter(this, void 0, void 0, function () {
168
+ var queryParameters, headerParameters, token, tokenString, _a, response, response_2;
169
+ return __generator(this, function (_b) {
170
+ switch (_b.label) {
171
+ case 0:
172
+ if (requestParameters.freeCarriageCouponId === null || requestParameters.freeCarriageCouponId === undefined) {
173
+ throw new runtime_1.RequiredError('freeCarriageCouponId', 'Required parameter requestParameters.freeCarriageCouponId was null or undefined when calling deleteFreeCarriageCoupon.');
174
+ }
175
+ queryParameters = {};
176
+ headerParameters = {};
177
+ if (this.configuration && this.configuration.apiKey) {
178
+ headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
179
+ }
180
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
181
+ token = this.configuration.accessToken;
182
+ if (!(typeof token === 'function')) return [3 /*break*/, 2];
183
+ return [4 /*yield*/, token("bearerAuth", [])];
184
+ case 1:
185
+ _a = _b.sent();
186
+ return [3 /*break*/, 3];
187
+ case 2:
188
+ _a = token;
189
+ _b.label = 3;
190
+ case 3:
191
+ tokenString = _a;
192
+ if (tokenString) {
193
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
194
+ }
195
+ _b.label = 4;
196
+ case 4:
197
+ _b.trys.push([4, 6, , 7]);
198
+ return [4 /*yield*/, this.request({
199
+ path: "/free-carriage-coupons/{freeCarriageCouponId}".replace("{".concat("freeCarriageCouponId", "}"), encodeURIComponent(String(requestParameters.freeCarriageCouponId))),
200
+ method: 'DELETE',
201
+ headers: headerParameters,
202
+ query: queryParameters,
203
+ })];
204
+ case 5:
205
+ response = _b.sent();
206
+ return [2 /*return*/, new runtime_1.VoidApiResponse(response)];
207
+ case 6:
208
+ response_2 = _b.sent();
209
+ console.debug(response_2);
210
+ throw response_2;
211
+ case 7: return [2 /*return*/];
212
+ }
213
+ });
214
+ });
215
+ };
216
+ /**
217
+ * Remove a coupon from the system
218
+ */
219
+ ManageFreeCarriageCouponApi.prototype.deleteFreeCarriageCoupon = function (requestParameters) {
220
+ return __awaiter(this, void 0, void 0, function () {
221
+ return __generator(this, function (_a) {
222
+ switch (_a.label) {
223
+ case 0: return [4 /*yield*/, this.deleteFreeCarriageCouponRaw(requestParameters)];
224
+ case 1:
225
+ _a.sent();
226
+ return [2 /*return*/];
227
+ }
228
+ });
229
+ });
230
+ };
231
+ return ManageFreeCarriageCouponApi;
232
+ }(runtime_1.BaseAPI));
233
+ exports.ManageFreeCarriageCouponApi = ManageFreeCarriageCouponApi;
@@ -0,0 +1,49 @@
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 { BaseAPI, ApiResponse, BlobWithMeta } from '../runtime';
13
+ import { PaginatedFreeCarriageCoupons } from '../models';
14
+ export interface GetFreeCarriageCouponsRequest {
15
+ ownerEq?: Array<number>;
16
+ validFromGte?: Date;
17
+ validFromLte?: Date;
18
+ validToGte?: Date;
19
+ validToLte?: Date;
20
+ usedAtPr?: boolean;
21
+ tagsCo?: Array<string>;
22
+ tagsNco?: Array<string>;
23
+ orderBy?: GetFreeCarriageCouponsOrderByEnum;
24
+ p?: number;
25
+ pp?: number;
26
+ }
27
+ /**
28
+ * no description
29
+ */
30
+ export declare class SearchFreeCarriageCouponApi extends BaseAPI {
31
+ /**
32
+ * This endpoint allow you to retrieve the free carriage coupons of the system
33
+ * Get free carriage coupons
34
+ */
35
+ getFreeCarriageCouponsRaw(requestParameters: GetFreeCarriageCouponsRequest): Promise<ApiResponse<PaginatedFreeCarriageCoupons | BlobWithMeta>>;
36
+ /**
37
+ * This endpoint allow you to retrieve the free carriage coupons of the system
38
+ * Get free carriage coupons
39
+ */
40
+ getFreeCarriageCoupons(requestParameters: GetFreeCarriageCouponsRequest): Promise<PaginatedFreeCarriageCoupons | BlobWithMeta>;
41
+ }
42
+ /**
43
+ * @export
44
+ * @enum {string}
45
+ */
46
+ export declare enum GetFreeCarriageCouponsOrderByEnum {
47
+ ASC = "CREATED_AT:ASC",
48
+ DESC = "CREATED_AT:DESC"
49
+ }