@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,255 @@
|
|
|
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
|
+
|
|
15
|
+
|
|
16
|
+
import type { Configuration } from '../configuration';
|
|
17
|
+
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
18
|
+
import globalAxios from 'axios';
|
|
19
|
+
// Some imports not used depending on template conditions
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
import type { CreateWarehouseDto } from '../models';
|
|
26
|
+
/**
|
|
27
|
+
* WarehousesApi - axios parameter creator
|
|
28
|
+
*/
|
|
29
|
+
export const WarehousesApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
30
|
+
return {
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @summary Создание склада
|
|
34
|
+
* @param {CreateWarehouseDto} createWarehouseDto
|
|
35
|
+
* @param {*} [options] Override http request option.
|
|
36
|
+
* @throws {RequiredError}
|
|
37
|
+
*/
|
|
38
|
+
warehousesControllerCreate: async (createWarehouseDto: CreateWarehouseDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
39
|
+
// verify required parameter 'createWarehouseDto' is not null or undefined
|
|
40
|
+
assertParamExists('warehousesControllerCreate', 'createWarehouseDto', createWarehouseDto)
|
|
41
|
+
const localVarPath = `/warehouses`;
|
|
42
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
43
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
44
|
+
let baseOptions;
|
|
45
|
+
if (configuration) {
|
|
46
|
+
baseOptions = configuration.baseOptions;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
50
|
+
const localVarHeaderParameter = {} as any;
|
|
51
|
+
const localVarQueryParameter = {} as any;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
56
|
+
|
|
57
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
58
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
59
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
60
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createWarehouseDto, localVarRequestOptions, configuration)
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
url: toPathString(localVarUrlObj),
|
|
64
|
+
options: localVarRequestOptions,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @summary Удаление склада по ID
|
|
70
|
+
* @param {string} id
|
|
71
|
+
* @param {*} [options] Override http request option.
|
|
72
|
+
* @throws {RequiredError}
|
|
73
|
+
*/
|
|
74
|
+
warehousesControllerDelete: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
75
|
+
// verify required parameter 'id' is not null or undefined
|
|
76
|
+
assertParamExists('warehousesControllerDelete', 'id', id)
|
|
77
|
+
const localVarPath = `/warehouses/{id}`
|
|
78
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
79
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
80
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
81
|
+
let baseOptions;
|
|
82
|
+
if (configuration) {
|
|
83
|
+
baseOptions = configuration.baseOptions;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
|
87
|
+
const localVarHeaderParameter = {} as any;
|
|
88
|
+
const localVarQueryParameter = {} as any;
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
93
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
94
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
url: toPathString(localVarUrlObj),
|
|
98
|
+
options: localVarRequestOptions,
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @summary Получения доступных пользователю складов
|
|
104
|
+
* @param {*} [options] Override http request option.
|
|
105
|
+
* @throws {RequiredError}
|
|
106
|
+
*/
|
|
107
|
+
warehousesControllerFind: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
108
|
+
const localVarPath = `/warehouses`;
|
|
109
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
110
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
111
|
+
let baseOptions;
|
|
112
|
+
if (configuration) {
|
|
113
|
+
baseOptions = configuration.baseOptions;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
117
|
+
const localVarHeaderParameter = {} as any;
|
|
118
|
+
const localVarQueryParameter = {} as any;
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
123
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
124
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
url: toPathString(localVarUrlObj),
|
|
128
|
+
options: localVarRequestOptions,
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* WarehousesApi - functional programming interface
|
|
136
|
+
*/
|
|
137
|
+
export const WarehousesApiFp = function(configuration?: Configuration) {
|
|
138
|
+
const localVarAxiosParamCreator = WarehousesApiAxiosParamCreator(configuration)
|
|
139
|
+
return {
|
|
140
|
+
/**
|
|
141
|
+
*
|
|
142
|
+
* @summary Создание склада
|
|
143
|
+
* @param {CreateWarehouseDto} createWarehouseDto
|
|
144
|
+
* @param {*} [options] Override http request option.
|
|
145
|
+
* @throws {RequiredError}
|
|
146
|
+
*/
|
|
147
|
+
async warehousesControllerCreate(createWarehouseDto: CreateWarehouseDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
|
|
148
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.warehousesControllerCreate(createWarehouseDto, options);
|
|
149
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
150
|
+
const localVarOperationServerBasePath = operationServerMap['WarehousesApi.warehousesControllerCreate']?.[localVarOperationServerIndex]?.url;
|
|
151
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
152
|
+
},
|
|
153
|
+
/**
|
|
154
|
+
*
|
|
155
|
+
* @summary Удаление склада по ID
|
|
156
|
+
* @param {string} id
|
|
157
|
+
* @param {*} [options] Override http request option.
|
|
158
|
+
* @throws {RequiredError}
|
|
159
|
+
*/
|
|
160
|
+
async warehousesControllerDelete(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
161
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.warehousesControllerDelete(id, options);
|
|
162
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
163
|
+
const localVarOperationServerBasePath = operationServerMap['WarehousesApi.warehousesControllerDelete']?.[localVarOperationServerIndex]?.url;
|
|
164
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
165
|
+
},
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
* @summary Получения доступных пользователю складов
|
|
169
|
+
* @param {*} [options] Override http request option.
|
|
170
|
+
* @throws {RequiredError}
|
|
171
|
+
*/
|
|
172
|
+
async warehousesControllerFind(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
173
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.warehousesControllerFind(options);
|
|
174
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
175
|
+
const localVarOperationServerBasePath = operationServerMap['WarehousesApi.warehousesControllerFind']?.[localVarOperationServerIndex]?.url;
|
|
176
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* WarehousesApi - factory interface
|
|
183
|
+
*/
|
|
184
|
+
export const WarehousesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
185
|
+
const localVarFp = WarehousesApiFp(configuration)
|
|
186
|
+
return {
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* @summary Создание склада
|
|
190
|
+
* @param {CreateWarehouseDto} createWarehouseDto
|
|
191
|
+
* @param {*} [options] Override http request option.
|
|
192
|
+
* @throws {RequiredError}
|
|
193
|
+
*/
|
|
194
|
+
warehousesControllerCreate(createWarehouseDto: CreateWarehouseDto, options?: RawAxiosRequestConfig): AxiosPromise<object> {
|
|
195
|
+
return localVarFp.warehousesControllerCreate(createWarehouseDto, options).then((request) => request(axios, basePath));
|
|
196
|
+
},
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* @summary Удаление склада по ID
|
|
200
|
+
* @param {string} id
|
|
201
|
+
* @param {*} [options] Override http request option.
|
|
202
|
+
* @throws {RequiredError}
|
|
203
|
+
*/
|
|
204
|
+
warehousesControllerDelete(id: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
205
|
+
return localVarFp.warehousesControllerDelete(id, options).then((request) => request(axios, basePath));
|
|
206
|
+
},
|
|
207
|
+
/**
|
|
208
|
+
*
|
|
209
|
+
* @summary Получения доступных пользователю складов
|
|
210
|
+
* @param {*} [options] Override http request option.
|
|
211
|
+
* @throws {RequiredError}
|
|
212
|
+
*/
|
|
213
|
+
warehousesControllerFind(options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
214
|
+
return localVarFp.warehousesControllerFind(options).then((request) => request(axios, basePath));
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* WarehousesApi - object-oriented interface
|
|
221
|
+
*/
|
|
222
|
+
export class WarehousesApi extends BaseAPI {
|
|
223
|
+
/**
|
|
224
|
+
*
|
|
225
|
+
* @summary Создание склада
|
|
226
|
+
* @param {CreateWarehouseDto} createWarehouseDto
|
|
227
|
+
* @param {*} [options] Override http request option.
|
|
228
|
+
* @throws {RequiredError}
|
|
229
|
+
*/
|
|
230
|
+
public warehousesControllerCreate(createWarehouseDto: CreateWarehouseDto, options?: RawAxiosRequestConfig) {
|
|
231
|
+
return WarehousesApiFp(this.configuration).warehousesControllerCreate(createWarehouseDto, options).then((request) => request(this.axios, this.basePath));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
*
|
|
236
|
+
* @summary Удаление склада по ID
|
|
237
|
+
* @param {string} id
|
|
238
|
+
* @param {*} [options] Override http request option.
|
|
239
|
+
* @throws {RequiredError}
|
|
240
|
+
*/
|
|
241
|
+
public warehousesControllerDelete(id: string, options?: RawAxiosRequestConfig) {
|
|
242
|
+
return WarehousesApiFp(this.configuration).warehousesControllerDelete(id, options).then((request) => request(this.axios, this.basePath));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
* @summary Получения доступных пользователю складов
|
|
248
|
+
* @param {*} [options] Override http request option.
|
|
249
|
+
* @throws {RequiredError}
|
|
250
|
+
*/
|
|
251
|
+
public warehousesControllerFind(options?: RawAxiosRequestConfig) {
|
|
252
|
+
return WarehousesApiFp(this.configuration).warehousesControllerFind(options).then((request) => request(this.axios, this.basePath));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
package/base.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
|
|
15
|
+
|
|
16
|
+
import type { Configuration } from './configuration';
|
|
17
|
+
// Some imports not used depending on template conditions
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
20
|
+
import globalAxios from 'axios';
|
|
21
|
+
|
|
22
|
+
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
|
23
|
+
|
|
24
|
+
export const COLLECTION_FORMATS = {
|
|
25
|
+
csv: ",",
|
|
26
|
+
ssv: " ",
|
|
27
|
+
tsv: "\t",
|
|
28
|
+
pipes: "|",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export interface RequestArgs {
|
|
32
|
+
url: string;
|
|
33
|
+
options: RawAxiosRequestConfig;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class BaseAPI {
|
|
37
|
+
protected configuration: Configuration | undefined;
|
|
38
|
+
|
|
39
|
+
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
40
|
+
if (configuration) {
|
|
41
|
+
this.configuration = configuration;
|
|
42
|
+
this.basePath = configuration.basePath ?? basePath;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export class RequiredError extends Error {
|
|
48
|
+
constructor(public field: string, msg?: string) {
|
|
49
|
+
super(msg);
|
|
50
|
+
this.name = "RequiredError"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface ServerMap {
|
|
55
|
+
[key: string]: {
|
|
56
|
+
url: string,
|
|
57
|
+
description: string,
|
|
58
|
+
}[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const operationServerMap: ServerMap = {
|
|
62
|
+
}
|
package/common.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
|
|
15
|
+
import type { Configuration } from "./configuration";
|
|
16
|
+
import type { RequestArgs } from "./base";
|
|
17
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
18
|
+
import { RequiredError } from "./base";
|
|
19
|
+
|
|
20
|
+
export const DUMMY_BASE_URL = 'https://example.com'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @throws {RequiredError}
|
|
25
|
+
*/
|
|
26
|
+
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
|
|
27
|
+
if (paramValue === null || paramValue === undefined) {
|
|
28
|
+
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
|
|
33
|
+
if (configuration && configuration.apiKey) {
|
|
34
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
35
|
+
? await configuration.apiKey(keyParamName)
|
|
36
|
+
: await configuration.apiKey;
|
|
37
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
|
|
42
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
43
|
+
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
|
|
48
|
+
if (configuration && configuration.accessToken) {
|
|
49
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
50
|
+
? await configuration.accessToken()
|
|
51
|
+
: await configuration.accessToken;
|
|
52
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
|
|
57
|
+
if (configuration && configuration.accessToken) {
|
|
58
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
59
|
+
? await configuration.accessToken(name, scopes)
|
|
60
|
+
: await configuration.accessToken;
|
|
61
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
|
67
|
+
if (parameter == null) return;
|
|
68
|
+
if (typeof parameter === "object") {
|
|
69
|
+
if (Array.isArray(parameter)) {
|
|
70
|
+
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
Object.keys(parameter).forEach(currentKey =>
|
|
74
|
+
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
if (urlSearchParams.has(key)) {
|
|
80
|
+
urlSearchParams.append(key, parameter);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
urlSearchParams.set(key, parameter);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const setSearchParams = function (url: URL, ...objects: any[]) {
|
|
89
|
+
const searchParams = new URLSearchParams(url.search);
|
|
90
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
91
|
+
url.search = searchParams.toString();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
|
|
95
|
+
const nonString = typeof value !== 'string';
|
|
96
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
97
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
98
|
+
: nonString;
|
|
99
|
+
return needsSerialization
|
|
100
|
+
? JSON.stringify(value !== undefined ? value : {})
|
|
101
|
+
: (value || "");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const toPathString = function (url: URL) {
|
|
105
|
+
return url.pathname + url.search + url.hash
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
|
109
|
+
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
110
|
+
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|
|
111
|
+
return axios.request<T, R>(axiosRequestArgs);
|
|
112
|
+
};
|
|
113
|
+
}
|
package/configuration.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* MyMarket API
|
|
4
|
+
* API для управления товарами и транзакциями
|
|
5
|
+
*
|
|
6
|
+
* The version of the OpenAPI document: 0.2
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
+
* https://openapi-generator.tech
|
|
11
|
+
* Do not edit the class manually.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
interface AWSv4Configuration {
|
|
15
|
+
options?: {
|
|
16
|
+
region?: string
|
|
17
|
+
service?: string
|
|
18
|
+
}
|
|
19
|
+
credentials?: {
|
|
20
|
+
accessKeyId?: string
|
|
21
|
+
secretAccessKey?: string,
|
|
22
|
+
sessionToken?: string
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ConfigurationParameters {
|
|
27
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
28
|
+
username?: string;
|
|
29
|
+
password?: string;
|
|
30
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
31
|
+
awsv4?: AWSv4Configuration;
|
|
32
|
+
basePath?: string;
|
|
33
|
+
serverIndex?: number;
|
|
34
|
+
baseOptions?: any;
|
|
35
|
+
formDataCtor?: new () => any;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class Configuration {
|
|
39
|
+
/**
|
|
40
|
+
* parameter for apiKey security
|
|
41
|
+
* @param name security name
|
|
42
|
+
*/
|
|
43
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
44
|
+
/**
|
|
45
|
+
* parameter for basic security
|
|
46
|
+
*/
|
|
47
|
+
username?: string;
|
|
48
|
+
/**
|
|
49
|
+
* parameter for basic security
|
|
50
|
+
*/
|
|
51
|
+
password?: string;
|
|
52
|
+
/**
|
|
53
|
+
* parameter for oauth2 security
|
|
54
|
+
* @param name security name
|
|
55
|
+
* @param scopes oauth2 scope
|
|
56
|
+
*/
|
|
57
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
58
|
+
/**
|
|
59
|
+
* parameter for aws4 signature security
|
|
60
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
61
|
+
* @param {string} options.region - aws region
|
|
62
|
+
* @param {string} options.service - name of the service.
|
|
63
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
64
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
65
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
66
|
+
* @memberof Configuration
|
|
67
|
+
*/
|
|
68
|
+
awsv4?: AWSv4Configuration;
|
|
69
|
+
/**
|
|
70
|
+
* override base path
|
|
71
|
+
*/
|
|
72
|
+
basePath?: string;
|
|
73
|
+
/**
|
|
74
|
+
* override server index
|
|
75
|
+
*/
|
|
76
|
+
serverIndex?: number;
|
|
77
|
+
/**
|
|
78
|
+
* base options for axios calls
|
|
79
|
+
*/
|
|
80
|
+
baseOptions?: any;
|
|
81
|
+
/**
|
|
82
|
+
* The FormData constructor that will be used to create multipart form data
|
|
83
|
+
* requests. You can inject this here so that execution environments that
|
|
84
|
+
* do not support the FormData class can still run the generated client.
|
|
85
|
+
*
|
|
86
|
+
* @type {new () => FormData}
|
|
87
|
+
*/
|
|
88
|
+
formDataCtor?: new () => any;
|
|
89
|
+
|
|
90
|
+
constructor(param: ConfigurationParameters = {}) {
|
|
91
|
+
this.apiKey = param.apiKey;
|
|
92
|
+
this.username = param.username;
|
|
93
|
+
this.password = param.password;
|
|
94
|
+
this.accessToken = param.accessToken;
|
|
95
|
+
this.awsv4 = param.awsv4;
|
|
96
|
+
this.basePath = param.basePath;
|
|
97
|
+
this.serverIndex = param.serverIndex;
|
|
98
|
+
this.baseOptions = {
|
|
99
|
+
...param.baseOptions,
|
|
100
|
+
headers: {
|
|
101
|
+
...param.baseOptions?.headers,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
this.formDataCtor = param.formDataCtor;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Check if the given MIME is a JSON MIME.
|
|
109
|
+
* JSON MIME examples:
|
|
110
|
+
* application/json
|
|
111
|
+
* application/json; charset=UTF8
|
|
112
|
+
* APPLICATION/JSON
|
|
113
|
+
* application/vnd.company+json
|
|
114
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
115
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
116
|
+
*/
|
|
117
|
+
public isJsonMime(mime: string): boolean {
|
|
118
|
+
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
119
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
120
|
+
}
|
|
121
|
+
}
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MyMarket API
|
|
3
|
+
* API для управления товарами и транзакциями
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.2
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export * from './apis/default-api';
|
|
13
|
+
export * from './apis/auth-api';
|
|
14
|
+
export * from './apis/business-api';
|
|
15
|
+
export * from './apis/employees-api';
|
|
16
|
+
export * from './apis/products-api';
|
|
17
|
+
export * from './apis/users-api';
|
|
18
|
+
export * from './apis/warehouse-products-api';
|
|
19
|
+
export * from './apis/warehouses-api';
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
27
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
__exportStar(require("./apis/default-api"), exports);
|
|
31
|
+
__exportStar(require("./apis/auth-api"), exports);
|
|
32
|
+
__exportStar(require("./apis/business-api"), exports);
|
|
33
|
+
__exportStar(require("./apis/employees-api"), exports);
|
|
34
|
+
__exportStar(require("./apis/products-api"), exports);
|
|
35
|
+
__exportStar(require("./apis/users-api"), exports);
|
|
36
|
+
__exportStar(require("./apis/warehouse-products-api"), exports);
|
|
37
|
+
__exportStar(require("./apis/warehouses-api"), exports);
|