@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.
Files changed (188) hide show
  1. package/.openapi-generator/FILES +63 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +121 -0
  5. package/api.ts +25 -0
  6. package/apis/auth-api.ts +201 -0
  7. package/apis/business-api.ts +535 -0
  8. package/apis/default-api.ts +470 -0
  9. package/apis/employees-api.ts +268 -0
  10. package/apis/products-api.ts +551 -0
  11. package/apis/users-api.ts +471 -0
  12. package/apis/warehouse-products-api.ts +198 -0
  13. package/apis/warehouses-api.ts +255 -0
  14. package/base.ts +62 -0
  15. package/common.ts +113 -0
  16. package/configuration.ts +121 -0
  17. package/dist/api.d.ts +19 -0
  18. package/dist/api.js +37 -0
  19. package/dist/apis/auth-api.d.ts +98 -0
  20. package/dist/apis/auth-api.js +196 -0
  21. package/dist/apis/business-api.d.ts +256 -0
  22. package/dist/apis/business-api.js +520 -0
  23. package/dist/apis/default-api.d.ts +227 -0
  24. package/dist/apis/default-api.js +460 -0
  25. package/dist/apis/employees-api.d.ts +132 -0
  26. package/dist/apis/employees-api.js +266 -0
  27. package/dist/apis/products-api.d.ts +257 -0
  28. package/dist/apis/products-api.js +525 -0
  29. package/dist/apis/users-api.d.ts +227 -0
  30. package/dist/apis/users-api.js +453 -0
  31. package/dist/apis/warehouse-products-api.d.ts +101 -0
  32. package/dist/apis/warehouse-products-api.js +198 -0
  33. package/dist/apis/warehouses-api.d.ts +128 -0
  34. package/dist/apis/warehouses-api.js +255 -0
  35. package/dist/base.d.ts +42 -0
  36. package/dist/base.js +49 -0
  37. package/dist/common.d.ts +28 -0
  38. package/dist/common.js +124 -0
  39. package/dist/configuration.d.ts +98 -0
  40. package/dist/configuration.js +44 -0
  41. package/dist/esm/api.d.ts +19 -0
  42. package/dist/esm/api.js +21 -0
  43. package/dist/esm/apis/auth-api.d.ts +97 -0
  44. package/dist/esm/apis/auth-api.js +186 -0
  45. package/dist/esm/apis/business-api.d.ts +255 -0
  46. package/dist/esm/apis/business-api.js +510 -0
  47. package/dist/esm/apis/default-api.d.ts +226 -0
  48. package/dist/esm/apis/default-api.js +450 -0
  49. package/dist/esm/apis/employees-api.d.ts +131 -0
  50. package/dist/esm/apis/employees-api.js +256 -0
  51. package/dist/esm/apis/products-api.d.ts +256 -0
  52. package/dist/esm/apis/products-api.js +515 -0
  53. package/dist/esm/apis/users-api.d.ts +226 -0
  54. package/dist/esm/apis/users-api.js +443 -0
  55. package/dist/esm/apis/warehouse-products-api.d.ts +100 -0
  56. package/dist/esm/apis/warehouse-products-api.js +188 -0
  57. package/dist/esm/apis/warehouses-api.d.ts +127 -0
  58. package/dist/esm/apis/warehouses-api.js +245 -0
  59. package/dist/esm/base.d.ts +42 -0
  60. package/dist/esm/base.js +41 -0
  61. package/dist/esm/common.d.ts +28 -0
  62. package/dist/esm/common.js +112 -0
  63. package/dist/esm/configuration.d.ts +98 -0
  64. package/dist/esm/configuration.js +40 -0
  65. package/dist/esm/index.d.ts +14 -0
  66. package/dist/esm/index.js +16 -0
  67. package/dist/esm/models/change-password-dto.d.ts +21 -0
  68. package/dist/esm/models/change-password-dto.js +14 -0
  69. package/dist/esm/models/change-warehouse-dto.d.ts +15 -0
  70. package/dist/esm/models/change-warehouse-dto.js +14 -0
  71. package/dist/esm/models/change-warehouse-item-dto.d.ts +33 -0
  72. package/dist/esm/models/change-warehouse-item-dto.js +14 -0
  73. package/dist/esm/models/create-business-dto.d.ts +17 -0
  74. package/dist/esm/models/create-business-dto.js +14 -0
  75. package/dist/esm/models/create-product-dto.d.ts +69 -0
  76. package/dist/esm/models/create-product-dto.js +14 -0
  77. package/dist/esm/models/create-warehouse-dto.d.ts +17 -0
  78. package/dist/esm/models/create-warehouse-dto.js +14 -0
  79. package/dist/esm/models/exception-dto.d.ts +16 -0
  80. package/dist/esm/models/exception-dto.js +14 -0
  81. package/dist/esm/models/forgot-password-dto.d.ts +17 -0
  82. package/dist/esm/models/forgot-password-dto.js +14 -0
  83. package/dist/esm/models/index.d.ts +17 -0
  84. package/dist/esm/models/index.js +17 -0
  85. package/dist/esm/models/login-user-body-dto.d.ts +21 -0
  86. package/dist/esm/models/login-user-body-dto.js +14 -0
  87. package/dist/esm/models/login-user-response-dto.d.ts +14 -0
  88. package/dist/esm/models/login-user-response-dto.js +14 -0
  89. package/dist/esm/models/logout-user-response-dto.d.ts +14 -0
  90. package/dist/esm/models/logout-user-response-dto.js +14 -0
  91. package/dist/esm/models/register-employee-dto.d.ts +29 -0
  92. package/dist/esm/models/register-employee-dto.js +14 -0
  93. package/dist/esm/models/register-owner-dto.d.ts +29 -0
  94. package/dist/esm/models/register-owner-dto.js +14 -0
  95. package/dist/esm/models/reset-password-dto.d.ts +21 -0
  96. package/dist/esm/models/reset-password-dto.js +14 -0
  97. package/dist/esm/models/sell-item-dto.d.ts +25 -0
  98. package/dist/esm/models/sell-item-dto.js +14 -0
  99. package/dist/esm/models/sell-product-dto.d.ts +18 -0
  100. package/dist/esm/models/sell-product-dto.js +14 -0
  101. package/dist/esm/models/update-product-dto.d.ts +65 -0
  102. package/dist/esm/models/update-product-dto.js +14 -0
  103. package/dist/index.d.ts +14 -0
  104. package/dist/index.js +32 -0
  105. package/dist/models/change-password-dto.d.ts +21 -0
  106. package/dist/models/change-password-dto.js +15 -0
  107. package/dist/models/change-warehouse-dto.d.ts +15 -0
  108. package/dist/models/change-warehouse-dto.js +15 -0
  109. package/dist/models/change-warehouse-item-dto.d.ts +33 -0
  110. package/dist/models/change-warehouse-item-dto.js +15 -0
  111. package/dist/models/create-business-dto.d.ts +17 -0
  112. package/dist/models/create-business-dto.js +15 -0
  113. package/dist/models/create-product-dto.d.ts +69 -0
  114. package/dist/models/create-product-dto.js +15 -0
  115. package/dist/models/create-warehouse-dto.d.ts +17 -0
  116. package/dist/models/create-warehouse-dto.js +15 -0
  117. package/dist/models/exception-dto.d.ts +16 -0
  118. package/dist/models/exception-dto.js +15 -0
  119. package/dist/models/forgot-password-dto.d.ts +17 -0
  120. package/dist/models/forgot-password-dto.js +15 -0
  121. package/dist/models/index.d.ts +17 -0
  122. package/dist/models/index.js +33 -0
  123. package/dist/models/login-user-body-dto.d.ts +21 -0
  124. package/dist/models/login-user-body-dto.js +15 -0
  125. package/dist/models/login-user-response-dto.d.ts +14 -0
  126. package/dist/models/login-user-response-dto.js +15 -0
  127. package/dist/models/logout-user-response-dto.d.ts +14 -0
  128. package/dist/models/logout-user-response-dto.js +15 -0
  129. package/dist/models/register-employee-dto.d.ts +29 -0
  130. package/dist/models/register-employee-dto.js +15 -0
  131. package/dist/models/register-owner-dto.d.ts +29 -0
  132. package/dist/models/register-owner-dto.js +15 -0
  133. package/dist/models/reset-password-dto.d.ts +21 -0
  134. package/dist/models/reset-password-dto.js +15 -0
  135. package/dist/models/sell-item-dto.d.ts +25 -0
  136. package/dist/models/sell-item-dto.js +15 -0
  137. package/dist/models/sell-product-dto.d.ts +18 -0
  138. package/dist/models/sell-product-dto.js +15 -0
  139. package/dist/models/update-product-dto.d.ts +65 -0
  140. package/dist/models/update-product-dto.js +15 -0
  141. package/docs/AuthApi.md +106 -0
  142. package/docs/BusinessApi.md +361 -0
  143. package/docs/ChangePasswordDto.md +22 -0
  144. package/docs/ChangeWarehouseDto.md +20 -0
  145. package/docs/ChangeWarehouseItemDto.md +28 -0
  146. package/docs/CreateBusinessDto.md +20 -0
  147. package/docs/CreateProductDto.md +46 -0
  148. package/docs/CreateWarehouseDto.md +20 -0
  149. package/docs/DefaultApi.md +315 -0
  150. package/docs/EmployeesApi.md +161 -0
  151. package/docs/ExceptionDto.md +24 -0
  152. package/docs/ForgotPasswordDto.md +20 -0
  153. package/docs/LoginUserBodyDto.md +22 -0
  154. package/docs/LoginUserResponseDto.md +20 -0
  155. package/docs/LogoutUserResponseDto.md +20 -0
  156. package/docs/ProductsApi.md +348 -0
  157. package/docs/RegisterEmployeeDto.md +26 -0
  158. package/docs/RegisterOwnerDto.md +26 -0
  159. package/docs/ResetPasswordDto.md +22 -0
  160. package/docs/SellItemDto.md +24 -0
  161. package/docs/SellProductDto.md +20 -0
  162. package/docs/UpdateProductDto.md +44 -0
  163. package/docs/UsersApi.md +310 -0
  164. package/docs/WarehouseProductsApi.md +111 -0
  165. package/docs/WarehousesApi.md +154 -0
  166. package/git_push.sh +57 -0
  167. package/index.ts +18 -0
  168. package/models/change-password-dto.ts +27 -0
  169. package/models/change-warehouse-dto.ts +23 -0
  170. package/models/change-warehouse-item-dto.ts +39 -0
  171. package/models/create-business-dto.ts +23 -0
  172. package/models/create-product-dto.ts +75 -0
  173. package/models/create-warehouse-dto.ts +23 -0
  174. package/models/exception-dto.ts +22 -0
  175. package/models/forgot-password-dto.ts +23 -0
  176. package/models/index.ts +17 -0
  177. package/models/login-user-body-dto.ts +27 -0
  178. package/models/login-user-response-dto.ts +20 -0
  179. package/models/logout-user-response-dto.ts +20 -0
  180. package/models/register-employee-dto.ts +35 -0
  181. package/models/register-owner-dto.ts +35 -0
  182. package/models/reset-password-dto.ts +27 -0
  183. package/models/sell-item-dto.ts +31 -0
  184. package/models/sell-product-dto.ts +26 -0
  185. package/models/update-product-dto.ts +71 -0
  186. package/package.json +33 -0
  187. package/tsconfig.esm.json +7 -0
  188. 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
+ }
@@ -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);