@lcdp/api-react-rest-client 2.5.2-develop.5999091874 → 2.5.3-DATA-430-migrer-sur-dbt-cloud.6238224716

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 (97) hide show
  1. package/package.json +1 -1
  2. package/product/src/apis/ManageProductApi.d.ts +0 -2
  3. package/product/src/apis/ManageProductApi.js +0 -6
  4. package/product/src/apis/SearchProductApi.d.ts +0 -1
  5. package/product/src/apis/SearchProductApi.js +0 -3
  6. package/product/src/apis/SearchProductMetadataApi.d.ts +0 -22
  7. package/product/src/apis/SearchProductMetadataApi.js +8 -154
  8. package/product/src/models/Image.d.ts +0 -7
  9. package/product/src/models/Image.js +0 -3
  10. package/product/src/models/Product.d.ts +37 -44
  11. package/product/src/models/Product.js +31 -33
  12. package/product/src/models/ProductCreationOrUpdateParameters.d.ts +6 -6
  13. package/product/src/models/ProductCreationOrUpdateParameters.js +2 -2
  14. package/product/src/models/ProductProscription.d.ts +0 -7
  15. package/product/src/models/ProductProscription.js +0 -3
  16. package/product/src/models/{DataProvider.d.ts → ProductProvider.d.ts} +5 -7
  17. package/product/src/models/ProductProvider.js +38 -0
  18. package/product/src/models/index.d.ts +1 -6
  19. package/product/src/models/index.js +1 -6
  20. package/recommendation/src/apis/SearchProductPriceRecommendationApi.d.ts +2 -2
  21. package/recommendation/src/apis/SearchProductPriceRecommendationApi.js +2 -2
  22. package/recommendation/src/models/ProductPriceRecommendation.d.ts +1 -1
  23. package/recommendation/src/models/ProductPriceRecommendation.js +2 -2
  24. package/sale-offer/src/apis/ManageSaleOfferApi.d.ts +1 -26
  25. package/sale-offer/src/apis/ManageSaleOfferApi.js +0 -146
  26. package/sale-offer/src/apis/ManageSaleOfferStatusApi.d.ts +32 -0
  27. package/{catalog/src/apis/SearchProductInsightApi.js → sale-offer/src/apis/ManageSaleOfferStatusApi.js} +25 -114
  28. package/sale-offer/src/apis/index.d.ts +1 -0
  29. package/sale-offer/src/apis/index.js +1 -0
  30. package/sale-offer/src/models/index.d.ts +0 -2
  31. package/sale-offer/src/models/index.js +0 -2
  32. package/catalog/index.d.ts +0 -1
  33. package/catalog/index.js +0 -17
  34. package/catalog/src/apis/ManageProductInsightApi.d.ts +0 -54
  35. package/catalog/src/apis/ManageProductInsightApi.js +0 -295
  36. package/catalog/src/apis/SearchProductInsightApi.d.ts +0 -54
  37. package/catalog/src/apis/index.d.ts +0 -2
  38. package/catalog/src/apis/index.js +0 -18
  39. package/catalog/src/index.d.ts +0 -3
  40. package/catalog/src/index.js +0 -19
  41. package/catalog/src/models/Barcodes.d.ts +0 -45
  42. package/catalog/src/models/Barcodes.js +0 -48
  43. package/catalog/src/models/HttpLink.d.ts +0 -27
  44. package/catalog/src/models/HttpLink.js +0 -41
  45. package/catalog/src/models/LaboratoryLink.d.ts +0 -34
  46. package/catalog/src/models/LaboratoryLink.js +0 -50
  47. package/catalog/src/models/LaboratoryLinkAllOf.d.ts +0 -33
  48. package/catalog/src/models/LaboratoryLinkAllOf.js +0 -44
  49. package/catalog/src/models/PaginatedObject.d.ts +0 -28
  50. package/catalog/src/models/PaginatedObject.js +0 -42
  51. package/catalog/src/models/PaginatedProductInsights.d.ts +0 -29
  52. package/catalog/src/models/PaginatedProductInsights.js +0 -50
  53. package/catalog/src/models/PaginatedProductInsightsAllOf.d.ts +0 -28
  54. package/catalog/src/models/PaginatedProductInsightsAllOf.js +0 -42
  55. package/catalog/src/models/PagingMetadata.d.ts +0 -45
  56. package/catalog/src/models/PagingMetadata.js +0 -47
  57. package/catalog/src/models/ProductInsight.d.ts +0 -106
  58. package/catalog/src/models/ProductInsight.js +0 -73
  59. package/catalog/src/models/ProductInsightCreateOrUpdateParameters.d.ts +0 -89
  60. package/catalog/src/models/ProductInsightCreateOrUpdateParameters.js +0 -64
  61. package/catalog/src/models/ProductInsightJournal.d.ts +0 -33
  62. package/catalog/src/models/ProductInsightJournal.js +0 -44
  63. package/catalog/src/models/ProductSecondaryTypeLink.d.ts +0 -34
  64. package/catalog/src/models/ProductSecondaryTypeLink.js +0 -50
  65. package/catalog/src/models/ProductSecondaryTypeLinkAllOf.d.ts +0 -33
  66. package/catalog/src/models/ProductSecondaryTypeLinkAllOf.js +0 -44
  67. package/catalog/src/models/ProductStorageType.d.ts +0 -25
  68. package/catalog/src/models/ProductStorageType.js +0 -40
  69. package/catalog/src/models/ProductTypeLink.d.ts +0 -34
  70. package/catalog/src/models/ProductTypeLink.js +0 -50
  71. package/catalog/src/models/ProductTypeLinkAllOf.d.ts +0 -33
  72. package/catalog/src/models/ProductTypeLinkAllOf.js +0 -44
  73. package/catalog/src/models/RestError.d.ts +0 -85
  74. package/catalog/src/models/RestError.js +0 -97
  75. package/catalog/src/models/VatLink.d.ts +0 -40
  76. package/catalog/src/models/VatLink.js +0 -50
  77. package/catalog/src/models/VatLinkAllOf.d.ts +0 -39
  78. package/catalog/src/models/VatLinkAllOf.js +0 -46
  79. package/catalog/src/models/index.d.ts +0 -19
  80. package/catalog/src/models/index.js +0 -35
  81. package/catalog/src/runtime.d.ts +0 -149
  82. package/catalog/src/runtime.js +0 -480
  83. package/product/src/models/DataProvider.js +0 -40
  84. package/product/src/models/ProductJournal.d.ts +0 -27
  85. package/product/src/models/ProductJournal.js +0 -41
  86. package/product/src/models/ProductSource.d.ts +0 -47
  87. package/product/src/models/ProductSource.js +0 -49
  88. package/product/src/models/ProductSourceBcb.d.ts +0 -39
  89. package/product/src/models/ProductSourceBcb.js +0 -46
  90. package/product/src/models/ProductSourceFields.d.ts +0 -131
  91. package/product/src/models/ProductSourceFields.js +0 -77
  92. package/product/src/models/ProductSourceFieldsBarcodes.d.ts +0 -46
  93. package/product/src/models/ProductSourceFieldsBarcodes.js +0 -48
  94. package/sale-offer/src/models/SaleOfferUpdateParameters.d.ts +0 -35
  95. package/sale-offer/src/models/SaleOfferUpdateParameters.js +0 -46
  96. package/sale-offer/src/models/SaleOfferUpdateParametersStock.d.ts +0 -27
  97. package/sale-offer/src/models/SaleOfferUpdateParametersStock.js +0 -42
