chuvsu-js 5.5.2 → 5.5.4

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 (58) hide show
  1. package/README.md +6 -9
  2. package/dist/common/http.js +2 -4
  3. package/dist/common/lesson-type.js +6 -1
  4. package/dist/common/parse.js +3 -1
  5. package/dist/core.d.ts +2 -1
  6. package/dist/core.js +2 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/lk/client.js +10 -4
  9. package/dist/lk/parse/grade-value.js +5 -1
  10. package/dist/lk/parse/portfolio-content.js +58 -16
  11. package/dist/lk/parse/portfolio-grades.js +37 -9
  12. package/dist/lk/parse/portfolio-performance.js +26 -8
  13. package/dist/lk/parse/portfolio.js +31 -13
  14. package/dist/lk/parse/webinar-lesson.js +4 -2
  15. package/dist/lk/parse/webinars.js +7 -3
  16. package/dist/lk/webinars.js +3 -1
  17. package/dist/tt/client.js +15 -7
  18. package/dist/tt/domain/directory.js +2 -4
  19. package/dist/tt/domain/index.d.ts +2 -2
  20. package/dist/tt/domain/index.js +2 -2
  21. package/dist/tt/domain/repository.js +67 -35
  22. package/dist/tt/domain/schedule-snapshot.js +51 -24
  23. package/dist/tt/domain/schedule.js +7 -3
  24. package/dist/tt/observations.js +7 -2
  25. package/dist/tt/parse/audience.js +3 -1
  26. package/dist/tt/parse/entry-parts.js +2 -3
  27. package/dist/tt/parse/full-schedule.js +1 -1
  28. package/dist/tt/parse/groups.js +1 -3
  29. package/dist/tt/parse/index.d.ts +2 -2
  30. package/dist/tt/parse/index.js +2 -2
  31. package/dist/tt/parse/lists.js +3 -3
  32. package/dist/tt/parse/overlays.js +7 -2
  33. package/dist/tt/utils/date.js +2 -2
  34. package/dist/tt/utils/period.js +2 -1
  35. package/dist/tt/utils/semester.js +2 -2
  36. package/dist/tt/utils/time-slots.js +81 -15
  37. package/dist/webinar/chat-subscription.js +2 -1
  38. package/dist/webinar/client.d.ts +11 -0
  39. package/dist/webinar/client.js +136 -33
  40. package/dist/webinar/ddp.js +40 -13
  41. package/dist/webinar/events.js +7 -2
  42. package/dist/webinar/gateway.js +57 -16
  43. package/dist/webinar/media-protocol.d.ts +2 -1
  44. package/dist/webinar/media-protocol.js +30 -5
  45. package/dist/webinar/media.js +10 -4
  46. package/dist/webinar/parse.js +62 -14
  47. package/dist/webinar/playback.d.ts +3 -0
  48. package/dist/webinar/playback.js +67 -15
  49. package/dist/webinar/socket.js +4 -1
  50. package/dist/webinar/state.js +73 -26
  51. package/dist/webinar/types.d.ts +14 -0
  52. package/dist/webinar/typing.d.ts +8 -0
  53. package/dist/webinar/typing.js +36 -0
  54. package/docs/fixture-review.md +44 -44
  55. package/docs/student-portal.md +11 -2
  56. package/docs/v5-migration.md +85 -88
  57. package/docs/webinar.md +19 -2
  58. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { parseHtml, text } from "../common/parse.js";
2
2
  import { record, safeWebinarUrl, string } from "./parse.js";
3
+ import { webinarTypingUsers } from "./typing.js";
3
4
  export function normalizeWebinarMessage(doc, users) {
4
5
  const senderId = string(doc.sender) || string(record(doc.sender).id);
5
6
  const sender = users.find((user) => user.userId === senderId);
@@ -38,10 +39,14 @@ export function buildWebinarSnapshot(ddp, session, history) {
38
39
  thumbnailUrl: safeWebinarUrl(doc.thumbUri, origin),
39
40
  textUrl: safeWebinarUrl(doc.txtUri, origin),
40
41
  text: string(doc.content),
41
- viewport: position ? {
42
- x: Number(position.x) || 0, y: Number(position.y) || 0,
43
- width: Number(position.viewBoxWidth) || 0, height: Number(position.viewBoxHeight) || 0,
44
- } : null,
42
+ viewport: position
43
+ ? {
44
+ x: Number(position.x) || 0,
45
+ y: Number(position.y) || 0,
46
+ width: Number(position.viewBoxWidth) || 0,
47
+ height: Number(position.viewBoxHeight) || 0,
48
+ }
49
+ : null,
45
50
  };
46
51
  };
47
52
  const notes = documents("note")[0];
