@lcdp/api-react-rest-client 2.4.0-develop.5544924884 → 2.4.0-develop.5544937458
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/index.d.ts +1 -0
- package/catalog/index.js +17 -0
- package/catalog/src/apis/ManageProductInsightApi.d.ts +54 -0
- package/catalog/src/apis/ManageProductInsightApi.js +295 -0
- package/catalog/src/apis/SearchProductInsightApi.d.ts +53 -0
- package/catalog/src/apis/SearchProductInsightApi.js +246 -0
- package/catalog/src/apis/index.d.ts +2 -0
- package/catalog/src/apis/index.js +18 -0
- package/catalog/src/index.d.ts +3 -0
- package/catalog/src/index.js +19 -0
- package/catalog/src/models/Barcodes.d.ts +45 -0
- package/catalog/src/models/Barcodes.js +48 -0
- package/catalog/src/models/HttpLink.d.ts +27 -0
- package/catalog/src/models/HttpLink.js +41 -0
- package/catalog/src/models/LaboratoryLink.d.ts +34 -0
- package/catalog/src/models/LaboratoryLink.js +50 -0
- package/catalog/src/models/LaboratoryLinkAllOf.d.ts +33 -0
- package/catalog/src/models/LaboratoryLinkAllOf.js +44 -0
- package/catalog/src/models/PaginatedObject.d.ts +28 -0
- package/catalog/src/models/PaginatedObject.js +42 -0
- package/catalog/src/models/PaginatedProductInsights.d.ts +29 -0
- package/catalog/src/models/PaginatedProductInsights.js +50 -0
- package/catalog/src/models/PaginatedProductInsightsAllOf.d.ts +28 -0
- package/catalog/src/models/PaginatedProductInsightsAllOf.js +42 -0
- package/catalog/src/models/PagingMetadata.d.ts +45 -0
- package/catalog/src/models/PagingMetadata.js +47 -0
- package/catalog/src/models/ProductInsight.d.ts +106 -0
- package/catalog/src/models/ProductInsight.js +73 -0
- package/catalog/src/models/ProductInsightCreateOrUpdateParameters.d.ts +89 -0
- package/catalog/src/models/ProductInsightCreateOrUpdateParameters.js +64 -0
- package/catalog/src/models/ProductInsightJournal.d.ts +33 -0
- package/catalog/src/models/ProductInsightJournal.js +44 -0
- package/catalog/src/models/ProductSecondaryTypeLink.d.ts +34 -0
- package/catalog/src/models/ProductSecondaryTypeLink.js +50 -0
- package/catalog/src/models/ProductSecondaryTypeLinkAllOf.d.ts +33 -0
- package/catalog/src/models/ProductSecondaryTypeLinkAllOf.js +44 -0
- package/catalog/src/models/ProductStorageType.d.ts +25 -0
- package/catalog/src/models/ProductStorageType.js +40 -0
- package/catalog/src/models/ProductTypeLink.d.ts +34 -0
- package/catalog/src/models/ProductTypeLink.js +50 -0
- package/catalog/src/models/ProductTypeLinkAllOf.d.ts +33 -0
- package/catalog/src/models/ProductTypeLinkAllOf.js +44 -0
- package/catalog/src/models/RestError.d.ts +85 -0
- package/catalog/src/models/RestError.js +97 -0
- package/catalog/src/models/VatLink.d.ts +40 -0
- package/catalog/src/models/VatLink.js +50 -0
- package/catalog/src/models/VatLinkAllOf.d.ts +39 -0
- package/catalog/src/models/VatLinkAllOf.js +46 -0
- package/catalog/src/models/index.d.ts +19 -0
- package/catalog/src/models/index.js +35 -0
- package/catalog/src/runtime.d.ts +149 -0
- package/catalog/src/runtime.js +480 -0
- package/package.json +1 -1
- package/product/src/apis/ManageProductApi.d.ts +2 -0
- package/product/src/apis/ManageProductApi.js +6 -0
- package/product/src/apis/SearchProductMetadataApi.d.ts +22 -0
- package/product/src/apis/SearchProductMetadataApi.js +154 -8
- package/product/src/models/{ProductProvider.d.ts → DataProvider.d.ts} +7 -5
- package/product/src/models/DataProvider.js +40 -0
- package/product/src/models/Image.d.ts +7 -0
- package/product/src/models/Image.js +3 -0
- package/product/src/models/Product.d.ts +44 -37
- package/product/src/models/Product.js +33 -31
- package/product/src/models/ProductCreationOrUpdateParameters.d.ts +6 -6
- package/product/src/models/ProductCreationOrUpdateParameters.js +2 -2
- package/product/src/models/ProductJournal.d.ts +27 -0
- package/product/src/models/ProductJournal.js +41 -0
- package/product/src/models/ProductProscription.d.ts +7 -0
- package/product/src/models/ProductProscription.js +3 -0
- package/product/src/models/ProductSource.d.ts +47 -0
- package/product/src/models/ProductSource.js +49 -0
- package/product/src/models/ProductSourceBcb.d.ts +39 -0
- package/product/src/models/ProductSourceBcb.js +46 -0
- package/product/src/models/ProductSourceFields.d.ts +131 -0
- package/product/src/models/ProductSourceFields.js +77 -0
- package/product/src/models/ProductSourceFieldsBarcodes.d.ts +46 -0
- package/product/src/models/ProductSourceFieldsBarcodes.js +48 -0
- package/product/src/models/index.d.ts +6 -1
- package/product/src/models/index.js +6 -1
- package/product/src/models/ProductProvider.js +0 -38
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/catalog/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
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);
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,295 @@
|
|
|
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;
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
orderBy?: GetProductInsightsOrderByEnum;
|
|
20
|
+
p?: number;
|
|
21
|
+
pp?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* no description
|
|
25
|
+
*/
|
|
26
|
+
export declare class SearchProductInsightApi extends BaseAPI {
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve a product insight with ID
|
|
29
|
+
*/
|
|
30
|
+
getProductInsightRaw(requestParameters: GetProductInsightRequest): Promise<ApiResponse<ProductInsight | BlobWithMeta>>;
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve a product insight with ID
|
|
33
|
+
*/
|
|
34
|
+
getProductInsight(requestParameters: GetProductInsightRequest): Promise<ProductInsight | BlobWithMeta>;
|
|
35
|
+
/**
|
|
36
|
+
* Search for product insights
|
|
37
|
+
*/
|
|
38
|
+
getProductInsightsRaw(requestParameters: GetProductInsightsRequest): Promise<ApiResponse<PaginatedProductInsights | BlobWithMeta>>;
|
|
39
|
+
/**
|
|
40
|
+
* Search for product insights
|
|
41
|
+
*/
|
|
42
|
+
getProductInsights(requestParameters: GetProductInsightsRequest): Promise<PaginatedProductInsights | BlobWithMeta>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @export
|
|
46
|
+
* @enum {string}
|
|
47
|
+
*/
|
|
48
|
+
export declare enum GetProductInsightsOrderByEnum {
|
|
49
|
+
PRODUCTNAMEASC = "PRODUCT_NAME:ASC",
|
|
50
|
+
PRODUCTNAMEDESC = "PRODUCT_NAME:DESC",
|
|
51
|
+
BARCODESPRINCIPALASC = "BARCODES_PRINCIPAL:ASC",
|
|
52
|
+
BARCODESPRINCIPALDESC = "BARCODES_PRINCIPAL:DESC"
|
|
53
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
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.GetProductInsightsOrderByEnum = exports.SearchProductInsightApi = void 0;
|
|
68
|
+
var runtime_1 = require("../runtime");
|
|
69
|
+
var models_1 = require("../models");
|
|
70
|
+
/**
|
|
71
|
+
* no description
|
|
72
|
+
*/
|
|
73
|
+
var SearchProductInsightApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(SearchProductInsightApi, _super);
|
|
75
|
+
function SearchProductInsightApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Retrieve a product insight with ID
|
|
80
|
+
*/
|
|
81
|
+
SearchProductInsightApi.prototype.getProductInsightRaw = function (requestParameters) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var queryParameters, headerParameters, token, tokenString, response, contentType, response_1;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
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.');
|
|
89
|
+
}
|
|
90
|
+
queryParameters = {};
|
|
91
|
+
headerParameters = {};
|
|
92
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
93
|
+
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
|
|
94
|
+
}
|
|
95
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
96
|
+
token = this.configuration.accessToken;
|
|
97
|
+
tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
|
|
98
|
+
if (tokenString) {
|
|
99
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
_a.label = 1;
|
|
103
|
+
case 1:
|
|
104
|
+
_a.trys.push([1, 3, , 4]);
|
|
105
|
+
return [4 /*yield*/, this.request({
|
|
106
|
+
path: "/product-insights/{productInsightId}".replace("{".concat("productInsightId", "}"), encodeURIComponent(String(requestParameters.productInsightId))),
|
|
107
|
+
method: 'GET',
|
|
108
|
+
headers: headerParameters,
|
|
109
|
+
query: queryParameters,
|
|
110
|
+
})];
|
|
111
|
+
case 2:
|
|
112
|
+
response = _a.sent();
|
|
113
|
+
contentType = response.headers.get("content-type");
|
|
114
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
115
|
+
return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ProductInsightFromJSON)(jsonValue); })];
|
|
116
|
+
}
|
|
117
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
118
|
+
return [2 /*return*/, new runtime_1.TextApiResponse(response)];
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
// TODO : Better handling of others application types
|
|
122
|
+
return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
|
|
123
|
+
}
|
|
124
|
+
return [3 /*break*/, 4];
|
|
125
|
+
case 3:
|
|
126
|
+
response_1 = _a.sent();
|
|
127
|
+
console.debug(response_1);
|
|
128
|
+
throw response_1;
|
|
129
|
+
case 4: return [2 /*return*/];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Retrieve a product insight with ID
|
|
136
|
+
*/
|
|
137
|
+
SearchProductInsightApi.prototype.getProductInsight = function (requestParameters) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
+
var response;
|
|
140
|
+
return __generator(this, function (_a) {
|
|
141
|
+
switch (_a.label) {
|
|
142
|
+
case 0: return [4 /*yield*/, this.getProductInsightRaw(requestParameters)];
|
|
143
|
+
case 1:
|
|
144
|
+
response = _a.sent();
|
|
145
|
+
return [4 /*yield*/, response.value()];
|
|
146
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
};
|
|
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.orderBy !== undefined) {
|
|
165
|
+
queryParameters['orderBy'] = requestParameters.orderBy;
|
|
166
|
+
}
|
|
167
|
+
if (requestParameters.p !== undefined) {
|
|
168
|
+
queryParameters['p'] = requestParameters.p;
|
|
169
|
+
}
|
|
170
|
+
if (requestParameters.pp !== undefined) {
|
|
171
|
+
queryParameters['pp'] = requestParameters.pp;
|
|
172
|
+
}
|
|
173
|
+
headerParameters = {};
|
|
174
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
175
|
+
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
|
|
176
|
+
}
|
|
177
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
178
|
+
token = this.configuration.accessToken;
|
|
179
|
+
tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
|
|
180
|
+
if (tokenString) {
|
|
181
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
_a.label = 1;
|
|
185
|
+
case 1:
|
|
186
|
+
_a.trys.push([1, 3, , 4]);
|
|
187
|
+
return [4 /*yield*/, this.request({
|
|
188
|
+
path: "/product-insights",
|
|
189
|
+
method: 'GET',
|
|
190
|
+
headers: headerParameters,
|
|
191
|
+
query: queryParameters,
|
|
192
|
+
})];
|
|
193
|
+
case 2:
|
|
194
|
+
response = _a.sent();
|
|
195
|
+
contentType = response.headers.get("content-type");
|
|
196
|
+
if (contentType && contentType.indexOf("application/json") !== -1) {
|
|
197
|
+
return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.PaginatedProductInsightsFromJSON)(jsonValue); })];
|
|
198
|
+
}
|
|
199
|
+
else if (contentType && contentType.indexOf("text/plain") !== -1) {
|
|
200
|
+
return [2 /*return*/, new runtime_1.TextApiResponse(response)];
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
// TODO : Better handling of others application types
|
|
204
|
+
return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
|
|
205
|
+
}
|
|
206
|
+
return [3 /*break*/, 4];
|
|
207
|
+
case 3:
|
|
208
|
+
response_2 = _a.sent();
|
|
209
|
+
console.debug(response_2);
|
|
210
|
+
throw response_2;
|
|
211
|
+
case 4: return [2 /*return*/];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Search for product insights
|
|
218
|
+
*/
|
|
219
|
+
SearchProductInsightApi.prototype.getProductInsights = function (requestParameters) {
|
|
220
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
221
|
+
var response;
|
|
222
|
+
return __generator(this, function (_a) {
|
|
223
|
+
switch (_a.label) {
|
|
224
|
+
case 0: return [4 /*yield*/, this.getProductInsightsRaw(requestParameters)];
|
|
225
|
+
case 1:
|
|
226
|
+
response = _a.sent();
|
|
227
|
+
return [4 /*yield*/, response.value()];
|
|
228
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
return SearchProductInsightApi;
|
|
234
|
+
}(runtime_1.BaseAPI));
|
|
235
|
+
exports.SearchProductInsightApi = SearchProductInsightApi;
|
|
236
|
+
/**
|
|
237
|
+
* @export
|
|
238
|
+
* @enum {string}
|
|
239
|
+
*/
|
|
240
|
+
var GetProductInsightsOrderByEnum;
|
|
241
|
+
(function (GetProductInsightsOrderByEnum) {
|
|
242
|
+
GetProductInsightsOrderByEnum["PRODUCTNAMEASC"] = "PRODUCT_NAME:ASC";
|
|
243
|
+
GetProductInsightsOrderByEnum["PRODUCTNAMEDESC"] = "PRODUCT_NAME:DESC";
|
|
244
|
+
GetProductInsightsOrderByEnum["BARCODESPRINCIPALASC"] = "BARCODES_PRINCIPAL:ASC";
|
|
245
|
+
GetProductInsightsOrderByEnum["BARCODESPRINCIPALDESC"] = "BARCODES_PRINCIPAL:DESC";
|
|
246
|
+
})(GetProductInsightsOrderByEnum = exports.GetProductInsightsOrderByEnum || (exports.GetProductInsightsOrderByEnum = {}));
|