@profcomff/api-uilib 2024.9.29 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profcomff/api-uilib",
3
- "version": "2024.09.29",
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;
@@ -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
+ }
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