@profcomff/api-uilib 2024.11.24 → 2025.3.1

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/README.md CHANGED
@@ -18,7 +18,7 @@ pnpm install @profcomff/api-uilib
18
18
  Используйте для совершения запросов к <https://api.test.profcomff.com> и <https://api.profcomff.com>.
19
19
 
20
20
  ```ts
21
- import { createClient } from "@profcomff/api-uilib";
21
+ import { createClient, setupAuth } from "@profcomff/api-uilib";
22
22
 
23
23
  // Setup client with base API path
24
24
  // You can use environment `import.meta.env.VITE_API_URL` for example
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profcomff/api-uilib",
3
- "version": "2024.11.24",
3
+ "version": "2025.03.01",
4
4
  "description": "API wrappers, autogenerated from openapi.json files",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.d.ts",
@@ -1577,6 +1577,8 @@ export interface components {
1577
1577
  expires?: string | null;
1578
1578
  /** Id */
1579
1579
  id: number;
1580
+ /** Is Unbounded */
1581
+ is_unbounded?: boolean | null;
1580
1582
  /**
1581
1583
  * Last Activity
1582
1584
  * Format: date-time
@@ -1745,6 +1747,8 @@ export interface components {
1745
1747
  SessionPost: {
1746
1748
  /** Expires */
1747
1749
  expires?: string | null;
1750
+ /** Is Unbounded */
1751
+ is_unbounded?: boolean | null;
1748
1752
  /**
1749
1753
  * Scopes
1750
1754
  * @default []
@@ -33,8 +33,11 @@ export interface paths {
33
33
  put?: never;
34
34
  /**
35
35
  * Create Comment
36
- * @description Создает комментарий к преподавателю в базе данных RatingAPI
36
+ * @description Scopes: `["rating.comment.import"]`
37
+ * Создает комментарий к преподавателю в базе данных RatingAPI
37
38
  * Для создания комментария нужно быть авторизованным
39
+ *
40
+ * Для возможности создания комментария с указанием времени создания и изменения необходим скоуп ["rating.comment.import"]
38
41
  */
39
42
  post: operations["create_comment_comment_post"];
40
43
  delete?: never;
@@ -78,6 +81,27 @@ export interface paths {
78
81
  patch: operations["review_comment_comment__uuid__patch"];
79
82
  trace?: never;
80
83
  };
84
+ "/rating/comment/import": {
85
+ parameters: {
86
+ query?: never;
87
+ header?: never;
88
+ path?: never;
89
+ cookie?: never;
90
+ };
91
+ get?: never;
92
+ put?: never;
93
+ /**
94
+ * Import Comments
95
+ * @description Scopes: `["rating.comment.import"]`
96
+ * Создает комментарии в базе данных RatingAPI
97
+ */
98
+ post: operations["import_comments_comment_import_post"];
99
+ delete?: never;
100
+ options?: never;
101
+ head?: never;
102
+ patch?: never;
103
+ trace?: never;
104
+ };
81
105
  "/rating/lecturer": {
82
106
  parameters: {
83
107
  query?: never;
@@ -183,7 +207,7 @@ export interface components {
183
207
  /** Mark Kindness */
184
208
  mark_kindness: number;
185
209
  /** Subject */
186
- subject: string;
210
+ subject?: string | null;
187
211
  /** Text */
188
212
  text: string;
189
213
  /**
@@ -213,8 +237,39 @@ export interface components {
213
237
  /** Total */
214
238
  total: number;
215
239
  };
240
+ /** CommentImport */
241
+ CommentImport: {
242
+ /** Create Ts */
243
+ create_ts?: string | null;
244
+ /**
245
+ * Is Anonymous
246
+ * @default true
247
+ */
248
+ is_anonymous: boolean;
249
+ /** Lecturer Id */
250
+ lecturer_id: number;
251
+ /** Mark Clarity */
252
+ mark_clarity: number;
253
+ /** Mark Freebie */
254
+ mark_freebie: number;
255
+ /** Mark Kindness */
256
+ mark_kindness: number;
257
+ /** Subject */
258
+ subject?: string | null;
259
+ /** Text */
260
+ text: string;
261
+ /** Update Ts */
262
+ update_ts?: string | null;
263
+ };
264
+ /** CommentImportAll */
265
+ CommentImportAll: {
266
+ /** Comments */
267
+ comments: components["schemas"]["CommentImport"][];
268
+ };
216
269
  /** CommentPost */
217
270
  CommentPost: {
271
+ /** Create Ts */
272
+ create_ts?: string | null;
218
273
  /**
219
274
  * Is Anonymous
220
275
  * @default true
@@ -230,6 +285,8 @@ export interface components {
230
285
  subject: string;
231
286
  /** Text */
232
287
  text: string;
288
+ /** Update Ts */
289
+ update_ts?: string | null;
233
290
  };
234
291
  /** HTTPValidationError */
235
292
  HTTPValidationError: {
@@ -301,7 +358,7 @@ export interface components {
301
358
  /** Middle Name */
302
359
  middle_name: string;
303
360
  /** Timetable Id */
304
- timetable_id: number;
361
+ timetable_id?: number | null;
305
362
  };
306
363
  /** StatusResponseModel */
307
364
  StatusResponseModel: {
@@ -496,6 +553,39 @@ export interface operations {
496
553
  };
497
554
  };
498
555
  };
556
+ import_comments_comment_import_post: {
557
+ parameters: {
558
+ query?: never;
559
+ header?: never;
560
+ path?: never;
561
+ cookie?: never;
562
+ };
563
+ requestBody: {
564
+ content: {
565
+ "application/json": components["schemas"]["CommentImportAll"];
566
+ };
567
+ };
568
+ responses: {
569
+ /** @description Successful Response */
570
+ 200: {
571
+ headers: {
572
+ [name: string]: unknown;
573
+ };
574
+ content: {
575
+ "application/json": components["schemas"]["CommentGetAll"];
576
+ };
577
+ };
578
+ /** @description Validation Error */
579
+ 422: {
580
+ headers: {
581
+ [name: string]: unknown;
582
+ };
583
+ content: {
584
+ "application/json": components["schemas"]["HTTPValidationError"];
585
+ };
586
+ };
587
+ };
588
+ };
499
589
  get_lecturers_lecturer_get: {
500
590
  parameters: {
501
591
  query?: {
@@ -21,6 +21,8 @@ export interface paths {
21
21
  * Create Category
22
22
  * @description Создать категорию пользовательских данных. Получить категорию можно будет со скоупами, имена которых в category_inp.scopes
23
23
  * Ручка обновит документацию
24
+ *
25
+ * Scopes: `["userdata.category.create"]`
24
26
  */
25
27
  post: operations["create_category_category_post"];
26
28
  delete?: never;
@@ -45,6 +47,8 @@ export interface paths {
45
47
  /**
46
48
  * Create Param
47
49
  * @description Создать поле внутри категории. Ответ на пользовательские данные будет такой {..., category: {...,param: '', ...}}
50
+ *
51
+ * Scopes: `["userdata.param.create"]`
48
52
  */
49
53
  post: operations["create_param_category__category_id__param_post"];
50
54
  delete?: never;
@@ -70,6 +74,8 @@ export interface paths {
70
74
  /**
71
75
  * Delete Param
72
76
  * @description Удалить параметр внутри категории
77
+ *
78
+ * Scopes: `["userdata.param.delete"]`
73
79
  */
74
80
  delete: operations["delete_param_category__category_id__param__id__delete"];
75
81
  options?: never;
@@ -77,6 +83,8 @@ export interface paths {
77
83
  /**
78
84
  * Patch Param
79
85
  * @description Обновить параметр внутри категории
86
+ *
87
+ * Scopes: `["userdata.param.update"]`
80
88
  */
81
89
  patch: operations["patch_param_category__category_id__param__id__patch"];
82
90
  trace?: never;
@@ -98,6 +106,8 @@ export interface paths {
98
106
  /**
99
107
  * Delete Category
100
108
  * @description Удалить категорию
109
+ *
110
+ * Scopes: `["userdata.category.delete"]`
101
111
  */
102
112
  delete: operations["delete_category_category__id__delete"];
103
113
  options?: never;
@@ -105,6 +115,8 @@ export interface paths {
105
115
  /**
106
116
  * Patch Category
107
117
  * @description Обновить категорию
118
+ *
119
+ * Scopes: `["userdata.category.update"]`
108
120
  */
109
121
  patch: operations["patch_category_category__id__patch"];
110
122
  trace?: never;
@@ -125,6 +137,8 @@ export interface paths {
125
137
  /**
126
138
  * Create Source
127
139
  * @description Создать источник данных
140
+ *
141
+ * Scopes: `["userdata.source.create"]`
128
142
  */
129
143
  post: operations["create_source_source_post"];
130
144
  delete?: never;
@@ -150,6 +164,8 @@ export interface paths {
150
164
  /**
151
165
  * Delete Source
152
166
  * @description Удалить источник данных
167
+ *
168
+ * Scopes: `["userdata.source.delete"]`
153
169
  */
154
170
  delete: operations["delete_source_source__id__delete"];
155
171
  options?: never;
@@ -157,10 +173,35 @@ export interface paths {
157
173
  /**
158
174
  * Patch Source
159
175
  * @description Обновить источник данных
176
+ *
177
+ * Scopes: `["userdata.source.update"]`
160
178
  */
161
179
  patch: operations["patch_source_source__id__patch"];
162
180
  trace?: never;
163
181
  };
182
+ "/userdata/user": {
183
+ parameters: {
184
+ query?: never;
185
+ header?: never;
186
+ path?: never;
187
+ cookie?: never;
188
+ };
189
+ /**
190
+ * Get Users Info
191
+ * @description Получить информацию о пользователях.
192
+ * :param users: список id юзеров, про которых нужно вернуть информацию
193
+ * :param categories: список id категорий, параметры которых нужно вернуть
194
+ * :return: список данных о пользователях и данных категориях
195
+ */
196
+ get: operations["get_users_info_user_get"];
197
+ put?: never;
198
+ post?: never;
199
+ delete?: never;
200
+ options?: never;
201
+ head?: never;
202
+ patch?: never;
203
+ trace?: never;
204
+ };
164
205
  "/userdata/user/{id}": {
165
206
  parameters: {
166
207
  query?: never;
@@ -189,7 +230,7 @@ export interface paths {
189
230
  * Чтобы обновить от имени админиа, надо иметь скоуп `userdata.info.admin`
190
231
  * Чтобы обновить неизменяемую информацию надо обладать скоупом `userdata.info.update`
191
232
  * Для обновления своей информации(источник `user`) не нужны скоупы на обновление соответствующих категорий
192
- * Для обновления чужой информации от имени админа(источник `admin`)
233
+ * Для обновления чужой информации от имени админа(источник `admin`)
193
234
  * нужны скоупы на обновление всех указанных в теле запроса категорий пользовательских данных данных
194
235
  */
195
236
  post: operations["update_user_user__id__post"];
@@ -234,6 +275,17 @@ export interface components {
234
275
  /** Update Scope */
235
276
  update_scope?: string | null;
236
277
  };
278
+ /** ExtendedUserInfo */
279
+ ExtendedUserInfo: {
280
+ /** Category */
281
+ category: string;
282
+ /** Param */
283
+ param: string;
284
+ /** User Id */
285
+ user_id: number;
286
+ /** Value */
287
+ value?: string | null;
288
+ };
237
289
  /** HTTPValidationError */
238
290
  HTTPValidationError: {
239
291
  /** Detail */
@@ -252,6 +304,13 @@ export interface components {
252
304
  /** Name */
253
305
  name: string;
254
306
  type: components["schemas"]["ViewType"];
307
+ /** Validation */
308
+ validation?: string | null;
309
+ /**
310
+ * Visible In User Response
311
+ * @default true
312
+ */
313
+ visible_in_user_response: boolean;
255
314
  };
256
315
  /** ParamPatch */
257
316
  ParamPatch: {
@@ -262,6 +321,13 @@ export interface components {
262
321
  /** Name */
263
322
  name?: string | null;
264
323
  type?: components["schemas"]["ViewType"] | null;
324
+ /** Validation */
325
+ validation?: string | null;
326
+ /**
327
+ * Visible In User Response
328
+ * @default true
329
+ */
330
+ visible_in_user_response: boolean;
265
331
  };
266
332
  /** ParamPost */
267
333
  ParamPost: {
@@ -272,6 +338,13 @@ export interface components {
272
338
  /** Name */
273
339
  name: string;
274
340
  type: components["schemas"]["ViewType"];
341
+ /** Validation */
342
+ validation?: string | null;
343
+ /**
344
+ * Visible In User Response
345
+ * @default true
346
+ */
347
+ visible_in_user_response: boolean;
275
348
  };
276
349
  /** SourceGet */
277
350
  SourceGet: {
@@ -326,6 +399,11 @@ export interface components {
326
399
  /** Source */
327
400
  source: string;
328
401
  };
402
+ /** UsersInfoGet */
403
+ UsersInfoGet: {
404
+ /** Items */
405
+ items: components["schemas"]["ExtendedUserInfo"][];
406
+ };
329
407
  /** ValidationError */
330
408
  ValidationError: {
331
409
  /** Location */
@@ -830,9 +908,44 @@ export interface operations {
830
908
  };
831
909
  };
832
910
  };
911
+ get_users_info_user_get: {
912
+ parameters: {
913
+ query: {
914
+ additional_data?: number[];
915
+ categories: number[];
916
+ users: number[];
917
+ };
918
+ header?: never;
919
+ path?: never;
920
+ cookie?: never;
921
+ };
922
+ requestBody?: never;
923
+ responses: {
924
+ /** @description Successful Response */
925
+ 200: {
926
+ headers: {
927
+ [name: string]: unknown;
928
+ };
929
+ content: {
930
+ "application/json": components["schemas"]["UsersInfoGet"];
931
+ };
932
+ };
933
+ /** @description Validation Error */
934
+ 422: {
935
+ headers: {
936
+ [name: string]: unknown;
937
+ };
938
+ content: {
939
+ "application/json": components["schemas"]["HTTPValidationError"];
940
+ };
941
+ };
942
+ };
943
+ };
833
944
  get_user_info_user__id__get: {
834
945
  parameters: {
835
- query?: never;
946
+ query?: {
947
+ additional_data?: number[];
948
+ };
836
949
  header?: never;
837
950
  path: {
838
951
  id: number;