@@ -2,8 +2,8 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  /**
5
- * lcdp-catalog
6
- * This is the REST API of LCDP catalog
5
+ * lcdp-monolith-service
6
+ * This is the REST API of LCDP products
7
7
  *
8
8
  * The version of the OpenAPI document: 1.0.0
9
9
  * Contact: contact@lecomptoirdespharmacies.fr
@@ -64,31 +64,36 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
64
64
  }
65
65
  };
66
66
  Object.defineProperty(exports, "__esModule", { value: true });
67
- exports.GetProductInsightsOrderByEnum = exports.SearchProductInsightApi = void 0;
67
+ exports.ManageSaleOfferStatusApi = void 0;
68
68
  var runtime_1 = require("../runtime");
69
69
  var models_1 = require("../models");
70
70
  /**
71
71
  * no description
72
72
  */
73
- var SearchProductInsightApi = /** @class */ (function (_super) {
74
- __extends(SearchProductInsightApi, _super);
75
- function SearchProductInsightApi() {
73
+ var ManageSaleOfferStatusApi = /** @class */ (function (_super) {
74
+ __extends(ManageSaleOfferStatusApi, _super);
75
+ function ManageSaleOfferStatusApi() {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
78
  /**
79
- * Retrieve a product insight with ID
79
+ * Set the status for sale offer, with following preconditions according destination : # ARCHIVED : - You are the owner or you are ADMINISTRATOR - Sale offer in status (WAITING_FOR_PRODUCT, ENABLED, HOLIDAY, ASKING_FOR_INVOICE) # OTHERS : - You are ADMINISTRATOR
80
+ * Update a sale offer status
80
81
  */
81
- SearchProductInsightApi.prototype.getProductInsightRaw = function (requestParameters) {
82
+ ManageSaleOfferStatusApi.prototype.updateSaleOfferStatusRaw = function (requestParameters) {
82
83
  return __awaiter(this, void 0, void 0, function () {
83
84
  var queryParameters, headerParameters, token, tokenString, response, contentType, response_1;
84
85
  return __generator(this, function (_a) {
85
86
  switch (_a.label) {
86
87
  case 0:
87
- if (requestParameters.productInsightId === null || requestParameters.productInsightId === undefined) {
88
- throw new runtime_1.RequiredError('productInsightId', 'Required parameter requestParameters.productInsightId was null or undefined when calling getProductInsight.');
88
+ if (requestParameters.saleOfferReference === null || requestParameters.saleOfferReference === undefined) {
89
+ throw new runtime_1.RequiredError('saleOfferReference', 'Required parameter requestParameters.saleOfferReference was null or undefined when calling updateSaleOfferStatus.');
90
+ }
91
+ if (requestParameters.body === null || requestParameters.body === undefined) {
92
+ throw new runtime_1.RequiredError('body', 'Required parameter requestParameters.body was null or undefined when calling updateSaleOfferStatus.');
89
93
  }
90
94
  queryParameters = {};
91
95
  headerParameters = {};
96
+ headerParameters['Content-Type'] = 'application/json';
92
97
  if (this.configuration && this.configuration.apiKey) {
93
98
  headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
94
99
  }
@@ -103,16 +108,17 @@ var SearchProductInsightApi = /** @class */ (function (_super) {
103
108
  case 1:
104
109
  _a.trys.push([1, 3, , 4]);
105
110
  return [4 /*yield*/, this.request({
106
- path: "/product-insights/{productInsightId}".replace("{".concat("productInsightId", "}"), encodeURIComponent(String(requestParameters.productInsightId))),
107
- method: 'GET',
111
+ path: "/sale-offers/{saleOfferReference}/status".replace("{".concat("saleOfferReference", "}"), encodeURIComponent(String(requestParameters.saleOfferReference))),
112
+ method: 'PUT',
108
113
  headers: headerParameters,
109
114
  query: queryParameters,
115
+ body: requestParameters.body,
110
116
  })];
111
117
  case 2:
112
118
  response = _a.sent();
113
119
  contentType = response.headers.get("content-type");
114
120
  if (contentType && contentType.indexOf("application/json") !== -1) {
115
- return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ProductInsightFromJSON)(jsonValue); })];
121
+ return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.SaleOfferStatusFromJSON)(jsonValue); })];
116
122
  }
117
123
  else if (contentType && contentType.indexOf("text/plain") !== -1) {
118
124
  return [2 /*return*/, new runtime_1.TextApiResponse(response)];
@@ -132,14 +138,15 @@ var SearchProductInsightApi = /** @class */ (function (_super) {
132
138
  });
133
139
  };
134
140
  /**
135
- * Retrieve a product insight with ID
141
+ * Set the status for sale offer, with following preconditions according destination : # ARCHIVED : - You are the owner or you are ADMINISTRATOR - Sale offer in status (WAITING_FOR_PRODUCT, ENABLED, HOLIDAY, ASKING_FOR_INVOICE) # OTHERS : - You are ADMINISTRATOR
142
+ * Update a sale offer status
136
143
  */
137
- SearchProductInsightApi.prototype.getProductInsight = function (requestParameters) {
144
+ ManageSaleOfferStatusApi.prototype.updateSaleOfferStatus = function (requestParameters) {
138
145
  return __awaiter(this, void 0, void 0, function () {
139
146
  var response;
140
147
  return __generator(this, function (_a) {
141
148
  switch (_a.label) {
142
- case 0: return [4 /*yield*/, this.getProductInsightRaw(requestParameters)];
149
+ case 0: return [4 /*yield*/, this.updateSaleOfferStatusRaw(requestParameters)];
143
150
  case 1:
144
151
  response = _a.sent();
145
152
  return [4 /*yield*/, response.value()];
@@ -148,102 +155,6 @@ var SearchProductInsightApi = /** @class */ (function (_super) {
148
155
  });
149
156
  });
150
157
  };
151
- /**
152
- * Search for product insights
153
- */
154
- SearchProductInsightApi.prototype.getProductInsightsRaw = function (requestParameters) {
155
- return __awaiter(this, void 0, void 0, function () {
156
- var queryParameters, headerParameters, token, tokenString, response, contentType, response_2;
157
- return __generator(this, function (_a) {
158
- switch (_a.label) {
159
- case 0:
160
- queryParameters = {};
161
- if (requestParameters.signaturesAnyeq) {
162
- queryParameters['signatures[anyeq]'] = requestParameters.signaturesAnyeq;
163
- }
164
- if (requestParameters.jUpdatedAtGte !== undefined) {
165
- queryParameters['jUpdatedAt[gte]'] = requestParameters.jUpdatedAtGte.toISOString();
166
- }
167
- if (requestParameters.orderBy !== undefined) {
168
- queryParameters['orderBy'] = requestParameters.orderBy;
169
- }
170
- if (requestParameters.p !== undefined) {
171
- queryParameters['p'] = requestParameters.p;
172
- }
173
- if (requestParameters.pp !== undefined) {
174
- queryParameters['pp'] = requestParameters.pp;
175
- }
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) {
181
- token = this.configuration.accessToken;
182
- tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
183
- if (tokenString) {
184
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
185
- }
186
- }
187
- _a.label = 1;
188
- case 1:
189
- _a.trys.push([1, 3, , 4]);
190
- return [4 /*yield*/, this.request({
191
- path: "/product-insights",
192
- method: 'GET',
193
- headers: headerParameters,
194
- query: queryParameters,
195
- })];
196
- case 2:
197
- response = _a.sent();
198
- contentType = response.headers.get("content-type");
199
- if (contentType && contentType.indexOf("application/json") !== -1) {
200
- return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.PaginatedProductInsightsFromJSON)(jsonValue); })];
201
- }
202
- else if (contentType && contentType.indexOf("text/plain") !== -1) {
203
- return [2 /*return*/, new runtime_1.TextApiResponse(response)];
204
- }
205
- else {
206
- // TODO : Better handling of others application types
207
- return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
208
- }
209
- return [3 /*break*/, 4];
210
- case 3:
211
- response_2 = _a.sent();
212
- console.debug(response_2);
213
- throw response_2;
214
- case 4: return [2 /*return*/];
215
- }
216
- });
217
- });
218
- };
219
- /**
220
- * Search for product insights
221
- */
222
- SearchProductInsightApi.prototype.getProductInsights = function (requestParameters) {
223
- return __awaiter(this, void 0, void 0, function () {
224
- var response;
225
- return __generator(this, function (_a) {
226
- switch (_a.label) {
227
- case 0: return [4 /*yield*/, this.getProductInsightsRaw(requestParameters)];
228
- case 1:
229
- response = _a.sent();
230
- return [4 /*yield*/, response.value()];
231
- case 2: return [2 /*return*/, _a.sent()];
232
- }
233
- });
234
- });
235
- };
236
- return SearchProductInsightApi;
158
+ return ManageSaleOfferStatusApi;
237
159
  }(runtime_1.BaseAPI));
238
- exports.SearchProductInsightApi = SearchProductInsightApi;
239
- /**
240
- * @export
241
- * @enum {string}
242
- */
243
- var GetProductInsightsOrderByEnum;
244
- (function (GetProductInsightsOrderByEnum) {
245
- GetProductInsightsOrderByEnum["PRODUCTNAMEASC"] = "PRODUCT_NAME:ASC";
246
- GetProductInsightsOrderByEnum["PRODUCTNAMEDESC"] = "PRODUCT_NAME:DESC";
247
- GetProductInsightsOrderByEnum["BARCODESPRINCIPALASC"] = "BARCODES_PRINCIPAL:ASC";
248
- GetProductInsightsOrderByEnum["BARCODESPRINCIPALDESC"] = "BARCODES_PRINCIPAL:DESC";
249
- })(GetProductInsightsOrderByEnum = exports.GetProductInsightsOrderByEnum || (exports.GetProductInsightsOrderByEnum = {}));
160
+ exports.ManageSaleOfferStatusApi = ManageSaleOfferStatusApi;
@@ -1,2 +1,3 @@
1
1
  export * from './ManageSaleOfferApi';
2
+ export * from './ManageSaleOfferStatusApi';
2
3
  export * from './SearchSaleOfferApi';
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ManageSaleOfferApi"), exports);
18
+ __exportStar(require("./ManageSaleOfferStatusApi"), exports);
18
19
  __exportStar(require("./SearchSaleOfferApi"), exports);
@@ -34,8 +34,6 @@ export * from './SaleOfferNewVersionParameters';
34
34
  export * from './SaleOfferStatisticLink';
35
35
  export * from './SaleOfferStatisticLinkAllOf';
36
36
  export * from './SaleOfferStatus';
37
- export * from './SaleOfferUpdateParameters';
38
- export * from './SaleOfferUpdateParametersStock';
39
37
  export * from './Stock';
40
38
  export * from './UnitaryDistributionMode';
41
39
  export * from './UnitaryDistributionModeAllOf';
@@ -50,8 +50,6 @@ __exportStar(require("./SaleOfferNewVersionParameters"), exports);
50
50
  __exportStar(require("./SaleOfferStatisticLink"), exports);
51
51
  __exportStar(require("./SaleOfferStatisticLinkAllOf"), exports);
52
52
  __exportStar(require("./SaleOfferStatus"), exports);
53
- __exportStar(require("./SaleOfferUpdateParameters"), exports);
54
- __exportStar(require("./SaleOfferUpdateParametersStock"), exports);
55
53
  __exportStar(require("./Stock"), exports);
56
54
  __exportStar(require("./UnitaryDistributionMode"), exports);
57
55
  __exportStar(require("./UnitaryDistributionModeAllOf"), exports);
@@ -1 +0,0 @@
1
- export * from './src';
package/catalog/index.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src"), exports);
@@ -1,54 +0,0 @@
1
- /**
2
- * lcdp-catalog
3
- * This is the REST API of LCDP catalog
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 { ProductInsight, ProductInsightCreateOrUpdateParameters } from '../models';
14
- export interface CreateProductInsightRequest {
15
- productInsightCreateOrUpdateParameters: ProductInsightCreateOrUpdateParameters;
16
- }
17
- export interface DeleteProductInsightRequest {
18
- productInsightId: number;
19
- }
20
- export interface UpdateProductInsightRequest {
21
- productInsightId: number;
22
- productInsightCreateOrUpdateParameters: ProductInsightCreateOrUpdateParameters;
23
- }
24
- /**
25
- * no description
26
- */
27
- export declare class ManageProductInsightApi extends BaseAPI {
28
- /**
29
- * Create a new product insight.
30
- * Create a new product insight
31
- */
32
- createProductInsightRaw(requestParameters: CreateProductInsightRequest): Promise<ApiResponse<ProductInsight | BlobWithMeta>>;
33
- /**
34
- * Create a new product insight.
35
- * Create a new product insight
36
- */
37
- createProductInsight(requestParameters: CreateProductInsightRequest): Promise<ProductInsight | BlobWithMeta>;
38
- /**
39
- * Delete product insight
40
- */
41
- deleteProductInsightRaw(requestParameters: DeleteProductInsightRequest): Promise<ApiResponse<void>>;
42
- /**
43
- * Delete product insight
44
- */
45
- deleteProductInsight(requestParameters: DeleteProductInsightRequest): Promise<void>;
46
- /**
47
- * Update product insight
48
- */
49
- updateProductInsightRaw(requestParameters: UpdateProductInsightRequest): Promise<ApiResponse<ProductInsight | BlobWithMeta>>;
50
- /**
51
- * Update product insight
52
- */
53
- updateProductInsight(requestParameters: UpdateProductInsightRequest): Promise<ProductInsight | BlobWithMeta>;
54
- }
@@ -1,295 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * lcdp-catalog
6
- * This is the REST API of LCDP catalog
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.ManageProductInsightApi = void 0;
68
- var runtime_1 = require("../runtime");
69
- var models_1 = require("../models");
70
- /**
71
- * no description
72
- */
73
- var ManageProductInsightApi = /** @class */ (function (_super) {
74
- __extends(ManageProductInsightApi, _super);
75
- function ManageProductInsightApi() {
76
- return _super !== null && _super.apply(this, arguments) || this;
77
- }
78
- /**
79
- * Create a new product insight.
80
- * Create a new product insight
81
- */
82
- ManageProductInsightApi.prototype.createProductInsightRaw = function (requestParameters) {
83
- return __awaiter(this, void 0, void 0, function () {
84
- var queryParameters, headerParameters, token, tokenString, response, contentType, response_1;
85
- return __generator(this, function (_a) {
86
- switch (_a.label) {
87
- case 0:
88
- if (requestParameters.productInsightCreateOrUpdateParameters === null || requestParameters.productInsightCreateOrUpdateParameters === undefined) {
89
- throw new runtime_1.RequiredError('productInsightCreateOrUpdateParameters', 'Required parameter requestParameters.productInsightCreateOrUpdateParameters was null or undefined when calling createProductInsight.');
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) {
98
- token = this.configuration.accessToken;
99
- tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
100
- if (tokenString) {
101
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
102
- }
103
- }
104
- _a.label = 1;
105
- case 1:
106
- _a.trys.push([1, 3, , 4]);
107
- return [4 /*yield*/, this.request({
108
- path: "/product-insights",
109
- method: 'POST',
110
- headers: headerParameters,
111
- query: queryParameters,
112
- body: (0, models_1.ProductInsightCreateOrUpdateParametersToJSON)(requestParameters.productInsightCreateOrUpdateParameters),
113
- })];
114
- case 2:
115
- response = _a.sent();
116
- contentType = response.headers.get("content-type");
117
- if (contentType && contentType.indexOf("application/json") !== -1) {
118
- return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ProductInsightFromJSON)(jsonValue); })];
119
- }
120
- else if (contentType && contentType.indexOf("text/plain") !== -1) {
121
- return [2 /*return*/, new runtime_1.TextApiResponse(response)];
122
- }
123
- else {
124
- // TODO : Better handling of others application types
125
- return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
126
- }
127
- return [3 /*break*/, 4];
128
- case 3:
129
- response_1 = _a.sent();
130
- console.debug(response_1);
131
- throw response_1;
132
- case 4: return [2 /*return*/];
133
- }
134
- });
135
- });
136
- };
137
- /**
138
- * Create a new product insight.
139
- * Create a new product insight
140
- */
141
- ManageProductInsightApi.prototype.createProductInsight = function (requestParameters) {
142
- return __awaiter(this, void 0, void 0, function () {
143
- var response;
144
- return __generator(this, function (_a) {
145
- switch (_a.label) {
146
- case 0: return [4 /*yield*/, this.createProductInsightRaw(requestParameters)];
147
- case 1:
148
- response = _a.sent();
149
- return [4 /*yield*/, response.value()];
150
- case 2: return [2 /*return*/, _a.sent()];
151
- }
152
- });
153
- });
154
- };
155
- /**
156
- * Delete product insight
157
- */
158
- ManageProductInsightApi.prototype.deleteProductInsightRaw = function (requestParameters) {
159
- return __awaiter(this, void 0, void 0, function () {
160
- var queryParameters, headerParameters, token, tokenString, response, response_2;
161
- return __generator(this, function (_a) {
162
- switch (_a.label) {
163
- case 0:
164
- if (requestParameters.productInsightId === null || requestParameters.productInsightId === undefined) {
165
- throw new runtime_1.RequiredError('productInsightId', 'Required parameter requestParameters.productInsightId was null or undefined when calling deleteProductInsight.');
166
- }
167
- queryParameters = {};
168
- headerParameters = {};
169
- if (this.configuration && this.configuration.apiKey) {
170
- headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
171
- }
172
- if (this.configuration && this.configuration.accessToken) {
173
- token = this.configuration.accessToken;
174
- tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
175
- if (tokenString) {
176
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
177
- }
178
- }
179
- _a.label = 1;
180
- case 1:
181
- _a.trys.push([1, 3, , 4]);
182
- return [4 /*yield*/, this.request({
183
- path: "/product-insights/{productInsightId}".replace("{".concat("productInsightId", "}"), encodeURIComponent(String(requestParameters.productInsightId))),
184
- method: 'DELETE',
185
- headers: headerParameters,
186
- query: queryParameters,
187
- })];
188
- case 2:
189
- response = _a.sent();
190
- return [2 /*return*/, new runtime_1.VoidApiResponse(response)];
191
- case 3:
192
- response_2 = _a.sent();
193
- console.debug(response_2);
194
- throw response_2;
195
- case 4: return [2 /*return*/];
196
- }
197
- });
198
- });
199
- };
200
- /**
201
- * Delete product insight
202
- */
203
- ManageProductInsightApi.prototype.deleteProductInsight = function (requestParameters) {
204
- return __awaiter(this, void 0, void 0, function () {
205
- return __generator(this, function (_a) {
206
- switch (_a.label) {
207
- case 0: return [4 /*yield*/, this.deleteProductInsightRaw(requestParameters)];
208
- case 1:
209
- _a.sent();
210
- return [2 /*return*/];
211
- }
212
- });
213
- });
214
- };
215
- /**
216
- * Update product insight
217
- */
218
- ManageProductInsightApi.prototype.updateProductInsightRaw = function (requestParameters) {
219
- return __awaiter(this, void 0, void 0, function () {
220
- var queryParameters, headerParameters, token, tokenString, response, contentType, response_3;
221
- return __generator(this, function (_a) {
222
- switch (_a.label) {
223
- case 0:
224
- if (requestParameters.productInsightId === null || requestParameters.productInsightId === undefined) {
225
- throw new runtime_1.RequiredError('productInsightId', 'Required parameter requestParameters.productInsightId was null or undefined when calling updateProductInsight.');
226
- }
227
- if (requestParameters.productInsightCreateOrUpdateParameters === null || requestParameters.productInsightCreateOrUpdateParameters === undefined) {
228
- throw new runtime_1.RequiredError('productInsightCreateOrUpdateParameters', 'Required parameter requestParameters.productInsightCreateOrUpdateParameters was null or undefined when calling updateProductInsight.');
229
- }
230
- queryParameters = {};
231
- headerParameters = {};
232
- headerParameters['Content-Type'] = 'application/json';
233
- if (this.configuration && this.configuration.apiKey) {
234
- headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
235
- }
236
- if (this.configuration && this.configuration.accessToken) {
237
- token = this.configuration.accessToken;
238
- tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
239
- if (tokenString) {
240
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
241
- }
242
- }
243
- _a.label = 1;
244
- case 1:
245
- _a.trys.push([1, 3, , 4]);
246
- return [4 /*yield*/, this.request({
247
- path: "/product-insights/{productInsightId}".replace("{".concat("productInsightId", "}"), encodeURIComponent(String(requestParameters.productInsightId))),
248
- method: 'PATCH',
249
- headers: headerParameters,
250
- query: queryParameters,
251
- body: (0, models_1.ProductInsightCreateOrUpdateParametersToJSON)(requestParameters.productInsightCreateOrUpdateParameters),
252
- })];
253
- case 2:
254
- response = _a.sent();
255
- contentType = response.headers.get("content-type");
256
- if (contentType && contentType.indexOf("application/json") !== -1) {
257
- return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ProductInsightFromJSON)(jsonValue); })];
258
- }
259
- else if (contentType && contentType.indexOf("text/plain") !== -1) {
260
- return [2 /*return*/, new runtime_1.TextApiResponse(response)];
261
- }
262
- else {
263
- // TODO : Better handling of others application types
264
- return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
265
- }
266
- return [3 /*break*/, 4];
267
- case 3:
268
- response_3 = _a.sent();
269
- console.debug(response_3);
270
- throw response_3;
271
- case 4: return [2 /*return*/];
272
- }
273
- });
274
- });
275
- };
276
- /**
277
- * Update product insight
278
- */
279
- ManageProductInsightApi.prototype.updateProductInsight = function (requestParameters) {
280
- return __awaiter(this, void 0, void 0, function () {
281
- var response;
282
- return __generator(this, function (_a) {
283
- switch (_a.label) {
284
- case 0: return [4 /*yield*/, this.updateProductInsightRaw(requestParameters)];
285
- case 1:
286
- response = _a.sent();
287
- return [4 /*yield*/, response.value()];
288
- case 2: return [2 /*return*/, _a.sent()];
289
- }
290
- });
291
- });
292
- };
293
- return ManageProductInsightApi;
294
- }(runtime_1.BaseAPI));
295
- exports.ManageProductInsightApi = ManageProductInsightApi;
@@ -1,54 +0,0 @@
1
- /**
2
- * lcdp-catalog
3
- * This is the REST API of LCDP catalog
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 { PaginatedProductInsights, ProductInsight } from '../models';
14
- export interface GetProductInsightRequest {
15
- productInsightId: number;
16
- }
17
- export interface GetProductInsightsRequest {
18
- signaturesAnyeq?: Array<string>;
19
- jUpdatedAtGte?: Date;
20
- orderBy?: GetProductInsightsOrderByEnum;
21
- p?: number;
22
- pp?: number;
23
- }
24
- /**
25
- * no description
26
- */
27
- export declare class SearchProductInsightApi extends BaseAPI {
28
- /**
29
- * Retrieve a product insight with ID
30
- */
31
- getProductInsightRaw(requestParameters: GetProductInsightRequest): Promise<ApiResponse<ProductInsight | BlobWithMeta>>;
32
- /**
33
- * Retrieve a product insight with ID
34
- */
35
- getProductInsight(requestParameters: GetProductInsightRequest): Promise<ProductInsight | BlobWithMeta>;
36
- /**
37
- * Search for product insights
38
- */
39
- getProductInsightsRaw(requestParameters: GetProductInsightsRequest): Promise<ApiResponse<PaginatedProductInsights | BlobWithMeta>>;
40
- /**
41
- * Search for product insights
42
- */
43
- getProductInsights(requestParameters: GetProductInsightsRequest): Promise<PaginatedProductInsights | BlobWithMeta>;
44
- }
45
- /**
46
- * @export
47
- * @enum {string}
48
- */
49
- export declare enum GetProductInsightsOrderByEnum {
50
- PRODUCTNAMEASC = "PRODUCT_NAME:ASC",
51
- PRODUCTNAMEDESC = "PRODUCT_NAME:DESC",
52
- BARCODESPRINCIPALASC = "BARCODES_PRINCIPAL:ASC",
53
- BARCODESPRINCIPALDESC = "BARCODES_PRINCIPAL:DESC"
54
- }