chuvsu-js 5.5.1 → 5.5.3

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 (61) 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.d.ts +5 -0
  38. package/dist/webinar/chat-subscription.js +20 -0
  39. package/dist/webinar/client.d.ts +16 -1
  40. package/dist/webinar/client.js +152 -35
  41. package/dist/webinar/ddp.js +44 -13
  42. package/dist/webinar/events.js +7 -2
  43. package/dist/webinar/gateway.d.ts +3 -1
  44. package/dist/webinar/gateway.js +63 -16
  45. package/dist/webinar/media-protocol.d.ts +3 -2
  46. package/dist/webinar/media-protocol.js +28 -6
  47. package/dist/webinar/media.js +11 -5
  48. package/dist/webinar/parse.js +59 -17
  49. package/dist/webinar/playback.d.ts +1 -0
  50. package/dist/webinar/playback.js +49 -13
  51. package/dist/webinar/socket.js +4 -1
  52. package/dist/webinar/state.js +73 -26
  53. package/dist/webinar/types.d.ts +14 -1
  54. package/dist/webinar/types.js +3 -1
  55. package/dist/webinar/typing.d.ts +8 -0
  56. package/dist/webinar/typing.js +36 -0
  57. package/docs/fixture-review.md +44 -44
  58. package/docs/student-portal.md +11 -2
  59. package/docs/v5-migration.md +85 -88
  60. package/docs/webinar.md +38 -6
  61. package/package.json +1 -1
package/docs/webinar.md CHANGED
@@ -30,11 +30,22 @@ same participant can interfere with each other. Do not log, persist in shared
30
30
  caches, or expose participant session credentials to other users. The session
31
31
  contains BBB credentials, never LK email/password or cookies.
32
32
 
33
+ Some servers require their HttpOnly BBB session cookie for the media signaling
34
+ handshake. A frontend on another site cannot receive that backend cookie through
35
+ `getSession()`. Use `gateway.createMediaSocket()` behind an authenticated,
36
+ owner-scoped WebSocket signaling relay and provide its browser endpoint through
37
+ `WebinarMediaClient`'s `socketFactory` option. This relays signaling only; peer
38
+ connections and audio/video remain directly between the browser and BBB. Never
39
+ serialize the gateway cookie jar or share a relay with another participant.
40
+
33
41
  ## State and events
34
42
 
35
43
  - `getUsers()`, `getPresenter()`, `getModerators()` distinguish participant roles.
36
44
  Presenter/moderator does not automatically mean the scheduled lecturer.
37
45
  - `getChats()` exposes only chats published to this participant.
46
+ - `getTypingUsers({ chatId? })` exposes other participants typing in accessible
47
+ chats, respecting hidden-viewer settings. Typing is subscribed only when the
48
+ server advertises it.
38
49
  - `getMessages({ chatId? })` reads accumulated history/live messages.
39
50
  - `loadMessages({ chatId?, page? })` fetches a historical page, starting at 1.
40
51
  `connect()` loads the first public-chat page; subsequent pages are explicit.
@@ -65,10 +76,16 @@ Streams are bounded. Overflow raises an error; refresh the snapshot and resubscr
65
76
  Connection failures, rejected methods/subscriptions and unsupported versions fail
66
77
  explicitly. `close()` releases the connection; create a new session/client to
67
78
  reconnect. No automatic reconnect, replay of writes, or settings changes.
79
+ For an explicit room exit, use `await room.leave()`: it calls BBB's
80
+ `userLeftMeeting` for this authenticated participant and closes the transport
81
+ even if the request fails. It is idempotent and never removes another participant.
82
+ `close()` remains transport-only for disconnects and failed connections.
68
83
 
69
84
  ## Explicit actions
70
85
 
