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