1
|
/* eslint-disable */
|
2
|
/* tslint:disable */
|
3
|
/*
|
4
|
* ---------------------------------------------------------------
|
5
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
6
|
* ## ##
|
7
|
* ## AUTHOR: acacode ##
|
8
|
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
9
|
* ---------------------------------------------------------------
|
10
|
*/
|
11
|
|
12
|
import { CatalogItemDto, PasswordDto, PermissionDto, TitlePageDto, UserDto } from "./data-contracts";
|
13
|
import { ContentType, HttpClient, RequestParams } from "./http-client";
|
14
|
|
15
|
export class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
16
|
/**
|
17
|
* No description
|
18
|
*
|
19
|
* @tags catalog-controller
|
20
|
* @name GetCatalogItem
|
21
|
* @summary returns catalog item with given ID
|
22
|
* @request GET:/api/catalog-items/{id}
|
23
|
*/
|
24
|
getCatalogItem = (id: string, params: RequestParams = {}) =>
|
25
|
this.request<CatalogItemDto, any>({
|
26
|
path: `/api/catalog-items/${id}`,
|
27
|
method: "GET",
|
28
|
format: "json",
|
29
|
...params,
|
30
|
});
|
31
|
/**
|
32
|
* No description
|
33
|
*
|
34
|
* @tags catalog-controller
|
35
|
* @name UpdateCatalogItem
|
36
|
* @summary updates catalog item with given ID
|
37
|
* @request PUT:/api/catalog-items/{id}
|
38
|
*/
|
39
|
updateCatalogItem = (id: string, data: CatalogItemDto, params: RequestParams = {}) =>
|
40
|
this.request<void, any>({
|
41
|
path: `/api/catalog-items/${id}`,
|
42
|
method: "PUT",
|
43
|
body: data,
|
44
|
type: ContentType.Json,
|
45
|
...params,
|
46
|
});
|
47
|
/**
|
48
|
* No description
|
49
|
*
|
50
|
* @tags catalog-controller
|
51
|
* @name DeleteCatalogItem
|
52
|
* @summary deletes catalog item with given ID
|
53
|
* @request DELETE:/api/catalog-items/{id}
|
54
|
*/
|
55
|
deleteCatalogItem = (id: string, params: RequestParams = {}) =>
|
56
|
this.request<void, any>({
|
57
|
path: `/api/catalog-items/${id}`,
|
58
|
method: "DELETE",
|
59
|
...params,
|
60
|
});
|
61
|
/**
|
62
|
* No description
|
63
|
*
|
64
|
* @tags user-controller
|
65
|
* @name GetAllUsers
|
66
|
* @summary returns all users
|
67
|
* @request GET:/api/users
|
68
|
*/
|
69
|
getAllUsers = (params: RequestParams = {}) =>
|
70
|
this.request<UserDto[], any>({
|
71
|
path: `/api/users`,
|
72
|
method: "GET",
|
73
|
...params,
|
74
|
});
|
75
|
/**
|
76
|
* No description
|
77
|
*
|
78
|
* @tags user-controller
|
79
|
* @name RegisterNewUser
|
80
|
* @summary registers new user
|
81
|
* @request POST:/api/users
|
82
|
*/
|
83
|
registerNewUser = (data: UserDto, params: RequestParams = {}) =>
|
84
|
this.request<void, any>({
|
85
|
path: `/api/users`,
|
86
|
method: "POST",
|
87
|
body: data,
|
88
|
type: ContentType.Json,
|
89
|
...params,
|
90
|
});
|
91
|
/**
|
92
|
* No description
|
93
|
*
|
94
|
* @tags title-page-controller
|
95
|
* @name GetTitlePage
|
96
|
* @summary returns title page
|
97
|
* @request GET:/api/title-page
|
98
|
*/
|
99
|
getTitlePage = (params: RequestParams = {}) =>
|
100
|
this.request<TitlePageDto, any>({
|
101
|
path: `/api/title-page`,
|
102
|
method: "GET",
|
103
|
...params,
|
104
|
});
|
105
|
/**
|
106
|
* No description
|
107
|
*
|
108
|
* @tags title-page-controller
|
109
|
* @name UpdateTitlePage
|
110
|
* @summary updates/creates title page
|
111
|
* @request POST:/api/title-page
|
112
|
*/
|
113
|
updateTitlePage = (data: TitlePageDto, params: RequestParams = {}) =>
|
114
|
this.request<void, any>({
|
115
|
path: `/api/title-page`,
|
116
|
method: "POST",
|
117
|
body: data,
|
118
|
type: ContentType.Json,
|
119
|
...params,
|
120
|
});
|
121
|
/**
|
122
|
* No description
|
123
|
*
|
124
|
* @tags catalog-controller
|
125
|
* @name GetCatalog
|
126
|
* @summary returns catalog items based on filter
|
127
|
* @request GET:/api/catalog-items
|
128
|
*/
|
129
|
getCatalog = (query?: { name?: string; country?: string; type?: string }, params: RequestParams = {}) =>
|
130
|
this.request<CatalogItemDto[], any>({
|
131
|
path: `/api/catalog-items`,
|
132
|
method: "GET",
|
133
|
query: query,
|
134
|
...params,
|
135
|
});
|
136
|
/**
|
137
|
* No description
|
138
|
*
|
139
|
* @tags catalog-controller
|
140
|
* @name AddCatalogItem
|
141
|
* @summary creates new catalog item
|
142
|
* @request POST:/api/catalog-items
|
143
|
*/
|
144
|
addCatalogItem = (data: CatalogItemDto, params: RequestParams = {}) =>
|
145
|
this.request<void, any>({
|
146
|
path: `/api/catalog-items`,
|
147
|
method: "POST",
|
148
|
body: data,
|
149
|
type: ContentType.Json,
|
150
|
...params,
|
151
|
});
|
152
|
/**
|
153
|
* No description
|
154
|
*
|
155
|
* @tags user-controller
|
156
|
* @name UpdatePermissions
|
157
|
* @summary changes permissions to given user
|
158
|
* @request PATCH:/api/users/{username}/permissions
|
159
|
*/
|
160
|
updatePermissions = (username: string, data: PermissionDto, params: RequestParams = {}) =>
|
161
|
this.request<void, any>({
|
162
|
path: `/api/users/${username}/permissions`,
|
163
|
method: "PATCH",
|
164
|
body: data,
|
165
|
type: ContentType.Json,
|
166
|
...params,
|
167
|
});
|
168
|
/**
|
169
|
* No description
|
170
|
*
|
171
|
* @tags user-controller
|
172
|
* @name ResetPassword
|
173
|
* @summary changes password to given user
|
174
|
* @request PATCH:/api/users/{username}/password
|
175
|
*/
|
176
|
resetPassword = (username: string, data: PasswordDto, params: RequestParams = {}) =>
|
177
|
this.request<void, any>({
|
178
|
path: `/api/users/${username}/password`,
|
179
|
method: "PATCH",
|
180
|
body: data,
|
181
|
type: ContentType.Json,
|
182
|
...params,
|
183
|
});
|
184
|
/**
|
185
|
* No description
|
186
|
*
|
187
|
* @tags user-controller
|
188
|
* @name ChangePassword
|
189
|
* @summary changes password to logged-in user
|
190
|
* @request PATCH:/api/users/password
|
191
|
*/
|
192
|
changePassword = (query: { oldPassword: string }, data: PasswordDto, params: RequestParams = {}) =>
|
193
|
this.request<void, any>({
|
194
|
path: `/api/users/password`,
|
195
|
method: "PATCH",
|
196
|
query: query,
|
197
|
body: data,
|
198
|
type: ContentType.Json,
|
199
|
...params,
|
200
|
});
|
201
|
/**
|
202
|
* No description
|
203
|
*
|
204
|
* @tags user-controller
|
205
|
* @name RefreshToken
|
206
|
* @summary returns a new access token and a refresh token to user
|
207
|
* @request GET:/api/users/token
|
208
|
*/
|
209
|
refreshToken = (params: RequestParams = {}) =>
|
210
|
this.request<void, any>({
|
211
|
path: `/api/users/token`,
|
212
|
method: "GET",
|
213
|
...params,
|
214
|
});
|
215
|
/**
|
216
|
* No description
|
217
|
*
|
218
|
* @tags user-controller
|
219
|
* @name DeleteUser
|
220
|
* @summary deletes user with given username
|
221
|
* @request DELETE:/api/users/{username}
|
222
|
*/
|
223
|
deleteUser = (username: string, params: RequestParams = {}) =>
|
224
|
this.request<void, any>({
|
225
|
path: `/api/users/${username}`,
|
226
|
method: "DELETE",
|
227
|
...params,
|
228
|
});
|
229
|
}
|