@profcomff/api-uilib 2024.7.28 → 2024.10.22

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
@@ -2,13 +2,23 @@
2
2
 
3
3
  Представляет интерфейс для совершения запросов к API по адресу <https://api.profcomff.com>.
4
4
 
5
+ Поддерживает типы данных TypeScript и подсветку синтаксиса.
5
6
 
6
7
  [<img src="https://cdn.profcomff.com/easycode/easycode.svg" width="200"></img>](https://easycode.profcomff.com/templates/docker-node/workspace?mode=manual&param.Repository+URL=https://github.com/profcomff/api-uilib.git&param.Working+directory=api-uilib)
7
8
 
9
+
8
10
  ## Использование
9
11
 
12
+ Установите библиотеку
13
+
14
+ ```shell
15
+ pnpm install @profcomff/api-uilib
16
+ ```
17
+
18
+ Используйте для совершения запросов к <https://api.test.profcomff.com> и <https://api.profcomff.com>.
19
+
10
20
  ```ts
11
- import { createClient } from '@profcomff/api-uilib';
21
+ import { createClient } from "@profcomff/api-uilib";
12
22
 
13
23
  // Setup client with base API path
14
24
  // You can use environment `import.meta.env.VITE_API_URL` for example
@@ -20,10 +30,68 @@ setupAuth("myApiTokenHere");
20
30
 
21
31
  // Make request
22
32
  const me_with_scopes = await apiClient.GET("/auth/me", {
23
- params: {
24
- query: {
25
- info: ["session_scopes"]
26
- }
27
- }
33
+ params: {
34
+ query: {
35
+ info: ["session_scopes"],
36
+ },
37
+ },
28
38
  });
29
39
  ```
40
+
41
+
42
+ ## Тестирование
43
+
44
+ _На основе <https://openapi-ts.dev/openapi-fetch/testing>._
45
+
46
+ ```ts
47
+ import { createTestClient } from "@profcomff/api-uilib";
48
+ import { http, HttpResponse } from 'msw';
49
+ import { afterEach, beforeAll, afterAll, expect, test } from 'vitest';
50
+ import { setupServer } from 'msw/node';
51
+
52
+ export const server = setupServer();
53
+
54
+ beforeAll(() => {
55
+ server.listen({
56
+ onUnhandledRequest: request => {
57
+ throw new Error(`No request handler found for ${request.method} ${request.url}`);
58
+ },
59
+ });
60
+ });
61
+
62
+ afterEach(() => server.resetHandlers());
63
+ afterAll(() => server.close());
64
+
65
+ test('Get basic info from Auth API with hardload', async () => {
66
+ const baseUrl = import.meta.env.VITE_API_URL;
67
+
68
+ const rawData = {
69
+ id: 1,
70
+ email: 'hello@world.com',
71
+ };
72
+
73
+ server.use(http.get(`${baseUrl}/auth/user/1`, () => HttpResponse.json(rawData, { status: 200 })));
74
+ const testClient = createTestClient({ baseUrl }); // Клиент API должен быть инициализирован ПОСЛЕ msw сервера
75
+
76
+ const { data, error } = await testClient
77
+ .GET(
78
+ '/auth/user/{user_id}',
79
+ { params: { path: { user_id: this.id } },
80
+ });
81
+ expect(data).toEqual(rawData);
82
+ expect(error).toBeUndefined();
83
+ });
84
+ ```
85
+
86
+
87
+ ## Разработка
88
+
89
+ ### Автоматическая генерация
90
+
91
+ Используйте команду `pnpm generate` или [CI-пайплайн Autogen API bindings](https://github.com/profcomff/api-uilib/actions/workflows/autogen.yaml) для кодогенерации последней версии биндингов с **продового** API <https://api.profcomff.com>.
92
+
93
+ CI исполняется вручную по нажатии кнопки run workflow. После завершения исполнения новая версия будет доступна для ревью в виде Pull Request с названием "Automated API update".
94
+
95
+ ### Релизный процесс
96
+
97
+ Библиотека релизится по созданию тега вида `v*`, где вместо звездочки идет описание версии [по правилам semver](https://semver.org/lang/ru/). Менять версию в `package.json` не нужно.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profcomff/api-uilib",
3
- "version": "2024.07.28",
3
+ "version": "2024.10.22",
4
4
  "description": "API wrappers, autogenerated from openapi.json files",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.d.ts",
@@ -13,6 +13,7 @@ const apis = {
13
13
  social: "https://api.profcomff.com/social/openapi.json",
14
14
  userdata: "https://api.profcomff.com/userdata/openapi.json",
15
15
  achievement: "https://api.profcomff.com/achievement/openapi.json",
16
+ rating: "https://api.profcomff.com/rating/openapi.json",
16
17
  };
17
18
 
18
19
  const header = `/**
package/src/index.ts CHANGED
@@ -9,6 +9,7 @@ import type { paths as servicesPaths } from "./openapi/services.ts";
9
9
  import type { paths as socialPaths } from "./openapi/social.ts";
10
10
  import type { paths as timetablePaths } from "./openapi/timetable.ts";
11
11
  import type { paths as userdataPaths } from "./openapi/userdata.ts";
12
+ import type { paths as ratingPaths } from "./openapi/rating.js";
12
13
 
13
14
 
14
15
  export type paths = (
@@ -19,7 +20,8 @@ export type paths = (
19
20
  servicesPaths &
20
21
  socialPaths &
21
22
  timetablePaths &
22
- userdataPaths
23
+ userdataPaths &
24
+ ratingPaths
23
25
  );
24
26
 
25
27
  let currentClient: ReturnType<typeof Client<paths>> | undefined = undefined;
@@ -27,7 +29,9 @@ let currentToken: string | undefined = undefined;
27
29
 
28
30
  const authMiddleware: Middleware = {
29
31
  async onRequest({ request, options }) {
30
- request.headers.set("Authorization", currentToken);
32
+ if (currentToken) {
33
+ request.headers.set("Authorization", currentToken);
34
+ }
31
35
  return request;
32
36
  },
33
37
  };
@@ -38,7 +42,7 @@ export const createClient = (baseUrl: string): ReturnType<typeof Client<paths>>
38
42
  }
39
43
 
40
44
  currentClient = Client<paths>({ baseUrl })
41
- if (currentToken !== null) {
45
+ if (currentToken) {
42
46
  currentClient.use(authMiddleware);
43
47
  }
44
48
  return currentClient;
@@ -48,10 +52,10 @@ export const createTestClient = (baseUrl: string): ReturnType<typeof Client<path
48
52
  return Client<paths>({ baseUrl });
49
53
  }
50
54
 
51
- export const setupAuth = (newToken: string | null) => {
55
+ export const setupAuth = (newToken: string | undefined) => {
52
56
  currentToken = newToken;
53
57
  if (currentClient !== undefined) {
54
- if (newToken === null) {
58
+ if (!newToken) {
55
59
  currentClient.eject(authMiddleware)
56
60
  } else {
57
61
  currentClient.use(authMiddleware);
@@ -0,0 +1,652 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+
6
+ export interface paths {
7
+ "/rating/comment": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ /**
15
+ * Get Comments
16
+ * @description Scopes: `["rating.comment.review"]`
17
+ *
18
+ * `limit` - максимальное количество возвращаемых комментариев
19
+ *
20
+ * `offset` - смещение, определяющее, с какого по порядку комментария начинать выборку.
21
+ * Если без смещения возвращается комментарий с условным номером N,
22
+ * то при значении offset = X будет возвращаться комментарий с номером N + X
23
+ *
24
+ * `order_by` - возможное значение `'create_ts'` - возвращается список комментариев отсортированных по времени создания
25
+ *
26
+ * `lecturer_id` - вернет все комментарии для преподавателя с конкретным id, по дефолту возвращает вообще все аппрувнутые комментарии.
27
+ *
28
+ * `unreviewed` - вернет все непроверенные комментарии, если True. По дефолту False.
29
+ */
30
+ get: operations["get_comments_comment_get"];
31
+ put?: never;
32
+ /**
33
+ * Create Comment
34
+ * @description Создает комментарий к преподавателю в базе данных RatingAPI
35
+ * Для создания комментария нужно быть авторизованным
36
+ */
37
+ post: operations["create_comment_comment_post"];
38
+ delete?: never;
39
+ options?: never;
40
+ head?: never;
41
+ patch?: never;
42
+ trace?: never;
43
+ };
44
+ "/rating/comment/{uuid}": {
45
+ parameters: {
46
+ query?: never;
47
+ header?: never;
48
+ path?: never;
49
+ cookie?: never;
50
+ };
51
+ /**
52
+ * Get Comment
53
+ * @description Возвращает комментарий по его UUID в базе данных RatingAPI
54
+ */
55
+ get: operations["get_comment_comment__uuid__get"];
56
+ put?: never;
57
+ post?: never;
58
+ /**
59
+ * Delete Comment
60
+ * @description Scopes: `["rating.comment.delete"]`
61
+ *
62
+ * Удаляет комментарий по его UUID в базе данных RatingAPI
63
+ */
64
+ delete: operations["delete_comment_comment__uuid__delete"];
65
+ options?: never;
66
+ head?: never;
67
+ /**
68
+ * Review Comment
69
+ * @description Scopes: `["rating.comment.review"]`
70
+ * Проверка комментария и присваивания ему статуса по его UUID в базе данных RatingAPI
71
+ *
72
+ * `review_status` - возможные значения
73
+ * `approved` - комментарий одобрен и возвращается при запросе лектора
74
+ * `dismissed` - комментарий отклонен, не отображается в запросе лектора
75
+ */
76
+ patch: operations["review_comment_comment__uuid__patch"];
77
+ trace?: never;
78
+ };
79
+ "/rating/lecturer": {
80
+ parameters: {
81
+ query?: never;
82
+ header?: never;
83
+ path?: never;
84
+ cookie?: never;
85
+ };
86
+ /**
87
+ * Get Lecturers
88
+ * @description Scopes: `["rating.lecturer.read"]`
89
+ *
90
+ * `limit` - максимальное количество возвращаемых преподавателей
91
+ *
92
+ * `offset` - нижняя граница получения преподавателей, т.е. если по дефолту первым возвращается преподаватель с условным номером N, то при наличии ненулевого offset будет возвращаться преподаватель с номером N + offset
93
+ *
94
+ * `order_by` - возможные значения `'general'`.
95
+ * Если передано `'general'` - возвращается список преподавателей отсортированных по общей оценке
96
+ *
97
+ * `info` - возможные значения `'comments'`, `'mark'`.
98
+ * Если передано `'comments'`, то возвращаются одобренные комментарии к преподавателю.
99
+ * Если передано `'mark'`, то возвращаются общие средние оценки, а также суммарная средняя оценка по всем одобренным комментариям.
100
+ *
101
+ * `subject`
102
+ * Если передано `subject` - возвращает всех преподавателей, для которых переданное значение совпадает с их предметом преподавания.
103
+ * Также возвращает всех преподавателей, у которых есть комментарий с совпадающим с данным subject.
104
+ */
105
+ get: operations["get_lecturers_lecturer_get"];
106
+ put?: never;
107
+ /**
108
+ * Create Lecturer
109
+ * @description Scopes: `["rating.lecturer.create"]`
110
+ *
111
+ * Создает преподавателя в базе данных RatingAPI
112
+ */
113
+ post: operations["create_lecturer_lecturer_post"];
114
+ delete?: never;
115
+ options?: never;
116
+ head?: never;
117
+ patch?: never;
118
+ trace?: never;
119
+ };
120
+ "/rating/lecturer/{id}": {
121
+ parameters: {
122
+ query?: never;
123
+ header?: never;
124
+ path?: never;
125
+ cookie?: never;
126
+ };
127
+ /**
128
+ * Get Lecturer
129
+ * @description Scopes: `["rating.lecturer.read"]`
130
+ *
131
+ * Возвращает преподавателя по его ID в базе данных RatingAPI
132
+ *
133
+ * *QUERY* `info: string` - возможные значения `'comments'`, `'mark'`.
134
+ * Если передано `'comments'`, то возвращаются одобренные комментарии к преподавателю.
135
+ * Если передано `'mark'`, то возвращаются общие средние оценки, а также суммарная средняя оценка по всем одобренным комментариям.
136
+ *
137
+ * Subject лектора возвращшается либо из базы данных, либо из любого аппрувнутого комментария
138
+ */
139
+ get: operations["get_lecturer_lecturer__id__get"];
140
+ put?: never;
141
+ post?: never;
142
+ /**
143
+ * Delete Lecturer
144
+ * @description Scopes: `["rating.lecturer.delete"]`
145
+ */
146
+ delete: operations["delete_lecturer_lecturer__id__delete"];
147
+ options?: never;
148
+ head?: never;
149
+ /**
150
+ * Update Lecturer
151
+ * @description Scopes: `["rating.lecturer.update"]`
152
+ */
153
+ patch: operations["update_lecturer_lecturer__id__patch"];
154
+ trace?: never;
155
+ };
156
+ }
157
+ export type webhooks = Record<string, never>;
158
+ export interface components {
159
+ schemas: {
160
+ /** CommentGet */
161
+ CommentGet: {
162
+ /**
163
+ * Create Ts
164
+ * Format: date-time
165
+ */
166
+ create_ts: string;
167
+ /** Lecturer Id */
168
+ lecturer_id: number;
169
+ /** Mark Clarity */
170
+ mark_clarity: number;
171
+ /** Mark Freebie */
172
+ mark_freebie: number;
173
+ /** Mark Kindness */
174
+ mark_kindness: number;
175
+ /** Subject */
176
+ subject: string;
177
+ /** Text */
178
+ text: string;
179
+ /**
180
+ * Update Ts
181
+ * Format: date-time
182
+ */
183
+ update_ts: string;
184
+ /**
185
+ * Uuid
186
+ * Format: uuid
187
+ */
188
+ uuid: string;
189
+ };
190
+ /** CommentGetAll */
191
+ CommentGetAll: {
192
+ /**
193
+ * Comments
194
+ * @default []
195
+ */
196
+ comments: components["schemas"]["CommentGet"][];
197
+ /** Limit */
198
+ limit: number;
199
+ /** Offset */
200
+ offset: number;
201
+ /** Total */
202
+ total: number;
203
+ };
204
+ /** CommentPost */
205
+ CommentPost: {
206
+ /** Mark Clarity */
207
+ mark_clarity: number;
208
+ /** Mark Freebie */
209
+ mark_freebie: number;
210
+ /** Mark Kindness */
211
+ mark_kindness: number;
212
+ /** Subject */
213
+ subject: string;
214
+ /** Text */
215
+ text: string;
216
+ };
217
+ /** HTTPValidationError */
218
+ HTTPValidationError: {
219
+ /** Detail */
220
+ detail?: components["schemas"]["ValidationError"][];
221
+ };
222
+ /** LecturerGet */
223
+ LecturerGet: {
224
+ /** Avatar Link */
225
+ avatar_link?: string | null;
226
+ /** Comments */
227
+ comments?: components["schemas"]["CommentGet"][] | null;
228
+ /** First Name */
229
+ first_name: string;
230
+ /** Id */
231
+ id: number;
232
+ /** Last Name */
233
+ last_name: string;
234
+ /** Mark Clarity */
235
+ mark_clarity?: number | null;
236
+ /** Mark Freebie */
237
+ mark_freebie?: number | null;
238
+ /** Mark General */
239
+ mark_general?: number | null;
240
+ /** Mark Kindness */
241
+ mark_kindness?: number | null;
242
+ /** Middle Name */
243
+ middle_name: string;
244
+ /** Subject */
245
+ subject?: string | null;
246
+ /** Timetable Id */
247
+ timetable_id: number;
248
+ };
249
+ /** LecturerGetAll */
250
+ LecturerGetAll: {
251
+ /**
252
+ * Lecturers
253
+ * @default []
254
+ */
255
+ lecturers: components["schemas"]["LecturerGet"][];
256
+ /** Limit */
257
+ limit: number;
258
+ /** Offset */
259
+ offset: number;
260
+ /** Total */
261
+ total: number;
262
+ };
263
+ /** LecturerPatch */
264
+ LecturerPatch: {
265
+ /** Avatar Link */
266
+ avatar_link?: string | null;
267
+ /** First Name */
268
+ first_name?: string | null;
269
+ /** Last Name */
270
+ last_name?: string | null;
271
+ /** Middle Name */
272
+ middle_name?: string | null;
273
+ /** Subject */
274
+ subject?: string | null;
275
+ /** Timetable Id */
276
+ timetable_id?: number | null;
277
+ };
278
+ /** LecturerPost */
279
+ LecturerPost: {
280
+ /** Avatar Link */
281
+ avatar_link?: string | null;
282
+ /** First Name */
283
+ first_name: string;
284
+ /** Last Name */
285
+ last_name: string;
286
+ /** Middle Name */
287
+ middle_name: string;
288
+ /** Subject */
289
+ subject?: string | null;
290
+ /** Timetable Id */
291
+ timetable_id: number;
292
+ };
293
+ /** StatusResponseModel */
294
+ StatusResponseModel: {
295
+ /** Message */
296
+ message: string;
297
+ /** Ru */
298
+ ru: string;
299
+ /** Status */
300
+ status: string;
301
+ };
302
+ /** ValidationError */
303
+ ValidationError: {
304
+ /** Location */
305
+ loc: (string | number)[];
306
+ /** Message */
307
+ msg: string;
308
+ /** Error Type */
309
+ type: string;
310
+ };
311
+ };
312
+ responses: never;
313
+ parameters: never;
314
+ requestBodies: never;
315
+ headers: never;
316
+ pathItems: never;
317
+ }
318
+ export type $defs = Record<string, never>;
319
+ export interface operations {
320
+ get_comments_comment_get: {
321
+ parameters: {
322
+ query?: {
323
+ lecturer_id?: number | null;
324
+ limit?: number;
325
+ offset?: number;
326
+ order_by?: "create_ts"[];
327
+ unreviewed?: boolean;
328
+ };
329
+ header?: never;
330
+ path?: never;
331
+ cookie?: never;
332
+ };
333
+ requestBody?: never;
334
+ responses: {
335
+ /** @description Successful Response */
336
+ 200: {
337
+ headers: {
338
+ [name: string]: unknown;
339
+ };
340
+ content: {
341
+ "application/json": components["schemas"]["CommentGetAll"];
342
+ };
343
+ };
344
+ /** @description Validation Error */
345
+ 422: {
346
+ headers: {
347
+ [name: string]: unknown;
348
+ };
349
+ content: {
350
+ "application/json": components["schemas"]["HTTPValidationError"];
351
+ };
352
+ };
353
+ };
354
+ };
355
+ create_comment_comment_post: {
356
+ parameters: {
357
+ query: {
358
+ lecturer_id: number;
359
+ };
360
+ header?: never;
361
+ path?: never;
362
+ cookie?: never;
363
+ };
364
+ requestBody: {
365
+ content: {
366
+ "application/json": components["schemas"]["CommentPost"];
367
+ };
368
+ };
369
+ responses: {
370
+ /** @description Successful Response */
371
+ 200: {
372
+ headers: {
373
+ [name: string]: unknown;
374
+ };
375
+ content: {
376
+ "application/json": components["schemas"]["CommentGet"];
377
+ };
378
+ };
379
+ /** @description Validation Error */
380
+ 422: {
381
+ headers: {
382
+ [name: string]: unknown;
383
+ };
384
+ content: {
385
+ "application/json": components["schemas"]["HTTPValidationError"];
386
+ };
387
+ };
388
+ };
389
+ };
390
+ get_comment_comment__uuid__get: {
391
+ parameters: {
392
+ query?: never;
393
+ header?: never;
394
+ path: {
395
+ uuid: string;
396
+ };
397
+ cookie?: never;
398
+ };
399
+ requestBody?: never;
400
+ responses: {
401
+ /** @description Successful Response */
402
+ 200: {
403
+ headers: {
404
+ [name: string]: unknown;
405
+ };
406
+ content: {
407
+ "application/json": components["schemas"]["CommentGet"];
408
+ };
409
+ };
410
+ /** @description Validation Error */
411
+ 422: {
412
+ headers: {
413
+ [name: string]: unknown;
414
+ };
415
+ content: {
416
+ "application/json": components["schemas"]["HTTPValidationError"];
417
+ };
418
+ };
419
+ };
420
+ };
421
+ delete_comment_comment__uuid__delete: {
422
+ parameters: {
423
+ query?: never;
424
+ header?: never;
425
+ path: {
426
+ uuid: string;
427
+ };
428
+ cookie?: never;
429
+ };
430
+ requestBody?: never;
431
+ responses: {
432
+ /** @description Successful Response */
433
+ 200: {
434
+ headers: {
435
+ [name: string]: unknown;
436
+ };
437
+ content: {
438
+ "application/json": components["schemas"]["StatusResponseModel"];
439
+ };
440
+ };
441
+ /** @description Validation Error */
442
+ 422: {
443
+ headers: {
444
+ [name: string]: unknown;
445
+ };
446
+ content: {
447
+ "application/json": components["schemas"]["HTTPValidationError"];
448
+ };
449
+ };
450
+ };
451
+ };
452
+ review_comment_comment__uuid__patch: {
453
+ parameters: {
454
+ query?: {
455
+ review_status?: "approved" | "dismissed";
456
+ };
457
+ header?: never;
458
+ path: {
459
+ uuid: string;
460
+ };
461
+ cookie?: never;
462
+ };
463
+ requestBody?: never;
464
+ responses: {
465
+ /** @description Successful Response */
466
+ 200: {
467
+ headers: {
468
+ [name: string]: unknown;
469
+ };
470
+ content: {
471
+ "application/json": components["schemas"]["CommentGet"];
472
+ };
473
+ };
474
+ /** @description Validation Error */
475
+ 422: {
476
+ headers: {
477
+ [name: string]: unknown;
478
+ };
479
+ content: {
480
+ "application/json": components["schemas"]["HTTPValidationError"];
481
+ };
482
+ };
483
+ };
484
+ };
485
+ get_lecturers_lecturer_get: {
486
+ parameters: {
487
+ query?: {
488
+ info?: ("comments" | "mark")[];
489
+ limit?: number;
490
+ offset?: number;
491
+ order_by?: ("general" | "")[];
492
+ subject?: string;
493
+ };
494
+ header?: never;
495
+ path?: never;
496
+ cookie?: never;
497
+ };
498
+ requestBody?: never;
499
+ responses: {
500
+ /** @description Successful Response */
501
+ 200: {
502
+ headers: {
503
+ [name: string]: unknown;
504
+ };
505
+ content: {
506
+ "application/json": components["schemas"]["LecturerGetAll"];
507
+ };
508
+ };
509
+ /** @description Validation Error */
510
+ 422: {
511
+ headers: {
512
+ [name: string]: unknown;
513
+ };
514
+ content: {
515
+ "application/json": components["schemas"]["HTTPValidationError"];
516
+ };
517
+ };
518
+ };
519
+ };
520
+ create_lecturer_lecturer_post: {
521
+ parameters: {
522
+ query?: never;
523
+ header?: never;
524
+ path?: never;
525
+ cookie?: never;
526
+ };
527
+ requestBody: {
528
+ content: {
529
+ "application/json": components["schemas"]["LecturerPost"];
530
+ };
531
+ };
532
+ responses: {
533
+ /** @description Successful Response */
534
+ 200: {
535
+ headers: {
536
+ [name: string]: unknown;
537
+ };
538
+ content: {
539
+ "application/json": components["schemas"]["LecturerGet"];
540
+ };
541
+ };
542
+ /** @description Validation Error */
543
+ 422: {
544
+ headers: {
545
+ [name: string]: unknown;
546
+ };
547
+ content: {
548
+ "application/json": components["schemas"]["HTTPValidationError"];
549
+ };
550
+ };
551
+ };
552
+ };
553
+ get_lecturer_lecturer__id__get: {
554
+ parameters: {
555
+ query?: {
556
+ info?: ("comments" | "mark")[];
557
+ };
558
+ header?: never;
559
+ path: {
560
+ id: number;
561
+ };
562
+ cookie?: never;
563
+ };
564
+ requestBody?: never;
565
+ responses: {
566
+ /** @description Successful Response */
567
+ 200: {
568
+ headers: {
569
+ [name: string]: unknown;
570
+ };
571
+ content: {
572
+ "application/json": components["schemas"]["LecturerGet"];
573
+ };
574
+ };
575
+ /** @description Validation Error */
576
+ 422: {
577
+ headers: {
578
+ [name: string]: unknown;
579
+ };
580
+ content: {
581
+ "application/json": components["schemas"]["HTTPValidationError"];
582
+ };
583
+ };
584
+ };
585
+ };
586
+ delete_lecturer_lecturer__id__delete: {
587
+ parameters: {
588
+ query?: never;
589
+ header?: never;
590
+ path: {
591
+ id: number;
592
+ };
593
+ cookie?: never;
594
+ };
595
+ requestBody?: never;
596
+ responses: {
597
+ /** @description Successful Response */
598
+ 200: {
599
+ headers: {
600
+ [name: string]: unknown;
601
+ };
602
+ content: {
603
+ "application/json": components["schemas"]["StatusResponseModel"];
604
+ };
605
+ };
606
+ /** @description Validation Error */
607
+ 422: {
608
+ headers: {
609
+ [name: string]: unknown;
610
+ };
611
+ content: {
612
+ "application/json": components["schemas"]["HTTPValidationError"];
613
+ };
614
+ };
615
+ };
616
+ };
617
+ update_lecturer_lecturer__id__patch: {
618
+ parameters: {
619
+ query?: never;
620
+ header?: never;
621
+ path: {
622
+ id: number;
623
+ };
624
+ cookie?: never;
625
+ };
626
+ requestBody: {
627
+ content: {
628
+ "application/json": components["schemas"]["LecturerPatch"];
629
+ };
630
+ };
631
+ responses: {
632
+ /** @description Successful Response */
633
+ 200: {
634
+ headers: {
635
+ [name: string]: unknown;
636
+ };
637
+ content: {
638
+ "application/json": components["schemas"]["LecturerGet"];
639
+ };
640
+ };
641
+ /** @description Validation Error */
642
+ 422: {
643
+ headers: {
644
+ [name: string]: unknown;
645
+ };
646
+ content: {
647
+ "application/json": components["schemas"]["HTTPValidationError"];
648
+ };
649
+ };
650
+ };
651
+ };
652
+ }
@@ -163,6 +163,12 @@ export interface components {
163
163
  * @description Иконка кнопки
164
164
  */
165
165
  icon: string;
166
+ /**
167
+ * Is Hidden
168
+ * @description Спрятана ли кнопка от пользователя
169
+ * @default false
170
+ */
171
+ is_hidden: boolean;
166
172
  /**
167
173
  * Link
168
174
  * @description Ссылка, на которую перенаправляет кнопка
@@ -175,12 +181,12 @@ export interface components {
175
181
  name: string;
176
182
  /**
177
183
  * Optional Scopes
178
- * @description Каким скоупы желательны
184
+ * @description Какиеп скоупы желательны
179
185
  */
180
186
  optional_scopes?: string[] | null;
181
187
  /**
182
188
  * Required Scopes
183
- * @description Каким скоупы нужны, чтобы кнопка была доступна
189
+ * @description Какие скоупы нужны, чтобы кнопка была доступна
184
190
  */
185
191
  required_scopes?: string[] | null;
186
192
  /** @description Тип открываемой ссылки (Ссылка приложения/Браузер в приложении/Браузер */
@@ -244,6 +250,11 @@ export interface components {
244
250
  * @description Иконка кнопки
245
251
  */
246
252
  icon?: string | null;
253
+ /**
254
+ * Is Hidden
255
+ * @description Спрятана ли кнопка от пользователя
256
+ */
257
+ is_hidden?: boolean | null;
247
258
  /**
248
259
  * Link
249
260
  * @description Ссылка, на которую перенаправляет кнопка
@@ -256,7 +267,7 @@ export interface components {
256
267
  name?: string | null;
257
268
  /**
258
269
  * Optional Scopes
259
- * @description Каким скоупы желательны
270
+ * @description Какие скоупы желательны
260
271
  */
261
272
  optional_scopes?: string[] | null;
262
273
  /**
@@ -266,7 +277,7 @@ export interface components {
266
277
  order?: number | null;
267
278
  /**
268
279
  * Required Scopes
269
- * @description Каким скоупы нужны, чтобы кнопка была доступна
280
+ * @description Какие скоупы нужны, чтобы кнопка была доступна
270
281
  */
271
282
  required_scopes?: string[] | null;
272
283
  /** @description Тип открываемой ссылки (Ссылка приложения/Браузер в приложении/Браузер */
@@ -276,7 +287,7 @@ export interface components {
276
287
  * ButtonView
277
288
  * @enum {string}
278
289
  */
279
- ButtonView: "active" | "blocked";
290
+ ButtonView: "active" | "blocked" | "hidden";
280
291
  /** CategoryCreate */
281
292
  CategoryCreate: {
282
293
  /**
@@ -211,11 +211,9 @@ export interface paths {
211
211
  path?: never;
212
212
  cookie?: never;
213
213
  };
214
- /** Get All Lecturer Comments */
215
- get: operations["get_all_lecturer_comments_lecturer__lecturer_id__comment__get"];
214
+ get?: never;
216
215
  put?: never;
217
- /** Comment Lecturer */
218
- post: operations["comment_lecturer_lecturer__lecturer_id__comment__post"];
216
+ post?: never;
219
217
  delete?: never;
220
218
  options?: never;
221
219
  head?: never;
@@ -229,16 +227,13 @@ export interface paths {
229
227
  path?: never;
230
228
  cookie?: never;
231
229
  };
232
- /** Get Comment */
233
- get: operations["get_comment_lecturer__lecturer_id__comment__id__get"];
230
+ get?: never;
234
231
  put?: never;
235
232
  post?: never;
236
- /** Delete Comment */
237
- delete: operations["delete_comment_lecturer__lecturer_id__comment__id__delete"];
233
+ delete?: never;
238
234
  options?: never;
239
235
  head?: never;
240
- /** Update Comment Lecturer */
241
- patch: operations["update_comment_lecturer_lecturer__lecturer_id__comment__id__patch"];
236
+ patch?: never;
242
237
  trace?: never;
243
238
  };
244
239
  "/timetable/lecturer/{lecturer_id}/comment/{id}/review/": {
@@ -250,8 +245,7 @@ export interface paths {
250
245
  };
251
246
  get?: never;
252
247
  put?: never;
253
- /** Review Comment */
254
- post: operations["review_comment_lecturer__lecturer_id__comment__id__review__post"];
248
+ post?: never;
255
249
  delete?: never;
256
250
  options?: never;
257
251
  head?: never;
@@ -265,8 +259,7 @@ export interface paths {
265
259
  path?: never;
266
260
  cookie?: never;
267
261
  };
268
- /** Get Unreviewed Comments */
269
- get: operations["get_unreviewed_comments_lecturer__lecturer_id__comment_review__get"];
262
+ get?: never;
270
263
  put?: never;
271
264
  post?: never;
272
265
  delete?: never;
@@ -1587,240 +1580,6 @@ export interface operations {
1587
1580
  };
1588
1581
  };
1589
1582
  };
1590
- get_all_lecturer_comments_lecturer__lecturer_id__comment__get: {
1591
- parameters: {
1592
- query?: {
1593
- limit?: number;
1594
- offset?: number;
1595
- };
1596
- header?: never;
1597
- path: {
1598
- lecturer_id: number;
1599
- };
1600
- cookie?: never;
1601
- };
1602
- requestBody?: never;
1603
- responses: {
1604
- /** @description Successful Response */
1605
- 200: {
1606
- headers: {
1607
- [name: string]: unknown;
1608
- };
1609
- content: {
1610
- "application/json": components["schemas"]["LecturerComments"];
1611
- };
1612
- };
1613
- /** @description Validation Error */
1614
- 422: {
1615
- headers: {
1616
- [name: string]: unknown;
1617
- };
1618
- content: {
1619
- "application/json": components["schemas"]["HTTPValidationError"];
1620
- };
1621
- };
1622
- };
1623
- };
1624
- comment_lecturer_lecturer__lecturer_id__comment__post: {
1625
- parameters: {
1626
- query?: never;
1627
- header?: never;
1628
- path: {
1629
- lecturer_id: number;
1630
- };
1631
- cookie?: never;
1632
- };
1633
- requestBody: {
1634
- content: {
1635
- "application/json": components["schemas"]["LecturerCommentPost"];
1636
- };
1637
- };
1638
- responses: {
1639
- /** @description Successful Response */
1640
- 200: {
1641
- headers: {
1642
- [name: string]: unknown;
1643
- };
1644
- content: {
1645
- "application/json": components["schemas"]["CommentLecturer"];
1646
- };
1647
- };
1648
- /** @description Validation Error */
1649
- 422: {
1650
- headers: {
1651
- [name: string]: unknown;
1652
- };
1653
- content: {
1654
- "application/json": components["schemas"]["HTTPValidationError"];
1655
- };
1656
- };
1657
- };
1658
- };
1659
- get_comment_lecturer__lecturer_id__comment__id__get: {
1660
- parameters: {
1661
- query?: never;
1662
- header?: never;
1663
- path: {
1664
- id: number;
1665
- lecturer_id: number;
1666
- };
1667
- cookie?: never;
1668
- };
1669
- requestBody?: never;
1670
- responses: {
1671
- /** @description Successful Response */
1672
- 200: {
1673
- headers: {
1674
- [name: string]: unknown;
1675
- };
1676
- content: {
1677
- "application/json": components["schemas"]["CommentLecturer"];
1678
- };
1679
- };
1680
- /** @description Validation Error */
1681
- 422: {
1682
- headers: {
1683
- [name: string]: unknown;
1684
- };
1685
- content: {
1686
- "application/json": components["schemas"]["HTTPValidationError"];
1687
- };
1688
- };
1689
- };
1690
- };
1691
- delete_comment_lecturer__lecturer_id__comment__id__delete: {
1692
- parameters: {
1693
- query?: never;
1694
- header?: never;
1695
- path: {
1696
- id: number;
1697
- lecturer_id: number;
1698
- };
1699
- cookie?: never;
1700
- };
1701
- requestBody?: never;
1702
- responses: {
1703
- /** @description Successful Response */
1704
- 200: {
1705
- headers: {
1706
- [name: string]: unknown;
1707
- };
1708
- content: {
1709
- "application/json": unknown;
1710
- };
1711
- };
1712
- /** @description Validation Error */
1713
- 422: {
1714
- headers: {
1715
- [name: string]: unknown;
1716
- };
1717
- content: {
1718
- "application/json": components["schemas"]["HTTPValidationError"];
1719
- };
1720
- };
1721
- };
1722
- };
1723
- update_comment_lecturer_lecturer__lecturer_id__comment__id__patch: {
1724
- parameters: {
1725
- query?: never;
1726
- header?: never;
1727
- path: {
1728
- id: number;
1729
- lecturer_id: number;
1730
- };
1731
- cookie?: never;
1732
- };
1733
- requestBody: {
1734
- content: {
1735
- "application/json": components["schemas"]["LecturerCommentPatch"];
1736
- };
1737
- };
1738
- responses: {
1739
- /** @description Successful Response */
1740
- 200: {
1741
- headers: {
1742
- [name: string]: unknown;
1743
- };
1744
- content: {
1745
- "application/json": components["schemas"]["CommentLecturer"];
1746
- };
1747
- };
1748
- /** @description Validation Error */
1749
- 422: {
1750
- headers: {
1751
- [name: string]: unknown;
1752
- };
1753
- content: {
1754
- "application/json": components["schemas"]["HTTPValidationError"];
1755
- };
1756
- };
1757
- };
1758
- };
1759
- review_comment_lecturer__lecturer_id__comment__id__review__post: {
1760
- parameters: {
1761
- query?: {
1762
- action?: "Approved" | "Declined";
1763
- };
1764
- header?: never;
1765
- path: {
1766
- id: number;
1767
- lecturer_id: number;
1768
- };
1769
- cookie?: never;
1770
- };
1771
- requestBody?: never;
1772
- responses: {
1773
- /** @description Successful Response */
1774
- 200: {
1775
- headers: {
1776
- [name: string]: unknown;
1777
- };
1778
- content: {
1779
- "application/json": components["schemas"]["CommentLecturer"];
1780
- };
1781
- };
1782
- /** @description Validation Error */
1783
- 422: {
1784
- headers: {
1785
- [name: string]: unknown;
1786
- };
1787
- content: {
1788
- "application/json": components["schemas"]["HTTPValidationError"];
1789
- };
1790
- };
1791
- };
1792
- };
1793
- get_unreviewed_comments_lecturer__lecturer_id__comment_review__get: {
1794
- parameters: {
1795
- query?: never;
1796
- header?: never;
1797
- path: {
1798
- lecturer_id: number;
1799
- };
1800
- cookie?: never;
1801
- };
1802
- requestBody?: never;
1803
- responses: {
1804
- /** @description Successful Response */
1805
- 200: {
1806
- headers: {
1807
- [name: string]: unknown;
1808
- };
1809
- content: {
1810
- "application/json": components["schemas"]["CommentLecturer"][];
1811
- };
1812
- };
1813
- /** @description Validation Error */
1814
- 422: {
1815
- headers: {
1816
- [name: string]: unknown;
1817
- };
1818
- content: {
1819
- "application/json": components["schemas"]["HTTPValidationError"];
1820
- };
1821
- };
1822
- };
1823
- };
1824
1583
  get_lecturer_photos_lecturer__lecturer_id__photo_get: {
1825
1584
  parameters: {
1826
1585
  query?: {
package/redocly.yaml DELETED
@@ -1,44 +0,0 @@
1
- resolve:
2
- http:
3
- headers:
4
- - matches: https://api.profcomff.com/**
5
- name: Authorization
6
- envVariable: SECRET_KEY
7
-
8
- apis:
9
- auth@latest:
10
- root: https://api.profcomff.com/auth/openapi.json
11
- x-openapi-ts:
12
- output: ./src/openapi/auth.ts
13
- marketing@latest:
14
- root: https://api.profcomff.com/marketing/openapi.json
15
- x-openapi-ts:
16
- output: ./src/openapi/marketing.ts
17
- timetable@latest:
18
- root: https://api.profcomff.com/timetable/openapi.json
19
- x-openapi-ts:
20
- output: ./src/openapi/timetable.ts
21
- services@latest:
22
- root: https://api.profcomff.com/services/openapi.json
23
- x-openapi-ts:
24
- output: ./src/openapi/services.ts
25
- print@latest:
26
- root: https://api.profcomff.com/print/openapi.json
27
- x-openapi-ts:
28
- output: ./src/openapi/print.ts
29
- social@latest:
30
- root: https://api.profcomff.com/social/openapi.json
31
- x-openapi-ts:
32
- output: ./src/openapi/social.ts
33
- userdata@latest:
34
- root: https://api.profcomff.com/userdata/openapi.json
35
- x-openapi-ts:
36
- output: ./src/openapi/userdata.ts
37
- achievement@latest:
38
- root: https://api.profcomff.com/achievement/openapi.json
39
- x-openapi-ts:
40
- output: ./src/openapi/achievement.ts
41
- pinger@latest:
42
- root: https://pinger.profcomff.com/openapi.json
43
- x-openapi-ts:
44
- output: ./src/openapi/pinger.ts