71
86
  ```ts
87
+ await room.setTyping(true); // Explicit, throttled by the UI (e.g. every 2 seconds).
88
+ await room.setTyping(false); // Stop on empty input, submit or panel teardown.
72
89
  await room.setRaisedHand(true);
73
90
  await room.setRaisedHand(false);
74
91
  await room.sendMessage({ text: "Hello" }); // Public chat by default.
@@ -100,7 +117,9 @@ const audio = await media.listen(); // Explicit listen-only connection.
100
117
  audioElement.srcObject = audio.stream;
101
118
  await audioElement.play(); // Invoke from a user gesture when autoplay is blocked.
102
119
 
103
- const camera = room.getMediaStreams().find((stream) => stream.kind === "camera");
120
+ const camera = room
121
+ .getMediaStreams()
122
+ .find((stream) => stream.kind === "camera");
104
123
  if (camera) {
105
124
  const playback = await media.receiveCamera({ streamId: camera.id });
106
125
  videoElement.srcObject = playback.stream;
@@ -121,7 +140,13 @@ Media uses the server's authenticated SFU WebSocket and browser WebRTC directly.
121
140
  No backend media receiver or forwarding is required. `listen()` receives the
122
141
  mixed room audio, not separate speaker tracks. Every playback exposes `stream`,
123
142
  `connection`, `getStats()`, `onError()`, `onClose()`, and idempotent `close()`.
124
- ICE candidates queue until negotiation is ready. Timeouts, aborts, disconnects
143
+ Listen-only negotiation follows the server's `media.listenOnlyOffering` setting:
144
+ client offers and server offers are both supported. Server-offered audio sends
145
+ `subscriberAnswer`; ICE candidates queue until negotiation is ready. The server's
146
+ `forceRelay` and `forceRelayOnFirefox` settings select the browser ICE policy.
147
+ These contracts are covered by mock protocol tests; live receive-only audio still
148
+ requires verification on an available webinar. Autoplay denial should retain the
149
+ stream and offer a user-gesture playback button. Timeouts, aborts, disconnects
125
150
  and remote stream termination release sockets, peers and tracks. Media teardown
126
151
  is separate from room state teardown. Browser and network restrictions can still
127
152
  require the BBB server's TURN relay.
@@ -134,12 +159,19 @@ initial API; `setMuted()` only controls an already connected microphone session.
134
159
 
135
160
  ## Server versions
136
161
 
137
- Initial adapter supports the inspected **BBB 2.3 Meteor/DDP + Kurento** protocol.
138
- Version/build and endpoint configuration are read from each server's actual
139
- HTML5 client, not the REST API's unrelated `version=2.0`. Other versions fail
140
- explicitly until their participant protocol is implemented and tested. No shared
162
+ Compatibility follows the participant protocol, not a version allowlist. The
163
+ bootstrap decodes Meteor's public runtime configuration and validates participant
164
+ credentials and endpoints. The DDP client negotiates the chat subscription's
165
+ IDs/count signature and retains the accepted format per participant. Only a
166
+ signature mismatch permits this fallback; authentication and transport failures
167
+ remain errors. Server version/build stay informational.
168
+
169
+ Meteor/DDP state and legacy SFU signaling are implemented. The 2.3 contracts are
170
+ covered by fixtures; 2.4 bootstrap and live participant state were verified
171
+ against the university server. Incompatible protocols fail explicitly. No shared
141
172
  BBB integration secret is required or used.
142
173
 
143
174
  Protocol references: [Meteor DDP](https://github.com/meteor/meteor/blob/devel/packages/ddp/DDP.md),
144
175
  [BBB 2.3 participant source](https://github.com/bigbluebutton/bigbluebutton/tree/v2.3.0/bigbluebutton-html5/imports/api),
176
+ [BBB 2.4 participant source](https://github.com/bigbluebutton/bigbluebutton/tree/v2.4.0/bigbluebutton-html5/imports/api),
145
177
  [external UI configuration](https://docs.bigbluebutton.org/administration/cluster-proxy/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chuvsu-js",
3
- "version": "5.5.1",
3
+ "version": "5.5.3",
4
4
  "description": "Библиотека для расписания и личного кабинета ЧГУ им. И. Н. Ульянова",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",