@webex/plugin-meetings 3.13.0-next.13 → 3.13.0-next.15
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/.repo-context.json +577 -0
- package/.sdd/manifest.json +1320 -428
- package/AGENTS.md +528 -72
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/config.js +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/webinar/index.js +1 -1
- package/docs/adr/0001-migrate-existing-docs-into-sdd.md +141 -0
- package/docs/adr/index.md +26 -0
- package/docs/architecture.md +816 -0
- package/docs/getting-started.md +177 -0
- package/docs/index.md +53 -0
- package/docs/specs/README.md +126 -0
- package/package.json +21 -21
- package/schemas/repo-context.schema.json +796 -0
- package/src/aiEnableRequest/docs/README.md +376 -0
- package/src/annotation/docs/README.md +402 -0
- package/src/breakouts/docs/README.md +643 -0
- package/src/controls-options-manager/docs/README.md +365 -0
- package/src/hashTree/docs/README.md +566 -0
- package/src/interceptors/docs/README.md +434 -0
- package/src/interpretation/docs/README.md +420 -0
- package/src/locus-info/docs/README.md +609 -0
- package/src/media/docs/README.md +488 -0
- package/src/meeting/docs/README.md +834 -0
- package/src/meeting-info/docs/README.md +352 -0
- package/src/meetings/docs/README.md +549 -0
- package/src/member/docs/README.md +347 -0
- package/src/members/docs/README.md +514 -0
- package/src/metrics/docs/README.md +287 -0
- package/src/multistream/docs/README.md +523 -0
- package/src/personal-meeting-room/docs/README.md +322 -0
- package/src/reachability/docs/README.md +548 -0
- package/src/reactions/docs/README.md +296 -0
- package/src/reconnection-manager/docs/README.md +485 -0
- package/src/recording-controller/docs/README.md +335 -0
- package/src/roap/docs/README.md +444 -0
- package/src/webinar/docs/README.md +425 -0
- package/.sdd/templates/.source.json +0 -30
- package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +0 -111
- package/.sdd/templates/component-repo/module-docs/module-spec.template.md +0 -321
- package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +0 -59
- package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +0 -49
- package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +0 -42
- package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +0 -120
- package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +0 -206
- package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +0 -90
- package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +0 -68
- package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +0 -111
- package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +0 -57
- package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +0 -69
- package/.sdd/templates/component-repo/standing-docs/RULES.template.md +0 -96
- package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +0 -84
- package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +0 -82
- package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +0 -94
- package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +0 -64
- package/.sdd/templates/component-repo/template-map.json +0 -112
- package/ai-docs/ARCHITECTURE.md +0 -208
- package/ai-docs/CONTRACTS.md +0 -267
- package/ai-docs/DATA_MODEL.md +0 -64
- package/ai-docs/GETTING_STARTED.md +0 -73
- package/ai-docs/GLOSSARY.md +0 -56
- package/ai-docs/REVIEW_CHECKLIST.md +0 -45
- package/ai-docs/RULES.md +0 -79
- package/ai-docs/SECURITY.md +0 -74
- package/ai-docs/SERVICE_STATE.md +0 -59
- package/ai-docs/SPEC_INDEX.md +0 -85
- package/ai-docs/TEST_INDEX.md +0 -45
- package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +0 -61
- package/ai-docs/patterns/defensive-error-propagation.md +0 -55
- package/ai-docs/patterns/event-scope-emission.md +0 -46
- package/ai-docs/patterns/source-to-test-path-mirroring.md +0 -45
- package/ai-docs/patterns/stateless-plugin-request-classes.md +0 -53
- package/ai-docs/patterns/typed-constants-and-enum-values.md +0 -47
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +0 -223
- package/src/annotation/ai-docs/annotation-spec.md +0 -236
- package/src/breakouts/ai-docs/breakouts-spec.md +0 -324
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +0 -243
- package/src/hashTree/ai-docs/hash-tree-spec.md +0 -267
- package/src/interceptors/ai-docs/interceptors-spec.md +0 -247
- package/src/interpretation/ai-docs/interpretation-spec.md +0 -256
- package/src/locus-info/ai-docs/locus-info-spec.md +0 -293
- package/src/media/ai-docs/media-spec.md +0 -267
- package/src/meeting/ai-docs/meeting-spec.md +0 -404
- package/src/meeting-info/ai-docs/meeting-info-spec.md +0 -261
- package/src/meetings/ai-docs/meetings-spec.md +0 -298
- package/src/member/ai-docs/member-spec.md +0 -196
- package/src/members/ai-docs/members-spec.md +0 -256
- package/src/metrics/ai-docs/metrics-spec.md +0 -185
- package/src/multistream/ai-docs/multistream-spec.md +0 -295
- package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +0 -234
- package/src/reachability/ai-docs/reachability-spec.md +0 -261
- package/src/reactions/ai-docs/reactions-spec.md +0 -198
- package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +0 -272
- package/src/recording-controller/ai-docs/recording-controller-spec.md +0 -223
- package/src/roap/ai-docs/roap-spec.md +0 -241
- package/src/webinar/ai-docs/webinar-spec.md +0 -243
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Module Spec
|
|
3
|
+
title: 'Members specification'
|
|
4
|
+
description: Responsibilities, boundaries, design, state, invariants, and verification for the Members roster module of plugin-meetings.
|
|
5
|
+
tags: [module, specification]
|
|
6
|
+
---
|
|
7
|
+
<!-- sdd-generated-metadata
|
|
8
|
+
doc_kind: module-spec
|
|
9
|
+
generated_from: module-spec@0.3.0
|
|
10
|
+
generated_by: claude-code
|
|
11
|
+
approved_by: rarajes2@cisco.com
|
|
12
|
+
updated_at: 2026-11-17T03:14:21Z
|
|
13
|
+
validation_status: pass-with-warnings
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
# Members
|
|
17
|
+
|
|
18
|
+
This source-local document at `src/members/docs/README.md` owns the stable specification for
|
|
19
|
+
**Members**, the roster of one meeting. `Meeting` creates one `Members` instance and exposes it as
|
|
20
|
+
`meeting.members`. It keeps a `MembersCollection` of `Member` models reconciled from `LocusInfo`
|
|
21
|
+
participant, host, self, media-share, URL, and full-state callbacks, emits the `members:*` events,
|
|
22
|
+
and sends participant-control requests (invite, admit, remove, mute, roles, lobby, hands, host
|
|
23
|
+
transfer, DTMF, display name) to Locus through the meeting's Locus delta request. Ground every claim
|
|
24
|
+
in package evidence and link to the [package architecture](../../../docs/architecture.md) instead of
|
|
25
|
+
repeating broader facts. No service specification exists because the package is a library.
|
|
26
|
+
|
|
27
|
+
Related context: [documentation index](../../../docs/index.md) ·
|
|
28
|
+
[package agent instructions](../../../AGENTS.md) ·
|
|
29
|
+
[member model specification](../../member/docs/README.md) ·
|
|
30
|
+
[Locus info specification](../../locus-info/docs/README.md) ·
|
|
31
|
+
[meeting specification](../../meeting/docs/README.md)
|
|
32
|
+
|
|
33
|
+
## Metadata
|
|
34
|
+
|
|
35
|
+
| Field | Value |
|
|
36
|
+
| ----------------- | ----- |
|
|
37
|
+
| Owner | @webex/web-client, @webex/web-sdk |
|
|
38
|
+
| Source path | `src/members` |
|
|
39
|
+
| Resource kind | module |
|
|
40
|
+
| Status | Draft |
|
|
41
|
+
| Last verified | 2026-11-16 at `0b8c34db7f` |
|
|
42
|
+
| Module id | `plugin-meetings/members` |
|
|
43
|
+
| Parent spec | — |
|
|
44
|
+
| Doc kind | Module spec |
|
|
45
|
+
| Coverage score | Pending coverage assessment |
|
|
46
|
+
| Validation status | not-run |
|
|
47
|
+
|
|
48
|
+
## Applicability
|
|
49
|
+
|
|
50
|
+
| Condition ID | Status | Evidence or reason | Owned section |
|
|
51
|
+
| ------------------------------------ | ---------- | ------------------ | ------------- |
|
|
52
|
+
| `module.has_tiers` | N/A | No tier policy exists in `package.json` or `.sdd/manifest.json` | Tier |
|
|
53
|
+
| `module.has_ui` | N/A | `src/members/index.ts` holds models and returns promises; it renders nothing | UI use-case flow |
|
|
54
|
+
| `module.crosses_service_boundaries` | Applicable | Every participant control in `src/members/index.ts` is sent to the Locus service by `src/members/request.ts` through the meeting's Locus delta request in `src/meeting/util.ts` | Cross-boundary use-case flow |
|
|
55
|
+
| `module.holds_client_state` | Applicable | `src/members/index.ts` keeps the locus URL, host, self, type, share, and recording ids and a CSI history map; `src/members/collection.ts` keeps the Member models | Client state model |
|
|
56
|
+
| `module.enforces_domain_rules` | Applicable | One Member per participant id, hidden-roster filtering, paired-device relations, and per-method argument guards in `src/members/index.ts` | Business rules and invariants |
|
|
57
|
+
| `module.is_concurrent_async` | Applicable | Locus callbacks arrive as events from `src/meeting/index.ts`; every control method returns a promise (`src/members/index.ts`) | Concurrency and reactive flow |
|
|
58
|
+
| `module.owns_persistence` | N/A | Nothing is stored; `src/members/collection.ts` is in memory only | Data, schema, and migration discipline |
|
|
59
|
+
| `module.stateful_transitions` | N/A | `src/members/index.ts` replaces fields per callback; there is no state machine with guards | State machine |
|
|
60
|
+
| `module.exposes_wire_protocol` | N/A | Request bodies are built in `src/members/util.ts` for the Locus service, which owns the protocol; callers of this module see only method arguments and events. Bodies are listed under Cross-boundary use-case flow | Protocol and wire format |
|
|
61
|
+
| `module.ui_multi_screen` | N/A | No UI | UI flow |
|
|
62
|
+
| `module.large_data_model` | N/A | The member model is owned by `src/member/index.ts`; `src/members/types.ts` declares only role-assignment shapes | Data model |
|
|
63
|
+
| `module.returns_caller_errors` | Applicable | Control methods reject with ParameterError, plain Error, or the reclaim-host errors of `src/common/errors/reclaim-host-role-errors.ts`; setters throw synchronously (`src/members/index.ts`) | Caller-visible failure modes |
|
|
64
|
+
| `module.module_specific_conventions` | N/A | The module follows the package-wide request-class and Trigger patterns of `src/common/events/trigger-proxy.ts` | Module-specific rules |
|
|
65
|
+
| `module.published_package` | N/A | `src/index.ts` does not export Members; consumers reach it as meeting.members, and package exports are owned by the package architecture | Export stability |
|
|
66
|
+
| `module.embedded_in_host` | N/A | No host theme or embed API | Host integration and theming |
|
|
67
|
+
| `module.has_design_tradeoff` | N/A | No recorded design trade-off; see Pitfalls and constraints for behavior to preserve | Key design trade-off |
|
|
68
|
+
| `module.has_submodules` | N/A | The `src/members/collection.ts` sibling files are one module with no child module | Sub-modules |
|
|
69
|
+
|
|
70
|
+
## Evidence register
|
|
71
|
+
|
|
72
|
+
Requirements cite current implementation and mirrored unit-test paths. Current code wins over
|
|
73
|
+
prose when they conflict; commit and PR history are excluded as evidence by repository-owner
|
|
74
|
+
decision. Missing test evidence is stated as a gap rather than inferred.
|
|
75
|
+
|
|
76
|
+
| Evidence | What it establishes |
|
|
77
|
+
| -------- | ------------------- |
|
|
78
|
+
| `src/members/index.ts` | Members extends StatelessWebexPlugin in namespace Meetings; its constructor, the locus* callbacks, the context setters, roster reconciliation, CSI lookup, every participant-control method, and the event triggers |
|
|
79
|
+
| `src/members/collection.ts` | MembersCollection, a plain object map keyed by member id with set, setAll, get, getAll, remove, and reset |
|
|
80
|
+
| `src/members/request.ts` | MembersRequest: one method per Locus request, each guarding its options and throwing ParameterError synchronously before calling locusDeltaRequest |
|
|
81
|
+
| `src/members/util.ts` | Members requests use PUT, PATCH, and POST only; an invitee phone number must match `DIALER_REGEX.E164_FORMAT` (`DIALER_REGEX.INTERNAL_NUMBER` when `isInternalNumber`), and an email or SIP address must match `VALID_EMAIL_ADDRESS` or `DIALER_REGEX.SIP_ADDRESS` |
|
|
82
|
+
| `src/members/types.ts` | ServerRoles (COHOST, MODERATOR, PRESENTER), ServerRoleShape, RoleAssignmentOptions, RoleAssignmentBody, RoleAssignmentRequest |
|
|
83
|
+
| `src/constants.ts` | The members:* event literals, CONTROLS, PARTICIPANT, LEAVE, ALIAS, sendDtmf, FORCED, REMOVE, FLOOR_ACTION, and the ASSIGN_ROLES_ERROR_CODES values |
|
|
84
|
+
| `src/meeting/index.ts` | Meeting constructs Members with locusUrl, receiveSlotManager, mediaRequestManagers, and itself; it wires the LocusInfo events to the locus* callbacks and forwards its participant-control methods to meeting.members |
|
|
85
|
+
| `src/meeting/util.ts` | generateLocusDeltaRequest holds the meeting through a WeakRef, resolves undefined when the meeting is gone, and applies the API response to Locus only when the request URI starts with the meeting's locusUrl |
|
|
86
|
+
| `src/common/errors/reclaim-host-role-errors.ts` | The four reclaim-host error classes that assignRoles maps Locus error codes to |
|
|
87
|
+
| `test/unit/spec/members/index.js` | Constructor, addMember, admitMembers, muteMember, transferHostToMember, clearMembers, locusParticipantsUpdate (event payload, removal, paired devices), sendDialPadKey, cancel invites, assignRoles error mapping, hands, editDisplayName, findMemberByCsi and CSI history, getCsisForMember, moveToLobby |
|
|
88
|
+
| `test/unit/spec/members/request.js` | The method, URI, and body sent through locusDeltaRequest for every MembersRequest method, and the lowerAllHandsMember guards |
|
|
89
|
+
| `test/unit/spec/members/utils.js` | Option and request builders in MembersUtil |
|
|
90
|
+
| `test/unit/spec/members/collection.js` | MembersCollection set, remove, reset, setAll, get, getAll |
|
|
91
|
+
| `test/unit/spec/meeting/index.js` | Meeting-level cases that observe members:content:update emitted from locusMediaSharesUpdate |
|
|
92
|
+
| Observation, no stated WHY (`src/members/index.ts`) | update skips any participant whose hideInRoster is truthy, so it is neither added nor updated; the code gives no reason |
|
|
93
|
+
| Observation, no stated WHY (`src/members/request.ts`) | addMembers throws only when emailAddress, email, phoneNumber, and locusUrl are all present, because its guard is negated; with ordinary input it never throws |
|
|
94
|
+
| Observation, no stated WHY (`src/members/index.ts`) | locusMediaSharesUpdate emits members:content:update with activeSharingId and endedSharingId, while the JSDoc above the class names activeContentSharingId and endedContentSharingId |
|
|
95
|
+
|
|
96
|
+
## Purpose and boundary
|
|
97
|
+
|
|
98
|
+
- Responsibility: owns the meeting roster collection, reconciles participant updates, performs
|
|
99
|
+
participant mutations, and emits member events for one meeting.
|
|
100
|
+
- In scope: the `MembersCollection`; the context ids (locus URL, host, self, meeting type, content
|
|
101
|
+
and whiteboard sharer, recording id); roster reconciliation from Locus participants including
|
|
102
|
+
removals, replacement, and paired-device relations; the CSI history used by `findMemberByCsi`;
|
|
103
|
+
the `members:*` events; the participant-control requests and their argument guards.
|
|
104
|
+
- Out of scope: what a `Member` derives from one participant (owned by
|
|
105
|
+
[the member model](../../member/docs/README.md)); Locus parsing and which callback fires (owned by
|
|
106
|
+
[Locus info](../../locus-info/docs/README.md)); the HTTP request, Locus delta application, and the
|
|
107
|
+
meeting-level wrappers (owned by [the meeting](../../meeting/docs/README.md)); what Locus allows each
|
|
108
|
+
participant to do.
|
|
109
|
+
- Consumers: `Meeting` (`src/meeting/index.ts`), which creates the instance, feeds it, forwards its
|
|
110
|
+
control methods, and resolves CSIs through `findMemberByCsi`; the multistream `ReceiveSlotManager`
|
|
111
|
+
through `updateMemberIds`; applications through `meeting.members` and the `members:*` events.
|
|
112
|
+
|
|
113
|
+
## Structure and key files
|
|
114
|
+
|
|
115
|
+
`src/members` contains five direct source files, one file per responsibility, and has four mirrored unit-test files under
|
|
116
|
+
`test/unit/spec/members`. The module is TypeScript in the Node 22.14 Yarn workspace, built on the
|
|
117
|
+
Webex core `StatelessWebexPlugin` abstraction; its tests use Mocha, Sinon, and
|
|
118
|
+
`@webex/test-helper-chai`, run by `yarn workspace @webex/plugin-meetings test:unit`
|
|
119
|
+
(`webex-legacy-tools test --unit --runner mocha`). Build target:
|
|
120
|
+
`yarn workspace @webex/plugin-meetings build:src`.
|
|
121
|
+
|
|
122
|
+
| File | Holds |
|
|
123
|
+
| ---- | ----- |
|
|
124
|
+
| `src/members/collection.ts` | module-owned collection: `MembersCollection`, the in-memory map of member id to `Member` |
|
|
125
|
+
| `src/members/index.ts` | module facade and default export: the `Members` class, its Locus callbacks, reconciliation, CSI queries, control methods, and event triggers |
|
|
126
|
+
| `src/members/request.ts` | HTTP request boundary: `MembersRequest`, which validates options and sends each request through the meeting's `locusDeltaRequest` |
|
|
127
|
+
| `src/members/types.ts` | module type declarations: `ServerRoles` and the role-assignment shapes |
|
|
128
|
+
| `src/members/util.ts` | option and request builders: `MembersUtil` invitee validation and the method, URI, and body of each request |
|
|
129
|
+
| `test/unit/spec/members/collection.js` and 3 sibling test files (`index.js`, `request.js`, `utils.js`) | mirrored unit coverage of the collection, the facade, the request class, and the builders |
|
|
130
|
+
| `src/members/docs/README.md` | this module specification |
|
|
131
|
+
|
|
132
|
+
## Public surface
|
|
133
|
+
|
|
134
|
+
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
135
|
+
|---|---|---|---|---|---|---|
|
|
136
|
+
| `members-api` | SDK collection | `MembersCollection.set()`, `setAll()`, `get()`, `getAll()`, `remove()`, and `reset()` | Store member models by member id and support roster replacement/reset. | Preserve collection keying; `getAll()` returns the live map object, and `reset()` / `setAll()` replace it. | `src/members/collection.ts` | [architecture](../../../docs/architecture.md) |
|
|
137
|
+
| `members-api` | SDK / Locus input | `locusSelfUpdate()`, `locusHostUpdate()`, `locusParticipantsUpdate()`, `locusMediaSharesUpdate()`, `locusUrlUpdate()`, `locusFullStateTypeUpdate()`, `setLocusUrl()`, `setHostId()`, `setType()`, `setSelfId()`, `setMediaShareContentId()`, `setMediaShareWhiteboardId()`, and `clearMembers()` | Reconcile authoritative Locus roster/context into the current collection. | Preserve one `MEMBERS_UPDATE` emission per participants update with `{delta, full, isReplace}`; the nested delta carries added/updated models and removed ids. | `src/members/index.ts` | [architecture](../../../docs/architecture.md) |
|
|
138
|
+
| `members-api` | SDK / model mutation | `addMember()` and participant reconciliation (`update()`, `constructMembers()`, `removeMembers()`, `updateRelationsBetweenMembers()`) | `addMember()` invites a guest by email, SIP address, or phone number; reconciliation creates new `Member` projections for added and updated participants and computes the ids reported in the roster update payload. | Preserve member id keying, the kept `pairedWith.memberId`, and local comparison behavior; updated participants are new `Member` objects. | `src/members/index.ts`, `src/member/index.ts` | [architecture](../../../docs/architecture.md) |
|
|
139
|
+
| `members-api` | SDK / remote | `cancelPhoneInvite()`, `cancelInviteByMemberId()`, `admitMembers()`, `removeMember()`, and `muteMember()` | Execute invitation/lobby/removal/mute operations against current Locus/member URLs. | Preserve request inputs and each method's actual caller-visible failure boundary: returned rejections are common, while `admitMembers()` can surface a synchronous `MembersRequest.admitMember()` validation throw. No blanket local capability pre-check exists for any operation. | `src/members/index.ts`, `src/members/request.ts` | [architecture](../../../docs/architecture.md) |
|
|
140
|
+
| `members-api` | SDK / remote | `assignRoles()`, `moveToLobby()`, `raiseOrLowerHand()`, `lowerAllHands()`, and `transferHostToMember()` | Mutate participant roles, lobby placement, hand state, or host assignment. | Preserve role/action body shapes, the reclaim-host error mapping of `assignRoles()`, the breakout `authorizingLocusUrl`, and current per-method validation. | `src/members/index.ts`, `src/members/request.ts` | [architecture](../../../docs/architecture.md) |
|
|
141
|
+
| `members-api` | SDK / remote | `sendDialPadKey()` and `editDisplayName()` | Send member-scoped DTMF to the member's SIP device or display-name changes through the request adapter. | Preserve target member/device/session context and caller-visible request errors. | `src/members/index.ts`, `src/members/request.ts` | [architecture](../../../docs/architecture.md) |
|
|
142
|
+
| `members-api` | SDK / query | `findMemberByCsi()` and `getCsisForMember()` | Resolve media CSI/member relationships from the current roster projection and the CSI history. | Preserve `undefined` and empty-array outcomes for unresolved mappings. | `src/members/index.ts` | [architecture](../../../docs/architecture.md) |
|
|
143
|
+
| `members-api` (outbound: `locus-http`) | request/types | `MembersRequest.addMembers()`, `admitMember()`, `removeMember()`, `muteMember()`, `assignRolesMember()`, `moveToLobbyMember()`, `raiseOrLowerHandMember()`, `lowerAllHandsMember()`, `editDisplayNameMember()`, `transferHostToMember()`, `sendDialPadKey()`, `cancelPhoneInvite()`, and `cancelInviteByMemberId()` plus `ServerRoles`, `ServerRoleShape`, `RoleAssignmentOptions`, `RoleAssignmentBody`, and `RoleAssignmentRequest` | Provide the direct HTTP boundary and exact role-assignment vocabulary used by the facade. | Request helpers do not own roster mutation; role raw values are compatibility-sensitive. | `src/members/request.ts`, `src/members/types.ts` | [architecture](../../../docs/architecture.md) |
|
|
144
|
+
|
|
145
|
+
Contract ID `members-api` is indexed in the
|
|
146
|
+
[package architecture](../../../docs/architecture.md) and registered in `.sdd/manifest.json`; this
|
|
147
|
+
module requires `member-model` and `locus-http`.
|
|
148
|
+
|
|
149
|
+
Compatibility notes:
|
|
150
|
+
|
|
151
|
+
- Prefer additive options and payload fields. Preserve method/event names, rejection semantics, and
|
|
152
|
+
cleanup timing; route public changes through the owning `Meeting` object, because `src/index.ts`
|
|
153
|
+
does not export `Members` and applications reach it as `meeting.members`.
|
|
154
|
+
|
|
155
|
+
### Emitted events
|
|
156
|
+
|
|
157
|
+
Current source emits or forwards these observable literals for this operation boundary. Preserve literal values, scope, payload shape, and emission timing; a constant name alone is not a substitute for the consumer-visible value.
|
|
158
|
+
|
|
159
|
+
| Event literal | Constant / expression | Emission evidence |
|
|
160
|
+
|---|---|---|
|
|
161
|
+
| `members:clear` | `EVENT_TRIGGERS.MEMBERS_CLEAR` | `src/members/index.ts` |
|
|
162
|
+
| `members:content:update` | `EVENT_TRIGGERS.MEMBERS_CONTENT_UPDATE` | `src/members/index.ts` |
|
|
163
|
+
| `members:host:update` | `EVENT_TRIGGERS.MEMBERS_HOST_UPDATE` | `src/members/index.ts` |
|
|
164
|
+
| `members:self:update` | `EVENT_TRIGGERS.MEMBERS_SELF_UPDATE` | `src/members/index.ts` |
|
|
165
|
+
| `members:update` | `EVENT_TRIGGERS.MEMBERS_UPDATE` | `src/members/index.ts` |
|
|
166
|
+
|
|
167
|
+
Payloads, all emitted through `Trigger.trigger` on the `Members` instance with `file: 'members'`:
|
|
168
|
+
`members:update` carries `{delta: {added, updated, removedIds}, full, isReplace}`;
|
|
169
|
+
`members:clear` carries `{}`; `members:host:update` carries `{activeHostId, endedHostId}`;
|
|
170
|
+
`members:self:update` carries `{activeSelfId, endedSelfId}`; `members:content:update` carries
|
|
171
|
+
`{activeSharingId, endedSharingId}`.
|
|
172
|
+
|
|
173
|
+
## Dependencies
|
|
174
|
+
|
|
175
|
+
Locus participant updates, Member models, meeting/Locus URLs, the request helper, event utilities,
|
|
176
|
+
and the multistream receive-slot manager; role and capability state is decided by Locus, not here.
|
|
177
|
+
|
|
178
|
+
| Dependency | Why it is required | Failure behavior |
|
|
179
|
+
| ---------- | ------------------ | ---------------- |
|
|
180
|
+
| `Meeting` and `LocusInfo` (`src/meeting/index.ts`) | Construct Members and call `locusParticipantsUpdate`, `locusHostUpdate`, `locusSelfUpdate`, `locusMediaSharesUpdate`, `locusUrlUpdate`, and `locusFullStateTypeUpdate` from LocusInfo events | A missing `participants` array is logged as a warning and treated as no change |
|
|
181
|
+
| `Member` and `MemberUtil` (`src/member`) | Build one model per participant and extract CSIs for the history map | Owned by the member module |
|
|
182
|
+
| `MeetingUtil.generateLocusDeltaRequest` (`src/meeting/util.ts`) | Sends every request through `meeting.request` and applies the Locus response | Resolves `undefined` without a request when the meeting was garbage-collected; request rejections propagate to the caller |
|
|
183
|
+
| `Trigger` (`src/common/events/trigger-proxy.ts`) | Emits the `members:*` events on the instance | — |
|
|
184
|
+
| `ParameterError`, reclaim-host errors (`src/common/errors`) | Typed rejections for invalid arguments and for the assign-roles error codes | — |
|
|
185
|
+
| `ReceiveSlotManager` (`src/multistream/receiveSlotManager.ts`) | `updateMemberIds()` after each participants update so receive slots re-resolve their member | Optional; skipped when absent |
|
|
186
|
+
| `LoggerProxy` (`src/common/logs/logger-proxy.ts`) | Warning for a missing participants payload | — |
|
|
187
|
+
| `lodash` (`get`, `set`, `isEmpty`, `isEqual`, `has`), `uuid` | Keeping `pairedWith.memberId`, the empty-id check, the device-change check, optional body fields, and the DTMF correlation id | — |
|
|
188
|
+
| Locus service (external) | Applies every participant control and is the source of roster truth | Errors propagate as rejections, mapped for assign-roles |
|
|
189
|
+
|
|
190
|
+
## Requirements
|
|
191
|
+
|
|
192
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
193
|
+
|---|---|---|---|---|---|---|
|
|
194
|
+
| `MEMBERS-R-001` | `Meeting` constructs one `Members` with `{locusUrl, receiveSlotManager, mediaRequestManagers, meeting}`; it creates a `MembersRequest` bound to that meeting and an empty `MembersCollection`, then initializes and reconciles the members collection from `LocusInfo` callbacks. | Owns the meeting roster collection, reconciles participant updates, performs participant mutations, and emits member events for exactly one meeting. | `src/members/index.ts`, `src/meeting/index.ts` | `test/unit/spec/members/index.js` | none | PRESENT |
|
|
195
|
+
| `MEMBERS-R-002` | admit/remove/mute/assign-role/transfer-host and related participant controls build options with `MembersUtil` and send them through `MembersRequest` to Locus participant or controls URLs under the current `locusUrl`; none edits the collection. | Participant controls target distinct URLs/bodies, while roster state changes only from authoritative Locus updates. | `src/members/index.ts`, `src/members/request.ts`, `src/members/util.ts` | `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js` | mixed add/update/remove reconciliation needs one-payload assertions | PRESENT |
|
|
196
|
+
| `MEMBERS-R-003` | Server failures reject their caller, while validation may either return a rejected promise or throw synchronously at the request-helper boundary; malformed roster updates follow existing diff rules, and `clearMembers()` records current CSIs in the history map, resets the collection, and emits `members:clear`. | Callers must handle the actual synchronous-versus-promise boundary, while roster consumers need one authoritative update payload and a deterministic local reset. | `src/members/index.ts`, `src/members/request.ts` | `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js` | none | PRESENT |
|
|
197
|
+
| `MEMBERS-R-004` | Roster reconciliation keeps one Member per participant id and emits `{delta, full, isReplace}`; `delta` is `{added, updated, removedIds}` with new `Member` models for added and updated participants, `full` is the current collection map, and `isReplace` first clears the collection. Only `pairedWith.memberId` is carried from the old model. | One entry per id and the exact wrapper shape let consumers distinguish incremental versus replacement updates without inventing top-level changed/removed fields; the TODO in `update()` records that comparing old and new members was deferred as premature optimization. | `src/members/index.ts`, `src/members/collection.ts` | `test/unit/spec/members/index.js`, `test/unit/spec/members/collection.js` | consumers must not rely on object identity across updates | PRESENT |
|
|
198
|
+
| `MEMBERS-R-005` | Host, self, and active-content changes emit their dedicated member events with active/ended ids: `{activeHostId, endedHostId}`, `{activeSelfId, endedSelfId}`, and `{activeSharingId, endedSharingId}`, after setting `isHost`, `isSelf`, or `isContentSharing` on the members found. | These roles/streams can change independently of general participant fields and consumers need focused transitions. | `src/members/index.ts`, `src/constants.ts` | `test/unit/spec/meeting/index.js` | no members-level test of locusHostUpdate or locusSelfUpdate | PRESENT |
|
|
199
|
+
| `MEMBERS-R-006` | Participant mutations use current Locus/device/participant context and propagate server rejection. | Admit, remove, mute, and role changes are privileged remote state, not optimistic local edits. | `src/members/index.ts`, `src/members/request.ts` | `test/unit/spec/members/request.js` | none | PRESENT |
|
|
200
|
+
| `MEMBERS-R-007` | Before a member is removed, before the collection is cleared, and when an updated member's devices change, the member's CSIs are recorded in `memberIdByHistoryCsi`; `findMemberByCsi(csi)` prefers a current device match and falls back to that map, resolving only members still in the collection. | The code comments: the map is kept on Members so a CSI a member used earlier still resolves after members are removed and re-added, for example when entering or leaving a breakout session. | `src/members/index.ts` | `test/unit/spec/members/index.js` | none | PRESENT |
|
|
201
|
+
| `MEMBERS-R-008` | After each participants update, `updateRelationsBetweenMembers` links a member whose `pairedWith.participantUrl` is set to the member with that participant URL (adding it to `associatedUsers`, setting the deprecated `associatedUser` to the first one, and copying `isPairedWithSelf` and `isHost`), and undoes those links when the URL is gone. | The code comments: these props depend on other members, so they must be computed only after the collection is fully updated; `associatedUser` stays for backwards compatibility although a device can have several users. | `src/members/index.ts` | `test/unit/spec/members/index.js` | none | PRESENT |
|
|
202
|
+
| `MEMBERS-R-009` | `assignRoles(memberId, roles)` rejects a Locus error whose `body.errorCode` is 2400127, 2403135, 2403136, or 2409150 with `ReclaimHostNotSupportedError`, `ReclaimHostNotAllowedError`, `ReclaimHostEmptyWrongKeyError`, or `ReclaimHostIsHostAlreadyError`, and rejects any other error unchanged. | Reclaiming the host role with a host key has distinct failure reasons that the caller must tell apart; the error classes name them (`ASSIGN_ROLES_ERROR_CODES`). | `src/members/index.ts`, `src/constants.ts`, `src/common/errors/reclaim-host-role-errors.ts` | `test/unit/spec/members/index.js` | none | PRESENT |
|
|
203
|
+
| `MEMBERS-R-010` | `admitMembers(memberIds, sessionLocusUrls)` sends to `mainLocusUrl` when given and adds `authorizingLocusUrl` to the body; `transferHostToMember(memberId, moderator, breakoutLocusUrl)` sends to `breakoutLocusUrl` when given and adds the main `locusUrl` as `authorizingLocusUrl` when they differ. | The builder comment: a host or cohost in a breakout session must admit against the main session's Locus; the JSDoc: a breakout host transfer is sent against the breakout session's Locus. | `src/members/index.ts`, `src/members/util.ts` | `test/unit/spec/members/index.js`, `test/unit/spec/members/utils.js`, `test/unit/spec/members/request.js` | none | PRESENT |
|
|
204
|
+
| `MEMBERS-R-011` | `addMember(invitee, alertIfActive)` rejects without a `locusUrl` and, unless `invitee.skipEmailValidation === true`, rejects an invitee whose phone number fails the E.164 or internal-number pattern or whose email/SIP address fails `VALID_EMAIL_ADDRESS` and the SIP pattern; otherwise it PUTs `{invitees: [{address, roles?, isInternalNumber?}], alertIfActive}` to the locus URL. | The JSDoc: adds a guest member to the associated meeting by email, emailAddress, or phoneNumber. | `src/members/index.ts`, `src/members/util.ts` | `test/unit/spec/members/index.js`, `test/unit/spec/members/utils.js` | none | PRESENT |
|
|
205
|
+
| `MEMBERS-R-012` | `sendDialPadKey(tones, memberId)` rejects without tones (0 is allowed) or without a member, and otherwise sends the tones to the member's first `SIP` device URL with a fresh `correlationId` and `direction: 'transmit'`. | The JSDoc: send DTMF tones for the PSTN member of a meeting, which is reached through its SIP device. | `src/members/index.ts`, `src/members/util.ts` | `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js` | none | PRESENT |
|
|
206
|
+
| `MEMBERS-R-013` | `getCsisForMember(memberId, mediaType = 'video', mediaContent = 'main')` returns the CSIs of the member's device media sessions that match both values, or an empty array. | The JSDoc: return a member's CSIs matching the media type ('audio' or 'video') and content ('main' or 'slides'). | `src/members/index.ts` | `test/unit/spec/members/index.js` | none | PRESENT |
|
|
207
|
+
| `MEMBERS-R-014` | `setLocusUrl`, `setHostId`, `setType`, `setSelfId`, `setMediaShareContentId`, and `setMediaShareWhiteboardId` take an explicit value first, else derive it from the Locus or full-state object (null when absent there), else throw `ParameterError`. | The JSDoc of each: the explicit value is optional and takes precedence over the Locus object. | `src/members/index.ts` | none found | none | PRESENT |
|
|
208
|
+
|
|
209
|
+
## Design overview
|
|
210
|
+
|
|
211
|
+
`Members` owns roster collection reconciliation and member-control requests. `index.ts` computes the
|
|
212
|
+
added/updated/removed delta in `update()`; `handleLocusInfoUpdatedParticipants()` updates contextual
|
|
213
|
+
ids, delegates participant reconciliation to `update()`, and attaches the removed participant ids,
|
|
214
|
+
then `handleMembersUpdate()` writes updated and added models and removes the removed ids before
|
|
215
|
+
`locusParticipantsUpdate()` wraps the result with the full collection and `isReplace`.
|
|
216
|
+
`collection.ts` stores `Member` models and `request.ts` sends admit/remove/mute/role operations to
|
|
217
|
+
current Locus URLs.
|
|
218
|
+
|
|
219
|
+
`Members` is a `StatelessWebexPlugin` that holds plain fields rather than ampersand state. It keeps
|
|
220
|
+
the context Locus gives it (host, self, type, sharer, recording id) because every new `Member` is
|
|
221
|
+
constructed with those ids. Removal and reset do not erase the CSI history map, so media lookups
|
|
222
|
+
survive breakout moves (`MEMBERS-R-007`). Paired-device relations are a second pass because they
|
|
223
|
+
read other members (`MEMBERS-R-008`).
|
|
224
|
+
|
|
225
|
+
The control methods share one shape: check `locusUrl`, check the id, build options with
|
|
226
|
+
`MembersUtil`, and call the matching `MembersRequest` method, which checks its options again and
|
|
227
|
+
throws `ParameterError` synchronously when they are incomplete. Because the facade methods are not
|
|
228
|
+
`async`, that second check surfaces as a throw, not a rejection.
|
|
229
|
+
|
|
230
|
+
## Data flow and sequence coverage
|
|
231
|
+
|
|
232
|
+
Call style: in-process method calls from `Meeting` and applications; Locus input arrives as
|
|
233
|
+
`LocusInfo` event callbacks; outbound HTTPS to the Locus service through the meeting's
|
|
234
|
+
`locusDeltaRequest`; output as `members:*` events through `Trigger`.
|
|
235
|
+
|
|
236
|
+
```mermaid
|
|
237
|
+
flowchart LR
|
|
238
|
+
Locus[Locus participant updates] --> Controller[index.ts]
|
|
239
|
+
Controller --> Delta[index.ts update and handleLocusInfoUpdatedParticipants]
|
|
240
|
+
Delta --> Collection[collection.ts]
|
|
241
|
+
Collection --> Member[src/member]
|
|
242
|
+
Caller[Meeting / consumer] --> Controller
|
|
243
|
+
Controller --> Request[request.ts]
|
|
244
|
+
Request --> Locus
|
|
245
|
+
Controller --> Events[members update/host/self/content events]
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Sequence coverage:
|
|
249
|
+
|
|
250
|
+
| Operation group | Diagram | Failure coverage |
|
|
251
|
+
|---|---|---|
|
|
252
|
+
| UC-1 — roster reconciliation operation group | Roster reconciliation sequence | missing participants payload, `isReplace` clear, removed ids, hidden-roster participants, and the single update payload |
|
|
253
|
+
| UC-1…UC-5 — roster and member-control failure paths, carried by the Roster reconciliation sequence and Member-control request sequence | Roster reconciliation sequence and Member-control request sequence, alt branches | missing member/Locus URL, request rejection or synchronous validation throw, or inconsistent roster update; no blanket local capability gate |
|
|
254
|
+
| Host, self, and content changes | Host, self, and content update sequence | member not in the collection (event still emitted), floor released, sharer changed |
|
|
255
|
+
| UC-3…UC-5 — member-control requests | Member-control request sequence | guard rejection, request-class throw, Locus rejection, reclaim-host error mapping, meeting garbage-collected |
|
|
256
|
+
| UC-2 — CSI queries | `src/members/index.ts` (synchronous reads, MEMBERS-R-007, MEMBERS-R-013) | `undefined` or empty array |
|
|
257
|
+
|
|
258
|
+
### Roster reconciliation sequence
|
|
259
|
+
|
|
260
|
+
```mermaid
|
|
261
|
+
sequenceDiagram
|
|
262
|
+
participant L as Locus update
|
|
263
|
+
participant M as Members index.ts
|
|
264
|
+
participant D as index.ts delta methods
|
|
265
|
+
participant C as collection.ts
|
|
266
|
+
participant R as ReceiveSlotManager
|
|
267
|
+
participant E as roster consumers
|
|
268
|
+
L-->>M: locusParticipantsUpdate({participants, isReplace, removedParticipantIds})
|
|
269
|
+
opt isReplace
|
|
270
|
+
M->>C: clearMembers records CSIs, then reset
|
|
271
|
+
M-->>E: emit members:clear
|
|
272
|
+
end
|
|
273
|
+
M->>D: update / handleLocusInfoUpdatedParticipants
|
|
274
|
+
D-->>M: added/updated models and removed ids
|
|
275
|
+
M->>C: reconcile Member models (set updated and added, remove removed ids)
|
|
276
|
+
M->>M: updateRelationsBetweenMembers for paired devices
|
|
277
|
+
M->>R: updateMemberIds()
|
|
278
|
+
M->>M: wrap {delta, full, isReplace}
|
|
279
|
+
M-->>E: emit members:update
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Host, self, and content update sequence
|
|
283
|
+
|
|
284
|
+
```mermaid
|
|
285
|
+
sequenceDiagram
|
|
286
|
+
participant I as LocusInfo via Meeting
|
|
287
|
+
participant M as Members
|
|
288
|
+
participant C as collection.ts
|
|
289
|
+
participant E as roster consumers
|
|
290
|
+
I-->>M: locusHostUpdate({newHost, oldHost})
|
|
291
|
+
M->>C: get(newHost.id).setIsHost(true), get(oldHost.id).setIsHost(false) when present
|
|
292
|
+
M-->>E: members:host:update {activeHostId, endedHostId}
|
|
293
|
+
I-->>M: locusSelfUpdate({newSelf, oldSelf})
|
|
294
|
+
M->>C: setIsSelf(true / false) when present
|
|
295
|
+
M-->>E: members:self:update {activeSelfId, endedSelfId}
|
|
296
|
+
I-->>M: locusMediaSharesUpdate({current, previous})
|
|
297
|
+
alt content or whiteboard floor GRANTED
|
|
298
|
+
M->>M: record sharer id, clear the other share id
|
|
299
|
+
else previously GRANTED, now RELEASED or another beneficiary
|
|
300
|
+
M->>M: record who stopped
|
|
301
|
+
end
|
|
302
|
+
M->>C: setIsContentSharing(true / false) when present
|
|
303
|
+
M-->>E: members:content:update {activeSharingId, endedSharingId}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Member-control request sequence
|
|
307
|
+
|
|
308
|
+
```mermaid
|
|
309
|
+
sequenceDiagram
|
|
310
|
+
participant A as Caller (Meeting or application)
|
|
311
|
+
participant M as Members
|
|
312
|
+
participant Q as MembersRequest
|
|
313
|
+
participant D as meeting locusDeltaRequest
|
|
314
|
+
participant S as Locus service
|
|
315
|
+
A->>M: control method (for example muteMember(memberId))
|
|
316
|
+
alt no locusUrl or no required id
|
|
317
|
+
M--xA: rejected ParameterError
|
|
318
|
+
else options built by MembersUtil
|
|
319
|
+
M->>Q: request method(options)
|
|
320
|
+
alt options incomplete (for example admitMember without locusUrl)
|
|
321
|
+
Q--xA: synchronous ParameterError throw
|
|
322
|
+
else
|
|
323
|
+
Q->>D: {method, uri, body}
|
|
324
|
+
alt meeting no longer referenced
|
|
325
|
+
D-->>A: resolves undefined, no request
|
|
326
|
+
else
|
|
327
|
+
D->>S: meeting.request
|
|
328
|
+
alt Locus rejects
|
|
329
|
+
S--xA: rejection (assignRoles maps reclaim-host codes)
|
|
330
|
+
else
|
|
331
|
+
S-->>D: response, Locus updated when the URI is under the meeting locusUrl
|
|
332
|
+
D-->>A: response
|
|
333
|
+
end
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
end
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## Class and component relationships
|
|
340
|
+
|
|
341
|
+
```mermaid
|
|
342
|
+
classDiagram
|
|
343
|
+
class StatelessWebexPlugin
|
|
344
|
+
class Members {
|
|
345
|
+
membersCollection
|
|
346
|
+
membersRequest
|
|
347
|
+
locusUrl
|
|
348
|
+
hostId
|
|
349
|
+
selfId
|
|
350
|
+
locusParticipantsUpdate(payload)
|
|
351
|
+
findMemberByCsi(csi)
|
|
352
|
+
muteMember(memberId, mute, isAudio)
|
|
353
|
+
}
|
|
354
|
+
class MembersCollection
|
|
355
|
+
class MembersRequest {
|
|
356
|
+
locusDeltaRequest
|
|
357
|
+
}
|
|
358
|
+
class MembersUtil
|
|
359
|
+
class Member
|
|
360
|
+
class Meeting
|
|
361
|
+
class Locus
|
|
362
|
+
StatelessWebexPlugin <|-- Members
|
|
363
|
+
StatelessWebexPlugin <|-- MembersRequest
|
|
364
|
+
Meeting --> Members : caller and Locus events
|
|
365
|
+
Members --> MembersCollection : collection
|
|
366
|
+
MembersCollection --> Member : member models
|
|
367
|
+
Members --> MembersRequest : request
|
|
368
|
+
Members ..> MembersUtil : options
|
|
369
|
+
MembersRequest ..> MembersUtil : request params
|
|
370
|
+
MembersRequest ..> Locus : locusDeltaRequest
|
|
371
|
+
Members ..> Trigger : events
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
The arrows identify ownership and delegation inside `src/members/`; files that only declare types or constants are not presented as transports.
|
|
375
|
+
|
|
376
|
+
## Use cases and flows
|
|
377
|
+
|
|
378
|
+
| Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
|
|
379
|
+
| -------- | --------------- | ------------------------- | ---------------------------- | -------- |
|
|
380
|
+
| `UC-1` | LocusInfo, through Meeting | Replace or incrementally reconcile Locus participants into `Member` models keyed by participant id and emit one `members:update` (`MEMBERS_UPDATE`) payload shaped as `{delta, full, isReplace}` | Hidden-roster participants are skipped; a missing participants list is logged and yields an empty delta | `src/members/index.ts`, `src/members/collection.ts`, `test/unit/spec/members/index.js` |
|
|
381
|
+
| `UC-2` | Meeting and multistream media | Resolve member/CSI relationships for media consumers from the current roster with `findMemberByCsi` and `getCsisForMember` | Falls back to the CSI history map; `undefined` or an empty array when unresolved | `src/members/index.ts`, `test/unit/spec/members/index.js` |
|
|
382
|
+
| `UC-3` | Host or application | Cancel invitations, admit lobby members, remove or mute a participant using current Locus/member request context | Rejects without a locus URL or id; `admitMembers` can throw synchronously | `src/members/index.ts`, `src/members/request.ts`, `test/unit/spec/members/request.js` |
|
|
383
|
+
| `UC-4` | Host or application | Assign roles, move to lobby, raise/lower hands, lower all hands, or transfer host using each method's actual validation/body | Reclaim-host errors are mapped; breakout host transfer adds `authorizingLocusUrl` | `src/members/index.ts`, `src/members/request.ts`, `test/unit/spec/members/index.js` |
|
|
384
|
+
| `UC-5` | Application | Send member DTMF or edit a display name and propagate the request adapter's outcome | DTMF needs the member and its SIP device; display name needs a requesting participant id | `src/members/index.ts`, `src/members/request.ts`, `test/unit/spec/members/index.js` |
|
|
385
|
+
| `UC-6` | Host or application | `addMember(invitee, alertIfActive)` invites a guest by email, SIP address, or phone number | Invalid invitee rejects unless `skipEmailValidation` is true | `src/members/index.ts`, `src/members/util.ts`, `test/unit/spec/members/index.js` |
|
|
386
|
+
|
|
387
|
+
<!-- Include if: the module calls another service or crosses an event or network boundary. [condition-id: module.crosses_service_boundaries] -->
|
|
388
|
+
|
|
389
|
+
### Cross-boundary use-case flow
|
|
390
|
+
|
|
391
|
+
Every request is one HTTPS call to the Locus service through `locusDeltaRequest` (`src/meeting/util.ts`),
|
|
392
|
+
issued once with no retry or timeout of its own; the Locus response is applied to the meeting's Locus
|
|
393
|
+
only when the request URI starts with the meeting's `locusUrl`. Inbound Locus state arrives through
|
|
394
|
+
`LocusInfo` events in the order `Meeting` receives them.
|
|
395
|
+
|
|
396
|
+
| Operation | Method and URI | Body |
|
|
397
|
+
| --------- | -------------- | ---- |
|
|
398
|
+
| `addMember` | PUT `<locusUrl>` | `{invitees: [{address, roles?, isInternalNumber?}], alertIfActive}` |
|
|
399
|
+
| `cancelPhoneInvite` | PUT `<locusUrl>` | `{actionType: 'REMOVE', invitees: [{address: phoneNumber}]}` |
|
|
400
|
+
| `cancelInviteByMemberId` | PUT `<locusUrl>` | `{actionType: 'REMOVE', invitees: [{address: memberId, isInternalNumber?}]}` |
|
|
401
|
+
| `admitMembers` | PUT `<mainLocusUrl or locusUrl>/controls` | `{authorizingLocusUrl?, admit: {participantIds}}` |
|
|
402
|
+
| `removeMember` | PUT `<locusUrl>/participant/<id>/leave` | `{reason: 'FORCED'}` |
|
|
403
|
+
| `muteMember` | PATCH `<locusUrl>/participant/<id>/controls` | `{audio: {muted}}`, or `{video: {muted}}` when `isAudio` is false |
|
|
404
|
+
| `assignRoles` | PATCH `<locusUrl>/participant/<id>/controls` | `{role: {roles: [{type, hasRole, hostKey?}]}}` |
|
|
405
|
+
| `moveToLobby` | PATCH `<locusUrl>/participant/<id>/controls` | `{moveToLobby: {participantIds: [id]}}` |
|
|
406
|
+
| `raiseOrLowerHand` | PATCH `<locusUrl>/participant/<id>/controls` | `{hand: {raised}}` |
|
|
407
|
+
| `lowerAllHands` | PATCH `<locusUrl>/controls` | `{hand: {raised: false, roles?}, requestingParticipantId}` |
|
|
408
|
+
| `transferHostToMember` | PATCH `<breakoutLocusUrl or locusUrl>/participant/<id>/controls` | `{role: {roles: [{hasRole: true, type: 'MODERATOR'}]}, authorizingLocusUrl?}` |
|
|
409
|
+
| `editDisplayName` | POST `<locusUrl>/participant/<id>/alias` | `{aliasValue, requestingParticipantId, suffixValue?}` |
|
|
410
|
+
| `sendDialPadKey` | POST `<locusUrl>/participant/<id>/sendDtmf` | `{device: {url}, memberId, dtmf: {correlationId, tones, direction: 'transmit'}}` |
|
|
411
|
+
|
|
412
|
+
<!-- Include if: the module holds client-side state. [condition-id: module.holds_client_state] -->
|
|
413
|
+
|
|
414
|
+
## Client state model
|
|
415
|
+
|
|
416
|
+
The roster collection, the self/host/sharer/recording ids, the meeting type, and the CSI history are
|
|
417
|
+
scoped to one meeting's `Members` instance; the module adds no event listeners of its own.
|
|
418
|
+
|
|
419
|
+
| State or slice | Owner | Initial state | Transition triggers | Reset or persistence boundary |
|
|
420
|
+
| -------------- | ---------- | ------------- | ------------------- | ----------------------------- |
|
|
421
|
+
| `membersCollection.members` | `MembersCollection` | `{}` | `locusParticipantsUpdate` adds, replaces, and removes | `clearMembers` (and `isReplace`) resets it; memory only |
|
|
422
|
+
| `locusUrl` | `Members` | `attrs.locusUrl` or `null` | `locusUrlUpdate`, `setLocusUrl` | Memory only |
|
|
423
|
+
| `hostId`, `selfId` | `Members` | `null` | `locusHostUpdate`, `locusSelfUpdate`, the participants payload, `setHostId`, `setSelfId` | Memory only |
|
|
424
|
+
| `type` | `Members` | `null` | `locusFullStateTypeUpdate`, `setType` | Memory only |
|
|
425
|
+
| `mediaShareContentId`, `mediaShareWhiteboardId` | `Members` | `null` | `locusMediaSharesUpdate`, the two setters; granting one clears the other | Memory only |
|
|
426
|
+
| `recordingId` | `Members` | `null` | Every participants payload overwrites it | Memory only |
|
|
427
|
+
| `memberIdByHistoryCsi` | `Members` | empty `Map` | Member removal, `clearMembers`, an update whose devices changed | Never cleared for the life of the instance (`MEMBERS-R-007`) |
|
|
428
|
+
|
|
429
|
+
<!-- Include if: the module enforces domain rules or entity invariants. [condition-id: module.enforces_domain_rules] -->
|
|
430
|
+
|
|
431
|
+
## Business rules and invariants
|
|
432
|
+
|
|
433
|
+
Each participant id maps to one current Member and removed participants leave the collection. Remote
|
|
434
|
+
mutations validate their own ids/Locus context, but `Members` does not apply a blanket
|
|
435
|
+
meeting-capability check before sending them.
|
|
436
|
+
|
|
437
|
+
| ID | Invariant | WHY | Enforcement source | Test evidence |
|
|
438
|
+
| -- | --------- | --- | ------------------ | ------------- |
|
|
439
|
+
| `INV-001` | The collection key is the member id, which equals the participant id, so `removedParticipantIds` remove members directly. | The code comment: removal depends on member ids being the same as participant ids. | `src/members/index.ts`, `src/members/collection.ts` | `test/unit/spec/members/index.js` |
|
|
440
|
+
| `INV-002` | No control method edits the collection or the context ids; only Locus callbacks do. | Admit, remove, mute, and role changes are privileged remote state confirmed by Locus (`MEMBERS-R-006`). | `src/members/index.ts` | `test/unit/spec/members/request.js` |
|
|
441
|
+
| `INV-003` | Paired-device relations are computed after the collection holds every updated and added member. | The code comment: updateRelationsBetweenMembers must run only after the collection is fully updated. | `src/members/index.ts` | `test/unit/spec/members/index.js` |
|
|
442
|
+
| `INV-004` | Every control except `admitMembers`, `sendDialPadKey`, and `transferHostToMember` (which uses its breakout URL first) rejects with `ParameterError` before any request when `locusUrl` is unset. | Each request targets a URL under the meeting's Locus; the messages say the locus URL must be defined. | `src/members/index.ts` | `test/unit/spec/members/index.js` |
|
|
443
|
+
|
|
444
|
+
<!-- Include if: the module is concurrent, asynchronous, reactive, or event-driven. [condition-id: module.is_concurrent_async] -->
|
|
445
|
+
|
|
446
|
+
## Concurrency and reactive flow
|
|
447
|
+
|
|
448
|
+
- Roster reconciliation keys additions, updates, and removals by current participant/member identity
|
|
449
|
+
before mutating the collection. `clearMembers()` resets the local member models; member-control
|
|
450
|
+
requests settle independently and do not turn a rejected server action into a local optimistic
|
|
451
|
+
update.
|
|
452
|
+
- Execution model: one JavaScript event loop. The `locus*` callbacks run synchronously from
|
|
453
|
+
`LocusInfo` events and emit their events before returning; control methods return promises.
|
|
454
|
+
- Ordering guarantees: within one participants update, `members:clear` (when replacing) precedes the
|
|
455
|
+
reconciliation, relations, `updateMemberIds()`, and `members:update`. Nothing orders control
|
|
456
|
+
requests against each other or against later Locus updates.
|
|
457
|
+
- Idempotency and retry: repeated participants updates replace models with fresh ones; no request is
|
|
458
|
+
retried here.
|
|
459
|
+
- Shared-state protection: none beyond the single thread; the instance belongs to one meeting.
|
|
460
|
+
|
|
461
|
+
<!-- Include if: the module returns or raises errors callers must handle. [condition-id: module.returns_caller_errors] -->
|
|
462
|
+
|
|
463
|
+
## Caller-visible failure modes
|
|
464
|
+
|
|
465
|
+
| Condition | Signal | Caller recovery |
|
|
466
|
+
|---|---|---|
|
|
467
|
+
| Required input to a synchronous context setter such as `setLocusUrl()`, `setHostId()`, `setType()`, `setSelfId()`, `setMediaShareContentId()`, or `setMediaShareWhiteboardId()` is absent | The setter throws `ParameterError` synchronously. | Supply the direct value or its accepted Locus/full-state container before calling. |
|
|
468
|
+
| `admitMembers()` receives an empty member-id array | It returns a rejected `ParameterError` promise before constructing request options. | Supply at least one member id and handle the returned rejection. |
|
|
469
|
+
| `admitMembers()` receives member ids but its generated request options lack `locusUrl` | `MembersRequest.admitMember()` throws `ParameterError` synchronously; `admitMembers()` is not `async`, so a chained `.catch()` does not observe this validation error. | Refresh Locus context and catch at the synchronous call boundary when it may be absent. |
|
|
470
|
+
| `sendDialPadKey()` cannot resolve the member | It returns a rejected `ParameterError` promise. | Refresh the roster and retry with a current member id. |
|
|
471
|
+
| `sendDialPadKey()` resolves the member but lacks a Locus URL or SIP device URL | It returns a rejected plain `Error` promise, not `ParameterError`. | Restore the meeting/device call-control context before retrying. |
|
|
472
|
+
| Member-control request rejects | The request promise rejects and no successful server mutation is claimed; `assignRoles()` turns the four reclaim-host error codes into `ReclaimHost*Error` rejections. | Handle the rejection before attempting a later action. |
|
|
473
|
+
| Accepted roster update adds, changes, or removes participants | The collection reconciles the affected `Member` models and emits one `members:update`; host, self, and content changes arrive as their own events. | Consume the updated collection projection. |
|
|
474
|
+
| A control method runs without `locusUrl` or without its id | It returns a rejected `ParameterError` promise before any request. | Wait for the meeting's Locus URL and pass the id. |
|
|
475
|
+
| `transferHostToMember(memberId, false)` or `editDisplayName()` without a requesting participant id | `MembersRequest` throws `ParameterError` synchronously, because it requires a truthy `moderator` and a `requestingParticipantId`. | Pass those values, or catch at the call. |
|
|
476
|
+
| `addMember()` with an invalid invitee | It returns a rejected `ParameterError` promise unless `skipEmailValidation` is true. | Correct the address or phone number. |
|
|
477
|
+
| The meeting behind `locusDeltaRequest` has been garbage-collected | The request resolves `undefined` and nothing is sent. | Treat as no-op; the meeting is gone. |
|
|
478
|
+
|
|
479
|
+
## Pitfalls and constraints
|
|
480
|
+
|
|
481
|
+
- Roster snapshots and deltas may represent the same participant differently, and every update
|
|
482
|
+
builds a new `Member` object for each participant, so holding a `Member` reference across updates
|
|
483
|
+
sees stale data; read it again from `getAll()` or the `full` payload (`src/members/index.ts`).
|
|
484
|
+
- Public behavior is reachable through the parent `Meeting` object (for example
|
|
485
|
+
`meeting.admitMembers` and `meeting.transferHostToMember` forward here) even though `src/index.ts`
|
|
486
|
+
does not export `Members` directly (`src/meeting/index.ts`).
|
|
487
|
+
- Some validation throws instead of rejecting: `admitMembers` without a locus URL,
|
|
488
|
+
`transferHostToMember` with a falsy `moderator`, and `editDisplayName` without a requesting
|
|
489
|
+
participant id (`src/members/request.ts`).
|
|
490
|
+
- `members:content:update` uses the keys `activeSharingId` and `endedSharingId`; the class JSDoc
|
|
491
|
+
still names `activeContentSharingId` and `endedContentSharingId` (`src/members/index.ts`).
|
|
492
|
+
- `getAll()` returns the collection's live map; mutating it mutates the roster
|
|
493
|
+
(`src/members/collection.ts`).
|
|
494
|
+
|
|
495
|
+
## Verification
|
|
496
|
+
|
|
497
|
+
Use the current mirrored suites: `test/unit/spec/members/collection.js`, `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js`, `test/unit/spec/members/utils.js`. Characterize the members-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
498
|
+
|
|
499
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
500
|
+
|---|---|---|
|
|
501
|
+
| `MEMBERS-R-001` | `test/unit/spec/members/index.js` | constructor case covers the MembersRequest binding; cover CSI queries and every member request family at the facade |
|
|
502
|
+
| `MEMBERS-R-002` | `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js` | mixed add/update/remove reconciliation needs one-payload assertions |
|
|
503
|
+
| `MEMBERS-R-003` | `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js` | assert the synchronous throws of admitMembers, transferHostToMember, and editDisplayName at the facade, without a fabricated global capability gate |
|
|
504
|
+
| `MEMBERS-R-004` | `test/unit/spec/members/index.js`, `test/unit/spec/members/collection.js` | the exact `{delta, full, isReplace}` payload is asserted for replace and removal; no case covers an updated member |
|
|
505
|
+
| `MEMBERS-R-005` | `test/unit/spec/meeting/index.js` | no members-level case for locusHostUpdate, locusSelfUpdate, or locusMediaSharesUpdate; verify simultaneous host/content changes |
|
|
506
|
+
| `MEMBERS-R-006` | `test/unit/spec/members/request.js` | verify service rejection and confirm the facade does not invent a local capability-denied branch |
|
|
507
|
+
| `MEMBERS-R-007` | `test/unit/spec/members/index.js` | none |
|
|
508
|
+
| `MEMBERS-R-008` | `test/unit/spec/members/index.js` | none |
|
|
509
|
+
| `MEMBERS-R-009` | `test/unit/spec/members/index.js` | none |
|
|
510
|
+
| `MEMBERS-R-010` | `test/unit/spec/members/index.js`, `test/unit/spec/members/utils.js`, `test/unit/spec/members/request.js` | none |
|
|
511
|
+
| `MEMBERS-R-011` | `test/unit/spec/members/index.js`, `test/unit/spec/members/utils.js` | invalid phone-number rejection is not asserted |
|
|
512
|
+
| `MEMBERS-R-012` | `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js` | the plain-Error branch without a SIP device is not asserted |
|
|
513
|
+
| `MEMBERS-R-013` | `test/unit/spec/members/index.js` | none |
|
|
514
|
+
| `MEMBERS-R-014` | none found | no case covers the setters or their ParameterError throws |
|