@jprogrami/mobbcadona 1.0.2

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 (46) hide show
  1. package/.openapi-generator/FILES +18 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator/openapi.yaml-generate-sdk-typescript.sha256 +1 -0
  4. package/.openapi-generator-ignore +23 -0
  5. package/README.md +46 -0
  6. package/dist/apis/AuthenticationApi.d.ts +40 -0
  7. package/dist/apis/AuthenticationApi.js +168 -0
  8. package/dist/apis/InventoriesApi.d.ts +52 -0
  9. package/dist/apis/InventoriesApi.js +239 -0
  10. package/dist/apis/ProductsApi.d.ts +110 -0
  11. package/dist/apis/ProductsApi.js +515 -0
  12. package/dist/apis/index.d.ts +3 -0
  13. package/dist/apis/index.js +21 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.js +21 -0
  16. package/dist/models/Inventory.d.ts +37 -0
  17. package/dist/models/Inventory.js +47 -0
  18. package/dist/models/LoginRequest.d.ts +37 -0
  19. package/dist/models/LoginRequest.js +47 -0
  20. package/dist/models/ProblemDetail.d.ts +55 -0
  21. package/dist/models/ProblemDetail.js +53 -0
  22. package/dist/models/Product.d.ts +49 -0
  23. package/dist/models/Product.js +55 -0
  24. package/dist/models/ProductDto.d.ts +43 -0
  25. package/dist/models/ProductDto.js +49 -0
  26. package/dist/models/RegisterRequest.d.ts +43 -0
  27. package/dist/models/RegisterRequest.js +49 -0
  28. package/dist/models/index.d.ts +6 -0
  29. package/dist/models/index.js +24 -0
  30. package/dist/runtime.d.ts +181 -0
  31. package/dist/runtime.js +557 -0
  32. package/package.json +19 -0
  33. package/src/apis/AuthenticationApi.ts +114 -0
  34. package/src/apis/InventoriesApi.ts +170 -0
  35. package/src/apis/ProductsApi.ts +431 -0
  36. package/src/apis/index.ts +5 -0
  37. package/src/index.ts +5 -0
  38. package/src/models/Inventory.ts +68 -0
  39. package/src/models/LoginRequest.ts +68 -0
  40. package/src/models/ProblemDetail.ts +92 -0
  41. package/src/models/Product.ts +86 -0
  42. package/src/models/ProductDto.ts +76 -0
  43. package/src/models/RegisterRequest.ts +76 -0
  44. package/src/models/index.ts +8 -0
  45. package/src/runtime.ts +426 -0
  46. package/tsconfig.json +20 -0
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Inventory Management API
3
+ * RESTful API for inventory and product management, secured with JWT.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { Product, ProductDto } from '../models/index';
14
+ export interface ApiProductosInvInventoryIdPaginatedGetRequest {
15
+ inventoryId: number;
16
+ page?: number;
17
+ size?: number;
18
+ }
19
+ export interface ApiProductosInvInventoryIdPostRequest {
20
+ inventoryId: number;
21
+ product: Product;
22
+ }
23
+ export interface ApiProductosInvInventoryIdProductIdDeleteRequest {
24
+ inventoryId: number;
25
+ productId: number;
26
+ }
27
+ export interface ApiProductosInvInventoryIdProductIdPutRequest {
28
+ inventoryId: number;
29
+ productId: number;
30
+ product: Product;
31
+ }
32
+ export interface ApiProductosPaginatedGetRequest {
33
+ page?: number;
34
+ size?: number;
35
+ }
36
+ export interface ApiProductosPostRequest {
37
+ product: Product;
38
+ }
39
+ export interface ApiProductosProductIdGetRequest {
40
+ productId: number;
41
+ }
42
+ /**
43
+ *
44
+ */
45
+ export declare class ProductsApi extends runtime.BaseAPI {
46
+ /**
47
+ * List all products
48
+ */
49
+ apiProductosGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProductDto>>>;
50
+ /**
51
+ * List all products
52
+ */
53
+ apiProductosGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProductDto>>;
54
+ /**
55
+ * List products from inventory (Paginated)
56
+ */
57
+ apiProductosInvInventoryIdPaginatedGetRaw(requestParameters: ApiProductosInvInventoryIdPaginatedGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
58
+ /**
59
+ * List products from inventory (Paginated)
60
+ */
61
+ apiProductosInvInventoryIdPaginatedGet(requestParameters: ApiProductosInvInventoryIdPaginatedGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
62
+ /**
63
+ * Add product to specific inventory
64
+ */
65
+ apiProductosInvInventoryIdPostRaw(requestParameters: ApiProductosInvInventoryIdPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
66
+ /**
67
+ * Add product to specific inventory
68
+ */
69
+ apiProductosInvInventoryIdPost(requestParameters: ApiProductosInvInventoryIdPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
70
+ /**
71
+ * Delete product from inventory
72
+ */
73
+ apiProductosInvInventoryIdProductIdDeleteRaw(requestParameters: ApiProductosInvInventoryIdProductIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
74
+ /**
75
+ * Delete product from inventory
76
+ */
77
+ apiProductosInvInventoryIdProductIdDelete(requestParameters: ApiProductosInvInventoryIdProductIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
78
+ /**
79
+ * Update product in inventory
80
+ */
81
+ apiProductosInvInventoryIdProductIdPutRaw(requestParameters: ApiProductosInvInventoryIdProductIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
82
+ /**
83
+ * Update product in inventory
84
+ */
85
+ apiProductosInvInventoryIdProductIdPut(requestParameters: ApiProductosInvInventoryIdProductIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
86
+ /**
87
+ * List all products (Paginated)
88
+ */
89
+ apiProductosPaginatedGetRaw(requestParameters: ApiProductosPaginatedGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
90
+ /**
91
+ * List all products (Paginated)
92
+ */
93
+ apiProductosPaginatedGet(requestParameters?: ApiProductosPaginatedGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
94
+ /**
95
+ * Add standalone product
96
+ */
97
+ apiProductosPostRaw(requestParameters: ApiProductosPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
98
+ /**
99
+ * Add standalone product
100
+ */
101
+ apiProductosPost(requestParameters: ApiProductosPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
102
+ /**
103
+ * Get product by ID
104
+ */
105
+ apiProductosProductIdGetRaw(requestParameters: ApiProductosProductIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
106
+ /**
107
+ * Get product by ID
108
+ */
109
+ apiProductosProductIdGet(requestParameters: ApiProductosProductIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
110
+ }
@@ -0,0 +1,515 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Inventory Management API
6
+ * RESTful API for inventory and product management, secured with JWT.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
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 (g && (g = 0, op[0] && (_ = 0)), _) 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.ProductsApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var ProductsApi = /** @class */ (function (_super) {
74
+ __extends(ProductsApi, _super);
75
+ function ProductsApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * List all products
80
+ */
81
+ ProductsApi.prototype.apiProductosGetRaw = function (initOverrides) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var queryParameters, headerParameters, token, tokenString, response;
84
+ return __generator(this, function (_a) {
85
+ switch (_a.label) {
86
+ case 0:
87
+ queryParameters = {};
88
+ headerParameters = {};
89
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
90
+ token = this.configuration.accessToken;
91
+ return [4 /*yield*/, token("bearerAuth", [])];
92
+ case 1:
93
+ tokenString = _a.sent();
94
+ if (tokenString) {
95
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
96
+ }
97
+ _a.label = 2;
98
+ case 2: return [4 /*yield*/, this.request({
99
+ path: "/api/productos",
100
+ method: 'GET',
101
+ headers: headerParameters,
102
+ query: queryParameters,
103
+ }, initOverrides)];
104
+ case 3:
105
+ response = _a.sent();
106
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.ProductDtoFromJSON); })];
107
+ }
108
+ });
109
+ });
110
+ };
111
+ /**
112
+ * List all products
113
+ */
114
+ ProductsApi.prototype.apiProductosGet = function (initOverrides) {
115
+ return __awaiter(this, void 0, void 0, function () {
116
+ var response;
117
+ return __generator(this, function (_a) {
118
+ switch (_a.label) {
119
+ case 0: return [4 /*yield*/, this.apiProductosGetRaw(initOverrides)];
120
+ case 1:
121
+ response = _a.sent();
122
+ return [4 /*yield*/, response.value()];
123
+ case 2: return [2 /*return*/, _a.sent()];
124
+ }
125
+ });
126
+ });
127
+ };
128
+ /**
129
+ * List products from inventory (Paginated)
130
+ */
131
+ ProductsApi.prototype.apiProductosInvInventoryIdPaginatedGetRaw = function (requestParameters, initOverrides) {
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ var queryParameters, headerParameters, token, tokenString, response;
134
+ return __generator(this, function (_a) {
135
+ switch (_a.label) {
136
+ case 0:
137
+ if (requestParameters['inventoryId'] == null) {
138
+ throw new runtime.RequiredError('inventoryId', 'Required parameter "inventoryId" was null or undefined when calling apiProductosInvInventoryIdPaginatedGet().');
139
+ }
140
+ queryParameters = {};
141
+ if (requestParameters['page'] != null) {
142
+ queryParameters['page'] = requestParameters['page'];
143
+ }
144
+ if (requestParameters['size'] != null) {
145
+ queryParameters['size'] = requestParameters['size'];
146
+ }
147
+ headerParameters = {};
148
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
149
+ token = this.configuration.accessToken;
150
+ return [4 /*yield*/, token("bearerAuth", [])];
151
+ case 1:
152
+ tokenString = _a.sent();
153
+ if (tokenString) {
154
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
155
+ }
156
+ _a.label = 2;
157
+ case 2: return [4 /*yield*/, this.request({
158
+ path: "/api/productos/inv/{inventory_id}/paginated".replace("{".concat("inventory_id", "}"), encodeURIComponent(String(requestParameters['inventoryId']))),
159
+ method: 'GET',
160
+ headers: headerParameters,
161
+ query: queryParameters,
162
+ }, initOverrides)];
163
+ case 3:
164
+ response = _a.sent();
165
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
166
+ }
167
+ });
168
+ });
169
+ };
170
+ /**
171
+ * List products from inventory (Paginated)
172
+ */
173
+ ProductsApi.prototype.apiProductosInvInventoryIdPaginatedGet = function (requestParameters, initOverrides) {
174
+ return __awaiter(this, void 0, void 0, function () {
175
+ return __generator(this, function (_a) {
176
+ switch (_a.label) {
177
+ case 0: return [4 /*yield*/, this.apiProductosInvInventoryIdPaginatedGetRaw(requestParameters, initOverrides)];
178
+ case 1:
179
+ _a.sent();
180
+ return [2 /*return*/];
181
+ }
182
+ });
183
+ });
184
+ };
185
+ /**
186
+ * Add product to specific inventory
187
+ */
188
+ ProductsApi.prototype.apiProductosInvInventoryIdPostRaw = function (requestParameters, initOverrides) {
189
+ return __awaiter(this, void 0, void 0, function () {
190
+ var queryParameters, headerParameters, token, tokenString, response;
191
+ return __generator(this, function (_a) {
192
+ switch (_a.label) {
193
+ case 0:
194
+ if (requestParameters['inventoryId'] == null) {
195
+ throw new runtime.RequiredError('inventoryId', 'Required parameter "inventoryId" was null or undefined when calling apiProductosInvInventoryIdPost().');
196
+ }
197
+ if (requestParameters['product'] == null) {
198
+ throw new runtime.RequiredError('product', 'Required parameter "product" was null or undefined when calling apiProductosInvInventoryIdPost().');
199
+ }
200
+ queryParameters = {};
201
+ headerParameters = {};
202
+ headerParameters['Content-Type'] = 'application/json';
203
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
204
+ token = this.configuration.accessToken;
205
+ return [4 /*yield*/, token("bearerAuth", [])];
206
+ case 1:
207
+ tokenString = _a.sent();
208
+ if (tokenString) {
209
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
210
+ }
211
+ _a.label = 2;
212
+ case 2: return [4 /*yield*/, this.request({
213
+ path: "/api/productos/inv/{inventory_id}".replace("{".concat("inventory_id", "}"), encodeURIComponent(String(requestParameters['inventoryId']))),
214
+ method: 'POST',
215
+ headers: headerParameters,
216
+ query: queryParameters,
217
+ body: (0, index_1.ProductToJSON)(requestParameters['product']),
218
+ }, initOverrides)];
219
+ case 3:
220
+ response = _a.sent();
221
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
222
+ }
223
+ });
224
+ });
225
+ };
226
+ /**
227
+ * Add product to specific inventory
228
+ */
229
+ ProductsApi.prototype.apiProductosInvInventoryIdPost = function (requestParameters, initOverrides) {
230
+ return __awaiter(this, void 0, void 0, function () {
231
+ return __generator(this, function (_a) {
232
+ switch (_a.label) {
233
+ case 0: return [4 /*yield*/, this.apiProductosInvInventoryIdPostRaw(requestParameters, initOverrides)];
234
+ case 1:
235
+ _a.sent();
236
+ return [2 /*return*/];
237
+ }
238
+ });
239
+ });
240
+ };
241
+ /**
242
+ * Delete product from inventory
243
+ */
244
+ ProductsApi.prototype.apiProductosInvInventoryIdProductIdDeleteRaw = function (requestParameters, initOverrides) {
245
+ return __awaiter(this, void 0, void 0, function () {
246
+ var queryParameters, headerParameters, token, tokenString, response;
247
+ return __generator(this, function (_a) {
248
+ switch (_a.label) {
249
+ case 0:
250
+ if (requestParameters['inventoryId'] == null) {
251
+ throw new runtime.RequiredError('inventoryId', 'Required parameter "inventoryId" was null or undefined when calling apiProductosInvInventoryIdProductIdDelete().');
252
+ }
253
+ if (requestParameters['productId'] == null) {
254
+ throw new runtime.RequiredError('productId', 'Required parameter "productId" was null or undefined when calling apiProductosInvInventoryIdProductIdDelete().');
255
+ }
256
+ queryParameters = {};
257
+ headerParameters = {};
258
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
259
+ token = this.configuration.accessToken;
260
+ return [4 /*yield*/, token("bearerAuth", [])];
261
+ case 1:
262
+ tokenString = _a.sent();
263
+ if (tokenString) {
264
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
265
+ }
266
+ _a.label = 2;
267
+ case 2: return [4 /*yield*/, this.request({
268
+ path: "/api/productos/inv/{inventory_id}/{product_id}".replace("{".concat("inventory_id", "}"), encodeURIComponent(String(requestParameters['inventoryId']))).replace("{".concat("product_id", "}"), encodeURIComponent(String(requestParameters['productId']))),
269
+ method: 'DELETE',
270
+ headers: headerParameters,
271
+ query: queryParameters,
272
+ }, initOverrides)];
273
+ case 3:
274
+ response = _a.sent();
275
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
276
+ }
277
+ });
278
+ });
279
+ };
280
+ /**
281
+ * Delete product from inventory
282
+ */
283
+ ProductsApi.prototype.apiProductosInvInventoryIdProductIdDelete = function (requestParameters, initOverrides) {
284
+ return __awaiter(this, void 0, void 0, function () {
285
+ return __generator(this, function (_a) {
286
+ switch (_a.label) {
287
+ case 0: return [4 /*yield*/, this.apiProductosInvInventoryIdProductIdDeleteRaw(requestParameters, initOverrides)];
288
+ case 1:
289
+ _a.sent();
290
+ return [2 /*return*/];
291
+ }
292
+ });
293
+ });
294
+ };
295
+ /**
296
+ * Update product in inventory
297
+ */
298
+ ProductsApi.prototype.apiProductosInvInventoryIdProductIdPutRaw = function (requestParameters, initOverrides) {
299
+ return __awaiter(this, void 0, void 0, function () {
300
+ var queryParameters, headerParameters, token, tokenString, response;
301
+ return __generator(this, function (_a) {
302
+ switch (_a.label) {
303
+ case 0:
304
+ if (requestParameters['inventoryId'] == null) {
305
+ throw new runtime.RequiredError('inventoryId', 'Required parameter "inventoryId" was null or undefined when calling apiProductosInvInventoryIdProductIdPut().');
306
+ }
307
+ if (requestParameters['productId'] == null) {
308
+ throw new runtime.RequiredError('productId', 'Required parameter "productId" was null or undefined when calling apiProductosInvInventoryIdProductIdPut().');
309
+ }
310
+ if (requestParameters['product'] == null) {
311
+ throw new runtime.RequiredError('product', 'Required parameter "product" was null or undefined when calling apiProductosInvInventoryIdProductIdPut().');
312
+ }
313
+ queryParameters = {};
314
+ headerParameters = {};
315
+ headerParameters['Content-Type'] = 'application/json';
316
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
317
+ token = this.configuration.accessToken;
318
+ return [4 /*yield*/, token("bearerAuth", [])];
319
+ case 1:
320
+ tokenString = _a.sent();
321
+ if (tokenString) {
322
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
323
+ }
324
+ _a.label = 2;
325
+ case 2: return [4 /*yield*/, this.request({
326
+ path: "/api/productos/inv/{inventory_id}/{product_id}".replace("{".concat("inventory_id", "}"), encodeURIComponent(String(requestParameters['inventoryId']))).replace("{".concat("product_id", "}"), encodeURIComponent(String(requestParameters['productId']))),
327
+ method: 'PUT',
328
+ headers: headerParameters,
329
+ query: queryParameters,
330
+ body: (0, index_1.ProductToJSON)(requestParameters['product']),
331
+ }, initOverrides)];
332
+ case 3:
333
+ response = _a.sent();
334
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
335
+ }
336
+ });
337
+ });
338
+ };
339
+ /**
340
+ * Update product in inventory
341
+ */
342
+ ProductsApi.prototype.apiProductosInvInventoryIdProductIdPut = function (requestParameters, initOverrides) {
343
+ return __awaiter(this, void 0, void 0, function () {
344
+ return __generator(this, function (_a) {
345
+ switch (_a.label) {
346
+ case 0: return [4 /*yield*/, this.apiProductosInvInventoryIdProductIdPutRaw(requestParameters, initOverrides)];
347
+ case 1:
348
+ _a.sent();
349
+ return [2 /*return*/];
350
+ }
351
+ });
352
+ });
353
+ };
354
+ /**
355
+ * List all products (Paginated)
356
+ */
357
+ ProductsApi.prototype.apiProductosPaginatedGetRaw = function (requestParameters, initOverrides) {
358
+ return __awaiter(this, void 0, void 0, function () {
359
+ var queryParameters, headerParameters, token, tokenString, response;
360
+ return __generator(this, function (_a) {
361
+ switch (_a.label) {
362
+ case 0:
363
+ queryParameters = {};
364
+ if (requestParameters['page'] != null) {
365
+ queryParameters['page'] = requestParameters['page'];
366
+ }
367
+ if (requestParameters['size'] != null) {
368
+ queryParameters['size'] = requestParameters['size'];
369
+ }
370
+ headerParameters = {};
371
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
372
+ token = this.configuration.accessToken;
373
+ return [4 /*yield*/, token("bearerAuth", [])];
374
+ case 1:
375
+ tokenString = _a.sent();
376
+ if (tokenString) {
377
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
378
+ }
379
+ _a.label = 2;
380
+ case 2: return [4 /*yield*/, this.request({
381
+ path: "/api/productos/paginated",
382
+ method: 'GET',
383
+ headers: headerParameters,
384
+ query: queryParameters,
385
+ }, initOverrides)];
386
+ case 3:
387
+ response = _a.sent();
388
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
389
+ }
390
+ });
391
+ });
392
+ };
393
+ /**
394
+ * List all products (Paginated)
395
+ */
396
+ ProductsApi.prototype.apiProductosPaginatedGet = function (requestParameters, initOverrides) {
397
+ if (requestParameters === void 0) { requestParameters = {}; }
398
+ return __awaiter(this, void 0, void 0, function () {
399
+ return __generator(this, function (_a) {
400
+ switch (_a.label) {
401
+ case 0: return [4 /*yield*/, this.apiProductosPaginatedGetRaw(requestParameters, initOverrides)];
402
+ case 1:
403
+ _a.sent();
404
+ return [2 /*return*/];
405
+ }
406
+ });
407
+ });
408
+ };
409
+ /**
410
+ * Add standalone product
411
+ */
412
+ ProductsApi.prototype.apiProductosPostRaw = function (requestParameters, initOverrides) {
413
+ return __awaiter(this, void 0, void 0, function () {
414
+ var queryParameters, headerParameters, token, tokenString, response;
415
+ return __generator(this, function (_a) {
416
+ switch (_a.label) {
417
+ case 0:
418
+ if (requestParameters['product'] == null) {
419
+ throw new runtime.RequiredError('product', 'Required parameter "product" was null or undefined when calling apiProductosPost().');
420
+ }
421
+ queryParameters = {};
422
+ headerParameters = {};
423
+ headerParameters['Content-Type'] = 'application/json';
424
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
425
+ token = this.configuration.accessToken;
426
+ return [4 /*yield*/, token("bearerAuth", [])];
427
+ case 1:
428
+ tokenString = _a.sent();
429
+ if (tokenString) {
430
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
431
+ }
432
+ _a.label = 2;
433
+ case 2: return [4 /*yield*/, this.request({
434
+ path: "/api/productos",
435
+ method: 'POST',
436
+ headers: headerParameters,
437
+ query: queryParameters,
438
+ body: (0, index_1.ProductToJSON)(requestParameters['product']),
439
+ }, initOverrides)];
440
+ case 3:
441
+ response = _a.sent();
442
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
443
+ }
444
+ });
445
+ });
446
+ };
447
+ /**
448
+ * Add standalone product
449
+ */
450
+ ProductsApi.prototype.apiProductosPost = function (requestParameters, initOverrides) {
451
+ return __awaiter(this, void 0, void 0, function () {
452
+ return __generator(this, function (_a) {
453
+ switch (_a.label) {
454
+ case 0: return [4 /*yield*/, this.apiProductosPostRaw(requestParameters, initOverrides)];
455
+ case 1:
456
+ _a.sent();
457
+ return [2 /*return*/];
458
+ }
459
+ });
460
+ });
461
+ };
462
+ /**
463
+ * Get product by ID
464
+ */
465
+ ProductsApi.prototype.apiProductosProductIdGetRaw = function (requestParameters, initOverrides) {
466
+ return __awaiter(this, void 0, void 0, function () {
467
+ var queryParameters, headerParameters, token, tokenString, response;
468
+ return __generator(this, function (_a) {
469
+ switch (_a.label) {
470
+ case 0:
471
+ if (requestParameters['productId'] == null) {
472
+ throw new runtime.RequiredError('productId', 'Required parameter "productId" was null or undefined when calling apiProductosProductIdGet().');
473
+ }
474
+ queryParameters = {};
475
+ headerParameters = {};
476
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
477
+ token = this.configuration.accessToken;
478
+ return [4 /*yield*/, token("bearerAuth", [])];
479
+ case 1:
480
+ tokenString = _a.sent();
481
+ if (tokenString) {
482
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
483
+ }
484
+ _a.label = 2;
485
+ case 2: return [4 /*yield*/, this.request({
486
+ path: "/api/productos/{product_id}".replace("{".concat("product_id", "}"), encodeURIComponent(String(requestParameters['productId']))),
487
+ method: 'GET',
488
+ headers: headerParameters,
489
+ query: queryParameters,
490
+ }, initOverrides)];
491
+ case 3:
492
+ response = _a.sent();
493
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
494
+ }
495
+ });
496
+ });
497
+ };
498
+ /**
499
+ * Get product by ID
500
+ */
501
+ ProductsApi.prototype.apiProductosProductIdGet = function (requestParameters, initOverrides) {
502
+ return __awaiter(this, void 0, void 0, function () {
503
+ return __generator(this, function (_a) {
504
+ switch (_a.label) {
505
+ case 0: return [4 /*yield*/, this.apiProductosProductIdGetRaw(requestParameters, initOverrides)];
506
+ case 1:
507
+ _a.sent();
508
+ return [2 /*return*/];
509
+ }
510
+ });
511
+ });
512
+ };
513
+ return ProductsApi;
514
+ }(runtime.BaseAPI));
515
+ exports.ProductsApi = ProductsApi;
@@ -0,0 +1,3 @@
1
+ export * from './AuthenticationApi';
2
+ export * from './InventoriesApi';
3
+ export * from './ProductsApi';
@@ -0,0 +1,21 @@
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
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./AuthenticationApi"), exports);
20
+ __exportStar(require("./InventoriesApi"), exports);
21
+ __exportStar(require("./ProductsApi"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './runtime';
2
+ export * from './apis/index';
3
+ export * from './models/index';