@my-market/contracts 0.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 +63 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +121 -0
- package/api.ts +25 -0
- package/apis/auth-api.ts +201 -0
- package/apis/business-api.ts +535 -0
- package/apis/default-api.ts +470 -0
- package/apis/employees-api.ts +268 -0
- package/apis/products-api.ts +551 -0
- package/apis/users-api.ts +471 -0
- package/apis/warehouse-products-api.ts +198 -0
- package/apis/warehouses-api.ts +255 -0
- package/base.ts +62 -0
- package/common.ts +113 -0
- package/configuration.ts +121 -0
- package/dist/api.d.ts +19 -0
- package/dist/api.js +37 -0
- package/dist/apis/auth-api.d.ts +98 -0
- package/dist/apis/auth-api.js +196 -0
- package/dist/apis/business-api.d.ts +256 -0
- package/dist/apis/business-api.js +520 -0
- package/dist/apis/default-api.d.ts +227 -0
- package/dist/apis/default-api.js +460 -0
- package/dist/apis/employees-api.d.ts +132 -0
- package/dist/apis/employees-api.js +266 -0
- package/dist/apis/products-api.d.ts +257 -0
- package/dist/apis/products-api.js +525 -0
- package/dist/apis/users-api.d.ts +227 -0
- package/dist/apis/users-api.js +453 -0
- package/dist/apis/warehouse-products-api.d.ts +101 -0
- package/dist/apis/warehouse-products-api.js +198 -0
- package/dist/apis/warehouses-api.d.ts +128 -0
- package/dist/apis/warehouses-api.js +255 -0
- package/dist/base.d.ts +42 -0
- package/dist/base.js +49 -0
- package/dist/common.d.ts +28 -0
- package/dist/common.js +124 -0
- package/dist/configuration.d.ts +98 -0
- package/dist/configuration.js +44 -0
- package/dist/esm/api.d.ts +19 -0
- package/dist/esm/api.js +21 -0
- package/dist/esm/apis/auth-api.d.ts +97 -0
- package/dist/esm/apis/auth-api.js +186 -0
- package/dist/esm/apis/business-api.d.ts +255 -0
- package/dist/esm/apis/business-api.js +510 -0
- package/dist/esm/apis/default-api.d.ts +226 -0
- package/dist/esm/apis/default-api.js +450 -0
- package/dist/esm/apis/employees-api.d.ts +131 -0
- package/dist/esm/apis/employees-api.js +256 -0
- package/dist/esm/apis/products-api.d.ts +256 -0
- package/dist/esm/apis/products-api.js +515 -0
- package/dist/esm/apis/users-api.d.ts +226 -0
- package/dist/esm/apis/users-api.js +443 -0
- package/dist/esm/apis/warehouse-products-api.d.ts +100 -0
- package/dist/esm/apis/warehouse-products-api.js +188 -0
- package/dist/esm/apis/warehouses-api.d.ts +127 -0
- package/dist/esm/apis/warehouses-api.js +245 -0
- package/dist/esm/base.d.ts +42 -0
- package/dist/esm/base.js +41 -0
- package/dist/esm/common.d.ts +28 -0
- package/dist/esm/common.js +112 -0
- package/dist/esm/configuration.d.ts +98 -0
- package/dist/esm/configuration.js +40 -0
- package/dist/esm/index.d.ts +14 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/models/change-password-dto.d.ts +21 -0
- package/dist/esm/models/change-password-dto.js +14 -0
- package/dist/esm/models/change-warehouse-dto.d.ts +15 -0
- package/dist/esm/models/change-warehouse-dto.js +14 -0
- package/dist/esm/models/change-warehouse-item-dto.d.ts +33 -0
- package/dist/esm/models/change-warehouse-item-dto.js +14 -0
- package/dist/esm/models/create-business-dto.d.ts +17 -0
- package/dist/esm/models/create-business-dto.js +14 -0
- package/dist/esm/models/create-product-dto.d.ts +69 -0
- package/dist/esm/models/create-product-dto.js +14 -0
- package/dist/esm/models/create-warehouse-dto.d.ts +17 -0
- package/dist/esm/models/create-warehouse-dto.js +14 -0
- package/dist/esm/models/exception-dto.d.ts +16 -0
- package/dist/esm/models/exception-dto.js +14 -0
- package/dist/esm/models/forgot-password-dto.d.ts +17 -0
- package/dist/esm/models/forgot-password-dto.js +14 -0
- package/dist/esm/models/index.d.ts +17 -0
- package/dist/esm/models/index.js +17 -0
- package/dist/esm/models/login-user-body-dto.d.ts +21 -0
- package/dist/esm/models/login-user-body-dto.js +14 -0
- package/dist/esm/models/login-user-response-dto.d.ts +14 -0
- package/dist/esm/models/login-user-response-dto.js +14 -0
- package/dist/esm/models/logout-user-response-dto.d.ts +14 -0
- package/dist/esm/models/logout-user-response-dto.js +14 -0
- package/dist/esm/models/register-employee-dto.d.ts +29 -0
- package/dist/esm/models/register-employee-dto.js +14 -0
- package/dist/esm/models/register-owner-dto.d.ts +29 -0
- package/dist/esm/models/register-owner-dto.js +14 -0
- package/dist/esm/models/reset-password-dto.d.ts +21 -0
- package/dist/esm/models/reset-password-dto.js +14 -0
- package/dist/esm/models/sell-item-dto.d.ts +25 -0
- package/dist/esm/models/sell-item-dto.js +14 -0
- package/dist/esm/models/sell-product-dto.d.ts +18 -0
- package/dist/esm/models/sell-product-dto.js +14 -0
- package/dist/esm/models/update-product-dto.d.ts +65 -0
- package/dist/esm/models/update-product-dto.js +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +32 -0
- package/dist/models/change-password-dto.d.ts +21 -0
- package/dist/models/change-password-dto.js +15 -0
- package/dist/models/change-warehouse-dto.d.ts +15 -0
- package/dist/models/change-warehouse-dto.js +15 -0
- package/dist/models/change-warehouse-item-dto.d.ts +33 -0
- package/dist/models/change-warehouse-item-dto.js +15 -0
- package/dist/models/create-business-dto.d.ts +17 -0
- package/dist/models/create-business-dto.js +15 -0
- package/dist/models/create-product-dto.d.ts +69 -0
- package/dist/models/create-product-dto.js +15 -0
- package/dist/models/create-warehouse-dto.d.ts +17 -0
- package/dist/models/create-warehouse-dto.js +15 -0
- package/dist/models/exception-dto.d.ts +16 -0
- package/dist/models/exception-dto.js +15 -0
- package/dist/models/forgot-password-dto.d.ts +17 -0
- package/dist/models/forgot-password-dto.js +15 -0
- package/dist/models/index.d.ts +17 -0
- package/dist/models/index.js +33 -0
- package/dist/models/login-user-body-dto.d.ts +21 -0
- package/dist/models/login-user-body-dto.js +15 -0
- package/dist/models/login-user-response-dto.d.ts +14 -0
- package/dist/models/login-user-response-dto.js +15 -0
- package/dist/models/logout-user-response-dto.d.ts +14 -0
- package/dist/models/logout-user-response-dto.js +15 -0
- package/dist/models/register-employee-dto.d.ts +29 -0
- package/dist/models/register-employee-dto.js +15 -0
- package/dist/models/register-owner-dto.d.ts +29 -0
- package/dist/models/register-owner-dto.js +15 -0
- package/dist/models/reset-password-dto.d.ts +21 -0
- package/dist/models/reset-password-dto.js +15 -0
- package/dist/models/sell-item-dto.d.ts +25 -0
- package/dist/models/sell-item-dto.js +15 -0
- package/dist/models/sell-product-dto.d.ts +18 -0
- package/dist/models/sell-product-dto.js +15 -0
- package/dist/models/update-product-dto.d.ts +65 -0
- package/dist/models/update-product-dto.js +15 -0
- package/docs/AuthApi.md +106 -0
- package/docs/BusinessApi.md +361 -0
- package/docs/ChangePasswordDto.md +22 -0
- package/docs/ChangeWarehouseDto.md +20 -0
- package/docs/ChangeWarehouseItemDto.md +28 -0
- package/docs/CreateBusinessDto.md +20 -0
- package/docs/CreateProductDto.md +46 -0
- package/docs/CreateWarehouseDto.md +20 -0
- package/docs/DefaultApi.md +315 -0
- package/docs/EmployeesApi.md +161 -0
- package/docs/ExceptionDto.md +24 -0
- package/docs/ForgotPasswordDto.md +20 -0
- package/docs/LoginUserBodyDto.md +22 -0
- package/docs/LoginUserResponseDto.md +20 -0
- package/docs/LogoutUserResponseDto.md +20 -0
- package/docs/ProductsApi.md +348 -0
- package/docs/RegisterEmployeeDto.md +26 -0
- package/docs/RegisterOwnerDto.md +26 -0
- package/docs/ResetPasswordDto.md +22 -0
- package/docs/SellItemDto.md +24 -0
- package/docs/SellProductDto.md +20 -0
- package/docs/UpdateProductDto.md +44 -0
- package/docs/UsersApi.md +310 -0
- package/docs/WarehouseProductsApi.md +111 -0
- package/docs/WarehousesApi.md +154 -0
- package/git_push.sh +57 -0
- package/index.ts +18 -0
- package/models/change-password-dto.ts +27 -0
- package/models/change-warehouse-dto.ts +23 -0
- package/models/change-warehouse-item-dto.ts +39 -0
- package/models/create-business-dto.ts +23 -0
- package/models/create-product-dto.ts +75 -0
- package/models/create-warehouse-dto.ts +23 -0
- package/models/exception-dto.ts +22 -0
- package/models/forgot-password-dto.ts +23 -0
- package/models/index.ts +17 -0
- package/models/login-user-body-dto.ts +27 -0
- package/models/login-user-response-dto.ts +20 -0
- package/models/logout-user-response-dto.ts +20 -0
- package/models/register-employee-dto.ts +35 -0
- package/models/register-owner-dto.ts +35 -0
- package/models/reset-password-dto.ts +27 -0
- package/models/sell-item-dto.ts +31 -0
- package/models/sell-product-dto.ts +26 -0
- package/models/update-product-dto.ts +71 -0
- package/package.json +33 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* MyMarket API
|
|
5
|
+
* API для управления товарами и транзакциями
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.2
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import globalAxios from 'axios';
|
|
24
|
+
// Some imports not used depending on template conditions
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { BASE_PATH, BaseAPI, operationServerMap } from '../base';
|
|
29
|
+
/**
|
|
30
|
+
* ProductsApi - axios parameter creator
|
|
31
|
+
*/
|
|
32
|
+
export const ProductsApiAxiosParamCreator = function (configuration) {
|
|
33
|
+
return {
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @summary Создать товар
|
|
37
|
+
* @param {CreateProductDto} createProductDto
|
|
38
|
+
* @param {*} [options] Override http request option.
|
|
39
|
+
* @throws {RequiredError}
|
|
40
|
+
*/
|
|
41
|
+
productsControllerCreate: (createProductDto_1, ...args_1) => __awaiter(this, [createProductDto_1, ...args_1], void 0, function* (createProductDto, options = {}) {
|
|
42
|
+
// verify required parameter 'createProductDto' is not null or undefined
|
|
43
|
+
assertParamExists('productsControllerCreate', 'createProductDto', createProductDto);
|
|
44
|
+
const localVarPath = `/products`;
|
|
45
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
46
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
47
|
+
let baseOptions;
|
|
48
|
+
if (configuration) {
|
|
49
|
+
baseOptions = configuration.baseOptions;
|
|
50
|
+
}
|
|
51
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
52
|
+
const localVarHeaderParameter = {};
|
|
53
|
+
const localVarQueryParameter = {};
|
|
54
|
+
// authentication bearer required
|
|
55
|
+
// http bearer authentication required
|
|
56
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
57
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
58
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
59
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
60
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
61
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createProductDto, localVarRequestOptions, configuration);
|
|
62
|
+
return {
|
|
63
|
+
url: toPathString(localVarUrlObj),
|
|
64
|
+
options: localVarRequestOptions,
|
|
65
|
+
};
|
|
66
|
+
}),
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @summary Получить список товаров по складу? с пагинацией
|
|
70
|
+
* @param {number} [warehouseId] ID склада
|
|
71
|
+
* @param {number} [page] Номер страницы для пагинации
|
|
72
|
+
* @param {number} [limit] Количество элементов на странице
|
|
73
|
+
* @param {*} [options] Override http request option.
|
|
74
|
+
* @throws {RequiredError}
|
|
75
|
+
*/
|
|
76
|
+
productsControllerFindAll: (warehouseId_1, page_1, limit_1, ...args_1) => __awaiter(this, [warehouseId_1, page_1, limit_1, ...args_1], void 0, function* (warehouseId, page, limit, options = {}) {
|
|
77
|
+
const localVarPath = `/products`;
|
|
78
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
79
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
80
|
+
let baseOptions;
|
|
81
|
+
if (configuration) {
|
|
82
|
+
baseOptions = configuration.baseOptions;
|
|
83
|
+
}
|
|
84
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
85
|
+
const localVarHeaderParameter = {};
|
|
86
|
+
const localVarQueryParameter = {};
|
|
87
|
+
// authentication bearer required
|
|
88
|
+
// http bearer authentication required
|
|
89
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
90
|
+
if (warehouseId !== undefined) {
|
|
91
|
+
localVarQueryParameter['warehouse_id'] = warehouseId;
|
|
92
|
+
}
|
|
93
|
+
if (page !== undefined) {
|
|
94
|
+
localVarQueryParameter['page'] = page;
|
|
95
|
+
}
|
|
96
|
+
if (limit !== undefined) {
|
|
97
|
+
localVarQueryParameter['limit'] = limit;
|
|
98
|
+
}
|
|
99
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
100
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
101
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
102
|
+
return {
|
|
103
|
+
url: toPathString(localVarUrlObj),
|
|
104
|
+
options: localVarRequestOptions,
|
|
105
|
+
};
|
|
106
|
+
}),
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
* @summary Получить товар по ID
|
|
110
|
+
* @param {number} id
|
|
111
|
+
* @param {*} [options] Override http request option.
|
|
112
|
+
* @throws {RequiredError}
|
|
113
|
+
*/
|
|
114
|
+
productsControllerFindOne: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) {
|
|
115
|
+
// verify required parameter 'id' is not null or undefined
|
|
116
|
+
assertParamExists('productsControllerFindOne', 'id', id);
|
|
117
|
+
const localVarPath = `/products/{id}`
|
|
118
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
119
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
120
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
121
|
+
let baseOptions;
|
|
122
|
+
if (configuration) {
|
|
123
|
+
baseOptions = configuration.baseOptions;
|
|
124
|
+
}
|
|
125
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
126
|
+
const localVarHeaderParameter = {};
|
|
127
|
+
const localVarQueryParameter = {};
|
|
128
|
+
// authentication bearer required
|
|
129
|
+
// http bearer authentication required
|
|
130
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
131
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
132
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
133
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
134
|
+
return {
|
|
135
|
+
url: toPathString(localVarUrlObj),
|
|
136
|
+
options: localVarRequestOptions,
|
|
137
|
+
};
|
|
138
|
+
}),
|
|
139
|
+
/**
|
|
140
|
+
*
|
|
141
|
+
* @summary Удалить товар
|
|
142
|
+
* @param {number} id ID товара
|
|
143
|
+
* @param {*} [options] Override http request option.
|
|
144
|
+
* @throws {RequiredError}
|
|
145
|
+
*/
|
|
146
|
+
productsControllerRemove: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) {
|
|
147
|
+
// verify required parameter 'id' is not null or undefined
|
|
148
|
+
assertParamExists('productsControllerRemove', 'id', id);
|
|
149
|
+
const localVarPath = `/products/{id}`
|
|
150
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
151
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
152
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
153
|
+
let baseOptions;
|
|
154
|
+
if (configuration) {
|
|
155
|
+
baseOptions = configuration.baseOptions;
|
|
156
|
+
}
|
|
157
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
158
|
+
const localVarHeaderParameter = {};
|
|
159
|
+
const localVarQueryParameter = {};
|
|
160
|
+
// authentication bearer required
|
|
161
|
+
// http bearer authentication required
|
|
162
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
163
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
164
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
165
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
166
|
+
return {
|
|
167
|
+
url: toPathString(localVarUrlObj),
|
|
168
|
+
options: localVarRequestOptions,
|
|
169
|
+
};
|
|
170
|
+
}),
|
|
171
|
+
/**
|
|
172
|
+
* Поиск товаров по названию, штрихкоду или артикулу
|
|
173
|
+
* @summary Поиск товаров
|
|
174
|
+
* @param {string} [text] Значение поиска
|
|
175
|
+
* @param {string} [sort] Поле сортировки
|
|
176
|
+
* @param {string} [order] Тип сортировки
|
|
177
|
+
* @param {number} [page] Номер страницы для пагинации
|
|
178
|
+
* @param {number} [limit] Количество элементов на странице
|
|
179
|
+
* @param {*} [options] Override http request option.
|
|
180
|
+
* @throws {RequiredError}
|
|
181
|
+
*/
|
|
182
|
+
productsControllerSearch: (text_1, sort_1, order_1, page_1, limit_1, ...args_1) => __awaiter(this, [text_1, sort_1, order_1, page_1, limit_1, ...args_1], void 0, function* (text, sort, order, page, limit, options = {}) {
|
|
183
|
+
const localVarPath = `/products/search`;
|
|
184
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
185
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
186
|
+
let baseOptions;
|
|
187
|
+
if (configuration) {
|
|
188
|
+
baseOptions = configuration.baseOptions;
|
|
189
|
+
}
|
|
190
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
191
|
+
const localVarHeaderParameter = {};
|
|
192
|
+
const localVarQueryParameter = {};
|
|
193
|
+
// authentication bearer required
|
|
194
|
+
// http bearer authentication required
|
|
195
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
196
|
+
if (text !== undefined) {
|
|
197
|
+
localVarQueryParameter['text'] = text;
|
|
198
|
+
}
|
|
199
|
+
if (sort !== undefined) {
|
|
200
|
+
localVarQueryParameter['sort'] = sort;
|
|
201
|
+
}
|
|
202
|
+
if (order !== undefined) {
|
|
203
|
+
localVarQueryParameter['order'] = order;
|
|
204
|
+
}
|
|
205
|
+
if (page !== undefined) {
|
|
206
|
+
localVarQueryParameter['page'] = page;
|
|
207
|
+
}
|
|
208
|
+
if (limit !== undefined) {
|
|
209
|
+
localVarQueryParameter['limit'] = limit;
|
|
210
|
+
}
|
|
211
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
212
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
213
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
214
|
+
return {
|
|
215
|
+
url: toPathString(localVarUrlObj),
|
|
216
|
+
options: localVarRequestOptions,
|
|
217
|
+
};
|
|
218
|
+
}),
|
|
219
|
+
/**
|
|
220
|
+
*
|
|
221
|
+
* @summary Обновить товар
|
|
222
|
+
* @param {number} id ID товара
|
|
223
|
+
* @param {UpdateProductDto} updateProductDto
|
|
224
|
+
* @param {*} [options] Override http request option.
|
|
225
|
+
* @throws {RequiredError}
|
|
226
|
+
*/
|
|
227
|
+
productsControllerUpdate: (id_1, updateProductDto_1, ...args_1) => __awaiter(this, [id_1, updateProductDto_1, ...args_1], void 0, function* (id, updateProductDto, options = {}) {
|
|
228
|
+
// verify required parameter 'id' is not null or undefined
|
|
229
|
+
assertParamExists('productsControllerUpdate', 'id', id);
|
|
230
|
+
// verify required parameter 'updateProductDto' is not null or undefined
|
|
231
|
+
assertParamExists('productsControllerUpdate', 'updateProductDto', updateProductDto);
|
|
232
|
+
const localVarPath = `/products/{id}`
|
|
233
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
234
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
235
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
236
|
+
let baseOptions;
|
|
237
|
+
if (configuration) {
|
|
238
|
+
baseOptions = configuration.baseOptions;
|
|
239
|
+
}
|
|
240
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
241
|
+
const localVarHeaderParameter = {};
|
|
242
|
+
const localVarQueryParameter = {};
|
|
243
|
+
// authentication bearer required
|
|
244
|
+
// http bearer authentication required
|
|
245
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
246
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
247
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
248
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
249
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
250
|
+
localVarRequestOptions.data = serializeDataIfNeeded(updateProductDto, localVarRequestOptions, configuration);
|
|
251
|
+
return {
|
|
252
|
+
url: toPathString(localVarUrlObj),
|
|
253
|
+
options: localVarRequestOptions,
|
|
254
|
+
};
|
|
255
|
+
}),
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* ProductsApi - functional programming interface
|
|
260
|
+
*/
|
|
261
|
+
export const ProductsApiFp = function (configuration) {
|
|
262
|
+
const localVarAxiosParamCreator = ProductsApiAxiosParamCreator(configuration);
|
|
263
|
+
return {
|
|
264
|
+
/**
|
|
265
|
+
*
|
|
266
|
+
* @summary Создать товар
|
|
267
|
+
* @param {CreateProductDto} createProductDto
|
|
268
|
+
* @param {*} [options] Override http request option.
|
|
269
|
+
* @throws {RequiredError}
|
|
270
|
+
*/
|
|
271
|
+
productsControllerCreate(createProductDto, options) {
|
|
272
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
+
var _a, _b, _c;
|
|
274
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.productsControllerCreate(createProductDto, options);
|
|
275
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
276
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.productsControllerCreate']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
277
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
278
|
+
});
|
|
279
|
+
},
|
|
280
|
+
/**
|
|
281
|
+
*
|
|
282
|
+
* @summary Получить список товаров по складу? с пагинацией
|
|
283
|
+
* @param {number} [warehouseId] ID склада
|
|
284
|
+
* @param {number} [page] Номер страницы для пагинации
|
|
285
|
+
* @param {number} [limit] Количество элементов на странице
|
|
286
|
+
* @param {*} [options] Override http request option.
|
|
287
|
+
* @throws {RequiredError}
|
|
288
|
+
*/
|
|
289
|
+
productsControllerFindAll(warehouseId, page, limit, options) {
|
|
290
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
291
|
+
var _a, _b, _c;
|
|
292
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.productsControllerFindAll(warehouseId, page, limit, options);
|
|
293
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
294
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.productsControllerFindAll']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
295
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
/**
|
|
299
|
+
*
|
|
300
|
+
* @summary Получить товар по ID
|
|
301
|
+
* @param {number} id
|
|
302
|
+
* @param {*} [options] Override http request option.
|
|
303
|
+
* @throws {RequiredError}
|
|
304
|
+
*/
|
|
305
|
+
productsControllerFindOne(id, options) {
|
|
306
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
307
|
+
var _a, _b, _c;
|
|
308
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.productsControllerFindOne(id, options);
|
|
309
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
310
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.productsControllerFindOne']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
311
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
/**
|
|
315
|
+
*
|
|
316
|
+
* @summary Удалить товар
|
|
317
|
+
* @param {number} id ID товара
|
|
318
|
+
* @param {*} [options] Override http request option.
|
|
319
|
+
* @throws {RequiredError}
|
|
320
|
+
*/
|
|
321
|
+
productsControllerRemove(id, options) {
|
|
322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
+
var _a, _b, _c;
|
|
324
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.productsControllerRemove(id, options);
|
|
325
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
326
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.productsControllerRemove']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
327
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
/**
|
|
331
|
+
* Поиск товаров по названию, штрихкоду или артикулу
|
|
332
|
+
* @summary Поиск товаров
|
|
333
|
+
* @param {string} [text] Значение поиска
|
|
334
|
+
* @param {string} [sort] Поле сортировки
|
|
335
|
+
* @param {string} [order] Тип сортировки
|
|
336
|
+
* @param {number} [page] Номер страницы для пагинации
|
|
337
|
+
* @param {number} [limit] Количество элементов на странице
|
|
338
|
+
* @param {*} [options] Override http request option.
|
|
339
|
+
* @throws {RequiredError}
|
|
340
|
+
*/
|
|
341
|
+
productsControllerSearch(text, sort, order, page, limit, options) {
|
|
342
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
343
|
+
var _a, _b, _c;
|
|
344
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.productsControllerSearch(text, sort, order, page, limit, options);
|
|
345
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
346
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.productsControllerSearch']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
347
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
348
|
+
});
|
|
349
|
+
},
|
|
350
|
+
/**
|
|
351
|
+
*
|
|
352
|
+
* @summary Обновить товар
|
|
353
|
+
* @param {number} id ID товара
|
|
354
|
+
* @param {UpdateProductDto} updateProductDto
|
|
355
|
+
* @param {*} [options] Override http request option.
|
|
356
|
+
* @throws {RequiredError}
|
|
357
|
+
*/
|
|
358
|
+
productsControllerUpdate(id, updateProductDto, options) {
|
|
359
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
360
|
+
var _a, _b, _c;
|
|
361
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.productsControllerUpdate(id, updateProductDto, options);
|
|
362
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
363
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.productsControllerUpdate']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
364
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
365
|
+
});
|
|
366
|
+
},
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* ProductsApi - factory interface
|
|
371
|
+
*/
|
|
372
|
+
export const ProductsApiFactory = function (configuration, basePath, axios) {
|
|
373
|
+
const localVarFp = ProductsApiFp(configuration);
|
|
374
|
+
return {
|
|
375
|
+
/**
|
|
376
|
+
*
|
|
377
|
+
* @summary Создать товар
|
|
378
|
+
* @param {CreateProductDto} createProductDto
|
|
379
|
+
* @param {*} [options] Override http request option.
|
|
380
|
+
* @throws {RequiredError}
|
|
381
|
+
*/
|
|
382
|
+
productsControllerCreate(createProductDto, options) {
|
|
383
|
+
return localVarFp.productsControllerCreate(createProductDto, options).then((request) => request(axios, basePath));
|
|
384
|
+
},
|
|
385
|
+
/**
|
|
386
|
+
*
|
|
387
|
+
* @summary Получить список товаров по складу? с пагинацией
|
|
388
|
+
* @param {number} [warehouseId] ID склада
|
|
389
|
+
* @param {number} [page] Номер страницы для пагинации
|
|
390
|
+
* @param {number} [limit] Количество элементов на странице
|
|
391
|
+
* @param {*} [options] Override http request option.
|
|
392
|
+
* @throws {RequiredError}
|
|
393
|
+
*/
|
|
394
|
+
productsControllerFindAll(warehouseId, page, limit, options) {
|
|
395
|
+
return localVarFp.productsControllerFindAll(warehouseId, page, limit, options).then((request) => request(axios, basePath));
|
|
396
|
+
},
|
|
397
|
+
/**
|
|
398
|
+
*
|
|
399
|
+
* @summary Получить товар по ID
|
|
400
|
+
* @param {number} id
|
|
401
|
+
* @param {*} [options] Override http request option.
|
|
402
|
+
* @throws {RequiredError}
|
|
403
|
+
*/
|
|
404
|
+
productsControllerFindOne(id, options) {
|
|
405
|
+
return localVarFp.productsControllerFindOne(id, options).then((request) => request(axios, basePath));
|
|
406
|
+
},
|
|
407
|
+
/**
|
|
408
|
+
*
|
|
409
|
+
* @summary Удалить товар
|
|
410
|
+
* @param {number} id ID товара
|
|
411
|
+
* @param {*} [options] Override http request option.
|
|
412
|
+
* @throws {RequiredError}
|
|
413
|
+
*/
|
|
414
|
+
productsControllerRemove(id, options) {
|
|
415
|
+
return localVarFp.productsControllerRemove(id, options).then((request) => request(axios, basePath));
|
|
416
|
+
},
|
|
417
|
+
/**
|
|
418
|
+
* Поиск товаров по названию, штрихкоду или артикулу
|
|
419
|
+
* @summary Поиск товаров
|
|
420
|
+
* @param {string} [text] Значение поиска
|
|
421
|
+
* @param {string} [sort] Поле сортировки
|
|
422
|
+
* @param {string} [order] Тип сортировки
|
|
423
|
+
* @param {number} [page] Номер страницы для пагинации
|
|
424
|
+
* @param {number} [limit] Количество элементов на странице
|
|
425
|
+
* @param {*} [options] Override http request option.
|
|
426
|
+
* @throws {RequiredError}
|
|
427
|
+
*/
|
|
428
|
+
productsControllerSearch(text, sort, order, page, limit, options) {
|
|
429
|
+
return localVarFp.productsControllerSearch(text, sort, order, page, limit, options).then((request) => request(axios, basePath));
|
|
430
|
+
},
|
|
431
|
+
/**
|
|
432
|
+
*
|
|
433
|
+
* @summary Обновить товар
|
|
434
|
+
* @param {number} id ID товара
|
|
435
|
+
* @param {UpdateProductDto} updateProductDto
|
|
436
|
+
* @param {*} [options] Override http request option.
|
|
437
|
+
* @throws {RequiredError}
|
|
438
|
+
*/
|
|
439
|
+
productsControllerUpdate(id, updateProductDto, options) {
|
|
440
|
+
return localVarFp.productsControllerUpdate(id, updateProductDto, options).then((request) => request(axios, basePath));
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* ProductsApi - object-oriented interface
|
|
446
|
+
*/
|
|
447
|
+
export class ProductsApi extends BaseAPI {
|
|
448
|
+
/**
|
|
449
|
+
*
|
|
450
|
+
* @summary Создать товар
|
|
451
|
+
* @param {CreateProductDto} createProductDto
|
|
452
|
+
* @param {*} [options] Override http request option.
|
|
453
|
+
* @throws {RequiredError}
|
|
454
|
+
*/
|
|
455
|
+
productsControllerCreate(createProductDto, options) {
|
|
456
|
+
return ProductsApiFp(this.configuration).productsControllerCreate(createProductDto, options).then((request) => request(this.axios, this.basePath));
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
*
|
|
460
|
+
* @summary Получить список товаров по складу? с пагинацией
|
|
461
|
+
* @param {number} [warehouseId] ID склада
|
|
462
|
+
* @param {number} [page] Номер страницы для пагинации
|
|
463
|
+
* @param {number} [limit] Количество элементов на странице
|
|
464
|
+
* @param {*} [options] Override http request option.
|
|
465
|
+
* @throws {RequiredError}
|
|
466
|
+
*/
|
|
467
|
+
productsControllerFindAll(warehouseId, page, limit, options) {
|
|
468
|
+
return ProductsApiFp(this.configuration).productsControllerFindAll(warehouseId, page, limit, options).then((request) => request(this.axios, this.basePath));
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
*
|
|
472
|
+
* @summary Получить товар по ID
|
|
473
|
+
* @param {number} id
|
|
474
|
+
* @param {*} [options] Override http request option.
|
|
475
|
+
* @throws {RequiredError}
|
|
476
|
+
*/
|
|
477
|
+
productsControllerFindOne(id, options) {
|
|
478
|
+
return ProductsApiFp(this.configuration).productsControllerFindOne(id, options).then((request) => request(this.axios, this.basePath));
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
*
|
|
482
|
+
* @summary Удалить товар
|
|
483
|
+
* @param {number} id ID товара
|
|
484
|
+
* @param {*} [options] Override http request option.
|
|
485
|
+
* @throws {RequiredError}
|
|
486
|
+
*/
|
|
487
|
+
productsControllerRemove(id, options) {
|
|
488
|
+
return ProductsApiFp(this.configuration).productsControllerRemove(id, options).then((request) => request(this.axios, this.basePath));
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Поиск товаров по названию, штрихкоду или артикулу
|
|
492
|
+
* @summary Поиск товаров
|
|
493
|
+
* @param {string} [text] Значение поиска
|
|
494
|
+
* @param {string} [sort] Поле сортировки
|
|
495
|
+
* @param {string} [order] Тип сортировки
|
|
496
|
+
* @param {number} [page] Номер страницы для пагинации
|
|
497
|
+
* @param {number} [limit] Количество элементов на странице
|
|
498
|
+
* @param {*} [options] Override http request option.
|
|
499
|
+
* @throws {RequiredError}
|
|
500
|
+
*/
|
|
501
|
+
productsControllerSearch(text, sort, order, page, limit, options) {
|
|
502
|
+
return ProductsApiFp(this.configuration).productsControllerSearch(text, sort, order, page, limit, options).then((request) => request(this.axios, this.basePath));
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
*
|
|
506
|
+
* @summary Обновить товар
|
|
507
|
+
* @param {number} id ID товара
|
|
508
|
+
* @param {UpdateProductDto} updateProductDto
|
|
509
|
+
* @param {*} [options] Override http request option.
|
|
510
|
+
* @throws {RequiredError}
|
|
511
|
+
*/
|
|
512
|
+
productsControllerUpdate(id, updateProductDto, options) {
|
|
513
|
+
return ProductsApiFp(this.configuration).productsControllerUpdate(id, updateProductDto, options).then((request) => request(this.axios, this.basePath));
|
|
514
|
+
}
|
|
515
|
+
}
|