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