@@ -51,48 +56,90 @@ export function buildWebinarSnapshot(ddp, session, history) {
51
56
  return `${session.notesUrl.replace(/\/$/u, "")}/p/${encodeURIComponent(string(id))}`;
52
57
  };
53
58
  return {
54
- users: users.filter((user) => user.loggedOut !== true).map((user) => {
59
+ users: users
60
+ .filter((user) => user.loggedOut !== true)
61
+ .map((user) => {
55
62
  const voice = voices.find((v) => v.intId === user.userId && v.joined === true);
56
63
  return {
57
- id: string(user.userId), name: string(user.name), role: string(user.role),
58
- presenter: user.presenter === true, moderator: user.role === "MODERATOR",
59
- locked: user.locked === true, raisedHand: user.emoji === "raiseHand",
64
+ id: string(user.userId),
65
+ name: string(user.name),
66
+ role: string(user.role),
67
+ presenter: user.presenter === true,
68
+ moderator: user.role === "MODERATOR",
69
+ locked: user.locked === true,
70
+ raisedHand: user.emoji === "raiseHand",
60
71
  emoji: string(user.emoji) || "none",
61
- audio: { joined: !!voice, listenOnly: voice?.listenOnly === true, muted: voice?.muted === true, speaking: voice?.talking === true },
72
+ audio: {
73
+ joined: !!voice,
74
+ listenOnly: voice?.listenOnly === true,
75
+ muted: voice?.muted === true,
76
+ speaking: voice?.talking === true,
77
+ },
62
78
  };
63
- }).sort((a, b) => a.name.localeCompare(b.name, "ru") || a.id.localeCompare(b.id)),
79
+ })
80
+ .sort((a, b) => a.name.localeCompare(b.name, "ru") || a.id.localeCompare(b.id)),
81
+ typingUsers: webinarTypingUsers(documents("users-typing"), users, documents("group-chat"), session, meeting),
64
82
  chats: documents("group-chat").map((chat) => ({
65
- id: string(chat.chatId), name: string(chat.name), private: chat.access === "PRIVATE_ACCESS",
66
- userIds: Array.isArray(chat.users) ? chat.users.filter((id) => typeof id === "string") : [],
83
+ id: string(chat.chatId),
84
+ name: string(chat.name),
85
+ private: chat.access === "PRIVATE_ACCESS",
86
+ userIds: Array.isArray(chat.users)
87
+ ? chat.users.filter((id) => typeof id === "string")
88
+ : [],
67
89
  })),
68
- messages: [...messages.values()].map((doc) => normalizeWebinarMessage(doc, [...users, ...persistent]))
90
+ messages: [...messages.values()]
91
+ .map((doc) => normalizeWebinarMessage(doc, [...users, ...persistent]))
69
92
  .sort((a, b) => a.timestamp - b.timestamp || a.id.localeCompare(b.id)),
70
93
  presentations: presentations.map((presentation) => {
71
94
  const id = string(presentation.id);
72
95
  const published = slides.filter((slide) => slide.presentationId === id);
73
- const pages = published.length ? published : Array.isArray(presentation.pages) ? presentation.pages.map(record) : [];
96
+ const pages = published.length
97
+ ? published
98
+ : Array.isArray(presentation.pages)
99
+ ? presentation.pages.map(record)
100
+ : [];
74
101
  return {
75
- id, name: string(presentation.name), current: presentation.current === true,
76
- downloadable: presentation.downloadable === true && session.features.presentationDownload,
77
- slides: pages.map((slide) => normalizeSlide(slide, id)).sort((a, b) => a.number - b.number),
102
+ id,
103
+ name: string(presentation.name),
104
+ current: presentation.current === true,
105
+ downloadable: presentation.downloadable === true &&
106
+ session.features.presentationDownload,
107
+ slides: pages
108
+ .map((slide) => normalizeSlide(slide, id))
109
+ .sort((a, b) => a.number - b.number),
78
110
  };
79
111
  }),
80
112
  streams: [
81
- ...documents("video-streams").filter((stream) => {
82
- if (self?.role === "MODERATOR" || record(meeting?.usersProp).webcamsOnlyForModerator !== true)
113
+ ...documents("video-streams")
114
+ .filter((stream) => {
115
+ if (self?.role === "MODERATOR" ||
116
+ record(meeting?.usersProp).webcamsOnlyForModerator !== true)
83
117
  return true;
84
- return stream.userId === session.user.id || users.some((user) => user.userId === stream.userId && user.role === "MODERATOR");
85
- }).map((stream) => ({
86
- id: string(stream.stream), kind: "camera", userId: string(stream.userId) || null, hasAudio: false,
118
+ return (stream.userId === session.user.id ||
119
+ users.some((user) => user.userId === stream.userId && user.role === "MODERATOR"));
120
+ })
121
+ .map((stream) => ({
122
+ id: string(stream.stream),
123
+ kind: "camera",
124
+ userId: string(stream.userId) || null,
125
+ hasAudio: false,
87
126
  })),
88
- ...documents("screenshare").filter((stream) => stream.screenshare !== false).map((stream) => ({
127
+ ...documents("screenshare")
128
+ .filter((stream) => stream.screenshare !== false)
129
+ .map((stream) => ({
89
130
  id: string(record(stream.screenshare).streamId) || string(stream._id),
90
- kind: "screen", userId: string(record(stream.screenshare).userId) || null,
131
+ kind: "screen",
132
+ userId: string(record(stream.screenshare).userId) || null,
91
133
  hasAudio: record(stream.screenshare).hasAudio === true,
92
134
  })),
93
135
  ],
94
- notes: notes ? { revision: typeof notes.revs === "number" ? notes.revs : 0,
95
- readUrl: noteUrl(notes.readOnlyId), editUrl: noteUrl(notes.padId) } : null,
136
+ notes: notes
137
+ ? {
138
+ revision: typeof notes.revs === "number" ? notes.revs : 0,
139
+ readUrl: noteUrl(notes.readOnlyId),
140
+ editUrl: noteUrl(notes.padId),
141
+ }
142
+ : null,
96
143
  ended: meeting?.meetingEnded === true,
97
144
  };
98
145
  }
@@ -25,8 +25,16 @@ export interface WebinarSession {
25
25
  media: string;
26
26
  };
27
27
  iceServers: RTCIceServer[];
28
+ mediaSettings?: {
29
+ listenOnlyOffering: boolean;
30
+ /** Server-advertised adapter for receive-only audio, independent of SFU protocol. */
31
+ listenOnlyMediaServer?: string;
32
+ forceRelay: boolean;
33
+ forceRelayOnFirefox: boolean;
34
+ };
28
35
  features: {
29
36
  chat: boolean;
37
+ typing?: boolean;
30
38
  notes: boolean;
31
39
  audio: boolean;
32
40
  video: boolean;
@@ -36,6 +44,7 @@ export interface WebinarSession {
36
44
  };
37
45
  notesUrl: string | null;
38
46
  publicChatId: string;
47
+ publicTypingId?: string;
39
48
  chatPageSize: number;
40
49
  maxMessageLength: number;
41
50
  }
@@ -108,6 +117,11 @@ export interface WebinarSnapshot {
108
117
  users: WebinarUser[];
109
118
  chats: WebinarChat[];
110
119
  messages: WebinarMessage[];
120
+ typingUsers?: {
121
+ userId: string;
122
+ name: string;
123
+ chatId: string;
124
+ }[];
111
125
  presentations: WebinarPresentation[];
112
126
  streams: WebinarMediaStream[];
113
127
  notes: WebinarNotes | null;
@@ -0,0 +1,8 @@
1
+ import type { WebinarDocument } from "./ddp.js";
2
+ import type { WebinarSession } from "./types.js";
3
+ /** Only this participant's accessible conversations and visible users are projected. */
4
+ export declare function webinarTypingUsers(documents: WebinarDocument[], users: WebinarDocument[], chats: WebinarDocument[], session: WebinarSession, meeting: WebinarDocument | undefined): {
5
+ userId: string;
6
+ name: string;
7
+ chatId: string;
8
+ }[];
@@ -0,0 +1,36 @@
1
+ import { record, string } from "./parse.js";
2
+ /** Only this participant's accessible conversations and visible users are projected. */
3
+ export function webinarTypingUsers(documents, users, chats, session, meeting) {
4
+ if (!session.features.typing)
5
+ return [];
6
+ const self = users.find((user) => user.userId === session.user.id);
7
+ const hideViewers = self?.role !== "MODERATOR" &&
8
+ record(meeting?.lockSettingsProps).hideUserList === true;
9
+ const result = new Map();
10
+ for (const doc of documents) {
11
+ const userId = string(doc.userId);
12
+ if (!userId ||
13
+ userId === session.user.id ||
14
+ doc.meetingId !== session.meeting.id)
15
+ continue;
16
+ const user = users.find((user) => user.userId === userId && user.loggedOut !== true);
17
+ if (!user || (hideViewers && user.role !== "MODERATOR"))
18
+ continue;
19
+ const target = string(doc.isTypingTo);
20
+ const chatId = target === (session.publicTypingId ?? session.publicChatId)
21
+ ? session.publicChatId
22
+ : target === session.user.id
23
+ ? string(chats.find((chat) => chat.access === "PRIVATE_ACCESS" &&
24
+ Array.isArray(chat.users) &&
25
+ chat.users.includes(session.user.id) &&
26
+ chat.users.includes(userId))?.chatId)
27
+ : "";
28
+ if (chatId)
29
+ result.set(`${userId}/${chatId}`, {
30
+ userId,
31
+ name: string(user.name) || string(doc.name),
32
+ chatId,
33
+ });
34
+ }
35
+ return [...result.values()].sort((a, b) => a.name.localeCompare(b.name, "ru"));
36
+ }
@@ -8,49 +8,49 @@
8
8
  группы, подгруппа, ДОТ, замены и переносы. Генератор expected-файлов и отдельный
9
9
  DOM-аудитор не использовались.
10
10
 
11
- | Эталон | Занятий | Результат |
12
- |---|---:|---|
13
- | group-10042-period-1.json | 38 | проверен |
14
- | group-10209-period-1.json | 22 | проверен |
15
- | group-10307-period-1.json | 31 | проверен |
16
- | group-10383-period-1.json | 27 | проверен |
17
- | group-10403-period-1.json | 5 | проверен |
18
- | group-10428-period-1.json | 30 | проверен |
19
- | group-10443-period-1.json | 19 | проверен |
20
- | group-10462-period-1.json | 26 | проверен |
21
- | group-10468-period-1.json | 20 | проверен |
22
- | group-10481-period-1.json | 4 | проверен |
23
- | group-10483-period-1.json | 4 | проверен |
24
- | group-10488-period-1.json | 4 | проверен |
25
- | group-7698-period-1.json | 21 | проверен |
26
- | group-8035-period-1.json | 9 | проверен |
27
- | group-8107-period-1.json | 21 | проверен |
28
- | group-8203-period-1.json | 26 | проверен |
29
- | group-8219-period-1.json | 22 | проверен |
30
- | group-8231-period-1.json | 49 | проверен |
31
- | group-8499-period-1.json | 28 | проверен |
32
- | group-8827-period-1.json | 65 | проверен, исправлено `к.иск.` |
33
- | group-8844-period-1.json | 25 | проверен |
34
- | group-8912-period-1.json | 42 | проверен |
35
- | group-8917-period-1.json | 43 | проверен |
36
- | group-8919-period-1.json | 59 | проверен |
37
- | group-9075-period-1.json | 40 | проверен |
38
- | group-9332-period-1.json | 24 | проверен |
39
- | group-9347-period-1.json | 22 | проверен |
40
- | group-9438-period-1.json | 19 | проверен |
41
- | group-9491-period-1.json | 16 | проверен |
42
- | group-9520-period-1.json | 26 | проверен |
43
- | group-9588-period-1.json | 8 | проверен |
44
- | group-9698-period-1.json | 37 | проверен, включая перенос |
45
- | group-9719-period-1.json | 44 | проверен |
46
- | group-9843-period-1.json | 24 | проверен |
47
- | teacher-1317-period-1.json | 7 | проверен, восстановлена ученая степень |
48
- | teacher-1907-period-1.json | 8 | проверен |
49
- | teacher-2317-period-1.json | 10 | проверен |
50
- | teacher-543-period-1.json | 39 | проверен, восстановлена ученая степень |
51
- | room-1438-period-1.json | 75 | проверен |
52
- | room-803-period-1.json | 48 | проверен, включая два переноса |
53
- | room-811-period-1.json | 54 | проверен |
54
- | room-814-period-1.json | 43 | проверен, исправлено ложное ДОТ у Федотовой |
11
+ | Эталон | Занятий | Результат |
12
+ | -------------------------- | ------: | ------------------------------------------- |
13
+ | group-10042-period-1.json | 38 | проверен |
14
+ | group-10209-period-1.json | 22 | проверен |
15
+ | group-10307-period-1.json | 31 | проверен |
16
+ | group-10383-period-1.json | 27 | проверен |
17
+ | group-10403-period-1.json | 5 | проверен |
18
+ | group-10428-period-1.json | 30 | проверен |
19
+ | group-10443-period-1.json | 19 | проверен |
20
+ | group-10462-period-1.json | 26 | проверен |
21
+ | group-10468-period-1.json | 20 | проверен |
22
+ | group-10481-period-1.json | 4 | проверен |
23
+ | group-10483-period-1.json | 4 | проверен |
24
+ | group-10488-period-1.json | 4 | проверен |
25
+ | group-7698-period-1.json | 21 | проверен |
26
+ | group-8035-period-1.json | 9 | проверен |
27
+ | group-8107-period-1.json | 21 | проверен |
28
+ | group-8203-period-1.json | 26 | проверен |
29
+ | group-8219-period-1.json | 22 | проверен |
30
+ | group-8231-period-1.json | 49 | проверен |
31
+ | group-8499-period-1.json | 28 | проверен |
32
+ | group-8827-period-1.json | 65 | проверен, исправлено `к.иск.` |
33
+ | group-8844-period-1.json | 25 | проверен |
34
+ | group-8912-period-1.json | 42 | проверен |
35
+ | group-8917-period-1.json | 43 | проверен |
36
+ | group-8919-period-1.json | 59 | проверен |
37
+ | group-9075-period-1.json | 40 | проверен |
38
+ | group-9332-period-1.json | 24 | проверен |
39
+ | group-9347-period-1.json | 22 | проверен |
40
+ | group-9438-period-1.json | 19 | проверен |
41
+ | group-9491-period-1.json | 16 | проверен |
42
+ | group-9520-period-1.json | 26 | проверен |
43
+ | group-9588-period-1.json | 8 | проверен |
44
+ | group-9698-period-1.json | 37 | проверен, включая перенос |
45
+ | group-9719-period-1.json | 44 | проверен |
46
+ | group-9843-period-1.json | 24 | проверен |
47
+ | teacher-1317-period-1.json | 7 | проверен, восстановлена ученая степень |
48
+ | teacher-1907-period-1.json | 8 | проверен |
49
+ | teacher-2317-period-1.json | 10 | проверен |
50
+ | teacher-543-period-1.json | 39 | проверен, восстановлена ученая степень |
51
+ | room-1438-period-1.json | 75 | проверен |
52
+ | room-803-period-1.json | 48 | проверен, включая два переноса |
53
+ | room-811-period-1.json | 54 | проверен |
54
+ | room-814-period-1.json | 43 | проверен, исправлено ложное ДОТ у Федотовой |
55
55
 
56
56
  Итого: 42 файла, 1184 занятия.
@@ -5,7 +5,12 @@ All new methods belong to `StudentPortalClient` from `chuvsu-js` or
5
5
  Types and lesson matching helpers are available from `chuvsu-js/browser`.
6
6
 
7
7
  ```ts
8
- import { StudentPortalClient, TimetableClient, attachWebinars, parseLocalDate } from "chuvsu-js";
8
+ import {
9
+ StudentPortalClient,
10
+ TimetableClient,
11
+ attachWebinars,
12
+ parseLocalDate,
13
+ } from "chuvsu-js";
9
14
 
10
15
  const portal = new StudentPortalClient({
11
16
  cache: { portfolio: 60_000, webinars: 15_000 },
@@ -123,7 +128,11 @@ from section content. Parsing never evaluates scripts or follows links.
123
128
  Offline parsing:
124
129
 
125
130
  ```ts
126
- import { parsePortfolio, parsePortfolioUrl, parseWebinarPage } from "chuvsu-js/parsers";
131
+ import {
132
+ parsePortfolio,
133
+ parsePortfolioUrl,
134
+ parseWebinarPage,
135
+ } from "chuvsu-js/parsers";
127
136
 
128
137
  const portfolio = parsePortfolio(portfolioHtml);
129
138
  const landingUrl = parsePortfolioUrl(homeHtml);
@@ -58,18 +58,18 @@ for (const lesson of schedule.on(new Date())) {
58
58
 
59
59
  ## Переименования клиентов и общих типов
60
60
 
61
- | v4 | v5 |
62
- |---|---|
63
- | `TtClient` | `TimetableClient` |
64
- | `TtClientOptions` | `TimetableClientOptions` |
65
- | `LkClient` | `StudentPortalClient` |
61
+ | v4 | v5 |
62
+ | ----------------- | ---------------------------- |
63
+ | `TtClient` | `TimetableClient` |
64
+ | `TtClientOptions` | `TimetableClientOptions` |
65
+ | `LkClient` | `StudentPortalClient` |
66
66
  | `LkClientOptions` | `StudentPortalClientOptions` |
67
- | `LkCacheConfig` | `StudentPortalCacheConfig` |
68
- | `PersonalData` | `StudentProfile` |
69
- | `Audience` | `Room` |
70
- | `AudienceInfo` | `RoomInfo` |
71
- | `EducationType` | `EducationLevel` |
72
- | `Period` | `AcademicPeriod` |
67
+ | `LkCacheConfig` | `StudentPortalCacheConfig` |
68
+ | `PersonalData` | `StudentProfile` |
69
+ | `Audience` | `Room` |
70
+ | `AudienceInfo` | `RoomInfo` |
71
+ | `EducationType` | `EducationLevel` |
72
+ | `Period` | `AcademicPeriod` |
73
73
 
74
74
  Опция клиента также переименована:
75
75
 
@@ -83,25 +83,25 @@ new TimetableClient({ educationLevel: EducationLevel.HigherEducation });
83
83
 
84
84
  ## Методы `TimetableClient`
85
85
 
86
- | v4 | v5 |
87
- |---|---|
88
- | `getSchedule(groupId)` | `getGroupSchedule(groupId)` |
89
- | `getScheduleForPeriod({ groupId, period })` | `getGroupSchedule(groupId, { periods: [period] })` |
90
- | `getTeacherScheduleForPeriod({ teacherId, period })` | `getTeacherSchedule(teacherId, { periods: [period] })` |
91
- | `getAudienceSchedule(id)` | `getRoomSchedule(id)` |
92
- | `getAudienceScheduleForPeriod({ audienceId, period })` | `getRoomSchedule(audienceId, { periods: [period] })` |
93
- | `searchGroup({ name })` | `searchGroups(name)` |
94
- | `searchTeacher({ name })` | `searchTeachers(name)` |
95
- | `searchAudience({ name })` | `searchRooms(name)` |
96
- | `getGroupsForFaculty({ facultyId })` | `getFacultyGroups(facultyId)` |
97
- | `getAudiences()` | `getRooms()` |
98
- | `findAudienceByName({ name })` | `findRoomByName(name)` |
99
- | `getAudienceName(id)` | `getRoomName(id)` |
100
- | `getAudienceInfo(id)` | `getRoomInfo(id)` |
101
- | `getAudienceImage(id)` | `getRoomImage(id)` |
102
- | `getAudienceBlockImage(id)` | `getRoomBuildingImage(id)` |
103
- | `getAudienceFloorplan(id)` | `getRoomFloorPlan(id)` |
104
- | `getTeacherPhoto(id)` / `getTeacherPhotoLazy(id)` | `getTeacherPhoto(id)` |
86
+ | v4 | v5 |
87
+ | ------------------------------------------------------ | ------------------------------------------------------ |
88
+ | `getSchedule(groupId)` | `getGroupSchedule(groupId)` |
89
+ | `getScheduleForPeriod({ groupId, period })` | `getGroupSchedule(groupId, { periods: [period] })` |
90
+ | `getTeacherScheduleForPeriod({ teacherId, period })` | `getTeacherSchedule(teacherId, { periods: [period] })` |
91
+ | `getAudienceSchedule(id)` | `getRoomSchedule(id)` |
92
+ | `getAudienceScheduleForPeriod({ audienceId, period })` | `getRoomSchedule(audienceId, { periods: [period] })` |
93
+ | `searchGroup({ name })` | `searchGroups(name)` |
94
+ | `searchTeacher({ name })` | `searchTeachers(name)` |
95
+ | `searchAudience({ name })` | `searchRooms(name)` |
96
+ | `getGroupsForFaculty({ facultyId })` | `getFacultyGroups(facultyId)` |
97
+ | `getAudiences()` | `getRooms()` |
98
+ | `findAudienceByName({ name })` | `findRoomByName(name)` |
99
+ | `getAudienceName(id)` | `getRoomName(id)` |
100
+ | `getAudienceInfo(id)` | `getRoomInfo(id)` |
101
+ | `getAudienceImage(id)` | `getRoomImage(id)` |
102
+ | `getAudienceBlockImage(id)` | `getRoomBuildingImage(id)` |
103
+ | `getAudienceFloorplan(id)` | `getRoomFloorPlan(id)` |
104
+ | `getTeacherPhoto(id)` / `getTeacherPhotoLazy(id)` | `getTeacherPhoto(id)` |
105
105
 
106
106
  `getGroupSchedule`, `getTeacherSchedule` и `getRoomSchedule` по умолчанию
107
107
  загружают все периоды, доступные на соответствующей странице портала, включая
@@ -113,10 +113,7 @@ new TimetableClient({ educationLevel: EducationLevel.HigherEducation });
113
113
  import { AcademicPeriod } from "chuvsu-js";
114
114
 
115
115
  const schedule = await client.getTeacherSchedule(teacherId, {
116
- periods: [
117
- AcademicPeriod.FallSemester,
118
- AcademicPeriod.WinterSession,
119
- ],
116
+ periods: [AcademicPeriod.FallSemester, AcademicPeriod.WinterSession],
120
117
  });
121
118
  ```
122
119
 
@@ -136,15 +133,15 @@ const schedule = await client.getSchedule({
136
133
 
137
134
  ## Методы `Schedule`
138
135
 
139
- | v4 | v5 |
140
- |---|---|
141
- | `forDate(date)` | `on(date)` |
142
- | `forWeek(week, options)` | `week(week, options)` |
136
+ | v4 | v5 |
137
+ | -------------------------- | --------------------------- |
138
+ | `forDate(date)` | `on(date)` |
139
+ | `forWeek(week, options)` | `week(week, options)` |
143
140
  | `forDay(weekday, options)` | `weekday(weekday, options)` |
144
- | `currentLesson(options)` | `current(options)` |
145
- | `today(options)` | `today(options)` |
146
- | `tomorrow(options)` | `tomorrow(options)` |
147
- | `thisWeek(options)` | `thisWeek(options)` |
141
+ | `currentLesson(options)` | `current(options)` |
142
+ | `today(options)` | `today(options)` |
143
+ | `tomorrow(options)` | `tomorrow(options)` |
144
+ | `thisWeek(options)` | `thisWeek(options)` |
148
145
 
149
146
  `on`, `week`, `weekday`, `today`, `tomorrow` и `thisWeek` теперь всегда
150
147
  возвращают `LessonOccurrence[]`. Опция `subgroup` сохранена:
@@ -159,20 +156,20 @@ const lessons = schedule.weekday(1, { week: 4, subgroup: 2 });
159
156
 
160
157
  ## Миграция `Lesson` на `LessonOccurrence`
161
158
 
162
- | v4 `Lesson` | v5 `LessonOccurrence` |
163
- |---|---|
164
- | `number` | `slotNumber` |
165
- | `start.hours`, `start.minutes` | `time?.start.hours`, `time?.start.minutes` |
166
- | `end.hours`, `end.minutes` | `time?.end.hours`, `time?.end.minutes` |
167
- | `start.date` | `scheduledDate` (`YYYY-MM-DD`) |
168
- | `room` | `rooms.values` |
169
- | `teacher` | `teachers.values` |
170
- | `groups: string[]` | `groups.values: GroupAttendance[]` |
171
- | `originalRoom` | `originalRooms` |
172
- | `originalTeacher` | `originalTeachers` |
173
- | `transfer` | `status`, `nominalDate`, `scheduledDate`, `movedFrom` |
174
- | отсутствовало | `id` и необязательный `seriesId` |
175
- | отсутствовало | `sources` |
159
+ | v4 `Lesson` | v5 `LessonOccurrence` |
160
+ | ------------------------------ | ----------------------------------------------------- |
161
+ | `number` | `slotNumber` |
162
+ | `start.hours`, `start.minutes` | `time?.start.hours`, `time?.start.minutes` |
163
+ | `end.hours`, `end.minutes` | `time?.end.hours`, `time?.end.minutes` |
164
+ | `start.date` | `scheduledDate` (`YYYY-MM-DD`) |
165
+ | `room` | `rooms.values` |
166
+ | `teacher` | `teachers.values` |
167
+ | `groups: string[]` | `groups.values: GroupAttendance[]` |
168
+ | `originalRoom` | `originalRooms` |
169
+ | `originalTeacher` | `originalTeachers` |
170
+ | `transfer` | `status`, `nominalDate`, `scheduledDate`, `movedFrom` |
171
+ | отсутствовало | `id` и необязательный `seriesId` |
172
+ | отсутствовало | `sources` |
176
173
 
177
174
  `slotNumber` и `time` необязательны и независимы. Нельзя использовать
178
175
  утверждение `lesson.number === 5` как источник времени или вычислять номер пары
@@ -230,9 +227,9 @@ type RelationSet<T> = {
230
227
  Ссылки на сущности теперь могут содержать ID:
231
228
 
232
229
  ```ts
233
- lesson.teachers.values // TeacherRef[]: { id?, name, position?, degree? }
234
- lesson.rooms.values // RoomRef[]: { id?, name, building? }
235
- lesson.groups.values // GroupAttendance[]: { group: GroupRef, subgroup? }
230
+ lesson.teachers.values; // TeacherRef[]: { id?, name, position?, degree? }
231
+ lesson.rooms.values; // RoomRef[]: { id?, name, building? }
232
+ lesson.groups.values; // GroupAttendance[]: { group: GroupRef, subgroup? }
236
233
  ```
237
234
 
238
235
  ## Даты, сессия и переносы
@@ -245,7 +242,7 @@ lesson.groups.values // GroupAttendance[]: { group: GroupRef, subgroup? }
245
242
  import { formatLocalDate, parseLocalDate } from "chuvsu-js";
246
243
 
247
244
  const key = formatLocalDate(new Date(2026, 8, 3)); // "2026-09-03"
248
- const date = parseLocalDate(key); // локальный Date
245
+ const date = parseLocalDate(key); // локальный Date
249
246
  ```
250
247
 
251
248
  Экзамен, консультация и другая строка сессии сразу являются
@@ -368,15 +365,15 @@ const searched = await client.resolveTeacher("Иванов И. И.", {
368
365
  Если приложение использовало табличные типы v4 напрямую, миграция выполняется
369
366
  отдельно от канонического `Schedule`:
370
367
 
371
- | v4 | v5 (`chuvsu-js/parsers`) |
372
- |---|---|
373
- | `FullScheduleDay` | `ParsedScheduleDay` |
374
- | `FullScheduleSlot` | `ParsedScheduleBlock` |
375
- | `ScheduleEntry` | `ParsedLesson` |
376
- | `day.slots` | `day.blocks` |
377
- | `slot.number` | `block.slotNumber` |
368
+ | v4 | v5 (`chuvsu-js/parsers`) |
369
+ | -------------------------------- | -------------------------------------- |
370
+ | `FullScheduleDay` | `ParsedScheduleDay` |
371
+ | `FullScheduleSlot` | `ParsedScheduleBlock` |
372
+ | `ScheduleEntry` | `ParsedLesson` |
373
+ | `day.slots` | `day.blocks` |
374
+ | `slot.number` | `block.slotNumber` |
378
375
  | `slot.timeStart`, `slot.timeEnd` | `block.time?.start`, `block.time?.end` |
379
- | `slot.entries` | `block.lessons` |
376
+ | `slot.entries` | `block.lessons` |
380
377
 
381
378
  ```ts
382
379
  import { parseGroupSchedule } from "chuvsu-js/parsers";
@@ -396,11 +393,11 @@ for (const day of days) {
396
393
 
397
394
  ## Вебинары
398
395
 
399
- | v4 | v5 |
400
- |---|---|
401
- | `attachWebinarsToLessons` | `attachWebinars` |
402
- | `matchWebinarToLesson` | `findWebinar` |
403
- | `webinar.date` | `webinar.scheduledDate` |
396
+ | v4 | v5 |
397
+ | -------------------------------------- | ---------------------------------------- |
398
+ | `attachWebinarsToLessons` | `attachWebinars` |
399
+ | `matchWebinarToLesson` | `findWebinar` |
400
+ | `webinar.date` | `webinar.scheduledDate` |
404
401
  | `webinar.timeStart`, `webinar.timeEnd` | `webinar.time.start`, `webinar.time.end` |
405
402
 
406
403
  ```ts
@@ -424,22 +421,22 @@ known groups, subgroups or teachers.
424
421
 
425
422
  ## Сетка звонков
426
423
 
427
- | v4 | v5 |
428
- |---|---|
429
- | `getTimeSlots()` | `getStandardScheduleBlocks()` |
430
- | `getLessonNumber(time)` | удален |
424
+ | v4 | v5 |
425
+ | ----------------------- | ----------------------------- |
426
+ | `getTimeSlots()` | `getStandardScheduleBlocks()` |
427
+ | `getLessonNumber(time)` | удален |
431
428
 
432
429
  Стандартная сетка в v5 является только справочником. Она не исправляет данные
433
430
  портала и не используется для вычисления `slotNumber` по времени.
434
431
 
435
432
  ## Личный кабинет
436
433
 
437
- | v4 | v5 |
438
- |---|---|
439
- | `new LkClient()` | `new StudentPortalClient()` |
440
- | `getPersonalData()` | `getProfile()` |
441
- | `getPhoto()` | `getProfilePhoto()` |
442
- | `getGroupId()` | `getTimetableGroupId()` |
434
+ | v4 | v5 |
435
+ | ------------------- | --------------------------- |
436
+ | `new LkClient()` | `new StudentPortalClient()` |
437
+ | `getPersonalData()` | `getProfile()` |
438
+ | `getPhoto()` | `getProfilePhoto()` |
439
+ | `getGroupId()` | `getTimetableGroupId()` |
443
440
 
444
441
  Поля профиля не изменились; изменились имена класса, типа и методов. Ключи
445
442
  настроек кеша переименованы с `personalData`, `photo`, `groupId` на `profile`,
@@ -449,11 +446,11 @@ known groups, subgroups or teachers.
449
446
 
450
447
  В расписании переименованы категории:
451
448
 
452
- | v4 | v5 |
453
- |---|---|
454
- | `audiences` | `rooms` |
455
- | `audienceNames` | `roomNames` |
456
- | `audienceInfo` | `roomInfo` |
449
+ | v4 | v5 |
450
+ | ---------------- | ------------ |
451
+ | `audiences` | `rooms` |
452
+ | `audienceNames` | `roomNames` |
453
+ | `audienceInfo` | `roomInfo` |
457
454
  | `audienceImages` | `roomImages` |
458
455
 
459
456
  Остальные категории сохраняют назначение, но содержимое кеша v4 повторно