@webex/plugin-team-memberships 3.13.0-next.4 → 3.13.0-next.6

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.
@@ -0,0 +1,322 @@
1
+ ---
2
+ type: Module Spec
3
+ title: 'Team Memberships plugin specification'
4
+ description: Responsibilities, boundaries, design, invariants, and verification for the Team Memberships plugin module.
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-12T17:50:02Z
13
+ validation_status: pass
14
+ -->
15
+
16
+ # Team Memberships plugin
17
+
18
+ This source-local document at `src/docs/README.md` owns the stable specification for **the Team
19
+ Memberships plugin**: the public plugin `webex.teamMemberships`. It adds people to Webex teams, reads,
20
+ lists, and updates their team memberships, and removes them, through the `team/memberships` resource of
21
+ the Webex REST API (catalog service `hydra`). Each method sends one request and resolves what the
22
+ service returns; nothing is validated, cached, or persisted here. Ground every claim in package evidence
23
+ and link to the [package architecture](../../docs/architecture.md) instead of repeating broader facts.
24
+ No service specification exists because this package is a library.
25
+
26
+ Related context: [documentation index](../../docs/index.md) ·
27
+ [package agent instructions](../../AGENTS.md)
28
+
29
+ ## Metadata
30
+
31
+ | Field | Value |
32
+ | ----------------- | ----- |
33
+ | Owner | @webex/web-sdk |
34
+ | Source path | `src` |
35
+ | Resource kind | package |
36
+ | Status | Draft |
37
+ | Last verified | 2026-11-12 at `46f5268b3a` |
38
+ | Module id | `plugin-team-memberships` |
39
+ | Parent spec | — |
40
+ | Doc kind | Module spec |
41
+ | Coverage score | 100% assessed 2026-11-12 by the generator — 13 of 13 mandatory fields PRESENT, critical 7 of 7; the package has no unit tests and no `test:unit` script, so no requirement has running test evidence; `test/integration/spec/team-memberships.js` holds 8 live-service cases that no script runs |
42
+ | Validation status | Pass — validator runtime 01a1d0de-3a7e-7e50-a7bb-141639802749, 2026-11-12; no findings |
43
+
44
+ ## Applicability
45
+
46
+ | Condition ID | Status | Evidence or reason | Owned section |
47
+ | ------------------------------------ | ---------- | ------------------ | ------------- |
48
+ | `module.has_tiers` | N/A | No tier policy exists in `package.json` or `src/team-memberships.js` | Tier |
49
+ | `module.has_ui` | N/A | `src/team-memberships.js` returns membership records; it renders nothing | UI use-case flow |
50
+ | `module.crosses_service_boundaries` | Applicable | `src/team-memberships.js` calls the Webex REST API team memberships resource | Cross-boundary use-case flow |
51
+ | `module.holds_client_state` | N/A | `src/team-memberships.js` sets no instance property and caches no record | Client state model |
52
+ | `module.enforces_domain_rules` | Applicable | The membership-or-id rule and the 204 handling in `src/team-memberships.js` | Business rules and invariants |
53
+ | `module.is_concurrent_async` | Applicable | Every method in `src/team-memberships.js` returns a promise of a network request | Concurrency and reactive flow |
54
+ | `module.owns_persistence` | N/A | Nothing is stored; `src/team-memberships.js` resolves what the service returns | Data, schema, and migration discipline |
55
+ | `module.stateful_transitions` | N/A | No entity moves through states in `src/team-memberships.js`; moderator is a flag the caller sets | State machine |
56
+ | `module.exposes_wire_protocol` | Applicable | The five team memberships requests built in `src/team-memberships.js` | Protocol and wire format |
57
+ | `module.ui_multi_screen` | N/A | No UI | UI flow |
58
+ | `module.large_data_model` | N/A | One shape, the team membership object, typed only by JSDoc in `src/team-memberships.js`; covered under Protocol and wire format | Data model |
59
+ | `module.returns_caller_errors` | Applicable | Request failures reject, and a missing argument throws, from `src/team-memberships.js` | Caller-visible failure modes |
60
+ | `module.module_specific_conventions` | Applicable | Service hydra, the team/memberships resource, and the object-or-id argument in `src/team-memberships.js` | Module-specific rules |
61
+ | `module.published_package` | Applicable | `package.json` names the package @webex/plugin-team-memberships and defines deploy:npm | Export stability |
62
+ | `module.embedded_in_host` | N/A | No host theme or embed API | Host integration and theming |
63
+ | `module.has_design_tradeoff` | Applicable | Caller objects pass to Hydra unchanged and Hydra results pass back unchanged in `src/team-memberships.js` | Key design trade-off |
64
+ | `module.has_submodules` | N/A | The src directory has no child module | Sub-modules |
65
+
66
+ ## Evidence register
67
+
68
+ | Evidence | What it establishes |
69
+ | -------- | ------------------- |
70
+ | `src/index.js` | `registerPlugin('teamMemberships', TeamMemberships)` with no options; re-exports only the default `TeamMemberships`; imports nothing but `@webex/webex-core` and the class |
71
+ | `src/team-memberships.js` | `TeamMemberships` extends `WebexPlugin` with `create`, `get`, `list`, `remove`, and `update`, and imports `WebexPlugin` and `Page` from `@webex/webex-core`; the `TeamMembershipObject` typedef. Its JSDoc and one code comment are the only recorded rationale |
72
+ | `package.json` | Name, `main` (`dist/index.js`), `devMain` (`src/index.js`), `engines` (`node >=18`), dependencies on `@webex/webex-core` and `@webex/internal-plugin-device`, peer dependencies on `@webex/plugin-logger`, `@webex/plugin-rooms`, and `@webex/plugin-teams`, and scripts; `build`, `build:src`, `test:style`, `test:browser`, `deploy:npm`, and `test` exist, and `test:unit` and `test:integration` do not |
73
+ | `test/integration/spec/team-memberships.js` | 8 live-service cases: `create` by person id, by email, and as moderator; `get`; `list` for a team and with `max: 1` and paging; `update` of the moderator flag; `remove`. It imports the device, logger, rooms, and teams plugins, which `src/` does not. No package script runs it (see Verification) |
74
+ | `README.md` | Retained npm page; context only. Its Usage block is not valid JavaScript; see `docs/adr/0001-retain-product-readme.md` |
75
+ | Sibling package webex-core, file src/docs/README.md | Module spec consulted, agrees with code. `registerPlugin` keeps the first registration of a name (MOD-013) and adds `webex.<name>` to later instances (MOD-014); one request function is the entry for all plugin HTTP traffic (MOD-028); status failures become `WebexHttpError` (MOD-027) whose message names the method, service, and resource (MOD-048); `WebexPlugin.webex` resolves the root instance (MOD-043); `Page` stores the body items and Link headers and pages with `next` (MOD-054) |
76
+ | Sibling package plugin-rooms, file src/docs/README.md | Module spec consulted for a peer dependency the integration spec uses: `webex.rooms.create(room)` POSTs the body to the rooms resource (MOD-002), which the spec uses to add a room to the test team |
77
+ | Sibling package plugin-teams, file src/teams.js | No module spec exists, so the code is the referee. Importing it registers public plugin `teams`; `create(team)` POSTs the body to resource `teams` of service `hydra` and resolves the body. The integration spec creates its team with it |
78
+ | Sibling packages internal-plugin-device and plugin-logger, file src/docs/README.md of each | Module specs consulted. Importing internal-plugin-device registers internal plugin `device` (device MOD-001); importing plugin-logger registers `logger` with `replace: true` (logger MOD-001). Only the integration spec imports them |
79
+ | Sibling package test-helper-chai, file src/assertions/schemas.js | No module spec exists, so the code is the referee. `assert.isTeamMembership` requires `id`, `teamId`, `personId`, `personEmail`, `isModerator`, and `created`, Hydra ids for the three ids, an email, and an ISO date |
80
+ | Observation, no stated WHY | Behavior the code shows without stating a reason is recorded once, under Pitfalls and constraints or Caller-visible failure modes |
81
+
82
+ ## Purpose and boundary
83
+
84
+ - Responsibility: give applications Webex team memberships as Hydra-style records — add a person to a
85
+ team, read one membership, list memberships, change a membership (the moderator flag), and remove a
86
+ person from a team.
87
+ - In scope: registration of `teamMemberships`; the five public methods; resolving a membership id from
88
+ an object or a string.
89
+ - Out of scope: the request pipeline, authorization, service-catalog resolution, error types, and
90
+ paging (`@webex/webex-core`); teams themselves (`@webex/plugin-teams`); room memberships
91
+ (`@webex/plugin-memberships`); checking who may add or remove members, which the service decides;
92
+ validating or caching membership records; what Hydra stores or returns.
93
+ - Consumers: in this repository `webex` (`src/webex.js`) and `webex-node` (`src/webex-node.js`) import
94
+ the package to register it, and the `webex` integration spec `commonjs.js` checks that
95
+ `webex.teamMemberships` exists. `@webex/test-helper-mock-webex` lists `teamMemberships` among its
96
+ public plugin names. No file under another package's `src/` and no workspace sample calls
97
+ `webex.teamMemberships`. Applications reach the plugin as `webex.teamMemberships`.
98
+
99
+ ## Structure and key files
100
+
101
+ | Path | Responsibility |
102
+ | ---- | -------------- |
103
+ | `src/index.js` | Registers public plugin `teamMemberships` and re-exports the class as default |
104
+ | `src/team-memberships.js` | `TeamMemberships` and the `TeamMembershipObject` typedef |
105
+ | `package.json` | Package name, entry points, scripts, dependencies, and peer dependencies |
106
+ | `babel.config.js`, `jest.config.js` | Re-exports of the legacy Babel and Jest configurations; no unit spec uses the Jest one |
107
+ | `.eslintrc.js` | Sets `root: true` and extends `@webex/eslint-config-legacy` |
108
+ | `process` | Package-root file exporting `{browser: true}`; not imported by `src/` |
109
+ | `src/docs/README.md` | This module specification; ignored by the build and by lint |
110
+ | `test/integration/spec/team-memberships.js` | Live-service cases; only `test:browser` would run them |
111
+ | dist/ (generated) | Build output of `build:src`; ignored by Git and never edited by hand |
112
+
113
+ ## Public surface
114
+
115
+ | Surface | Consumer | Compatibility commitment | Source |
116
+ | ------- | -------- | ------------------------ | ------ |
117
+ | Import side effect: public plugin `teamMemberships` | `webex`, `webex-node` | First registration of the name wins; reached as `webex.teamMemberships` | `src/index.js` |
118
+ | `create(membership)`, `get(membership)`, `update(membership)`, `remove(membership)` | Applications | Hydra team membership records; `remove` resolves `undefined` on 204 | `src/team-memberships.js` |
119
+ | `list(options)` | Applications | Resolves a webex-core `Page` of team membership records | `src/team-memberships.js` |
120
+ | Default export `TeamMemberships` | Hosts that mount the class themselves | The entry exports nothing else | `src/index.js` |
121
+
122
+ Contract ID `team-memberships-public-sdk` is indexed in the
123
+ [package architecture](../../docs/architecture.md#public-and-consumer-surfaces) and registered in
124
+ `.sdd/manifest.json`. Export stability is under [Export stability](#export-stability).
125
+
126
+ ## Dependencies
127
+
128
+ | Dependency | Why it is required | Failure behavior |
129
+ | ---------- | ------------------ | ---------------- |
130
+ | `@webex/webex-core` (module spec consulted) | `registerPlugin`, `WebexPlugin` (`webex`, `request`), `Page`, and the request pipeline that resolves `service: 'hydra'` and adds authorization | A request rejection rejects the method |
131
+ | `@webex/internal-plugin-device` (dependency; module spec consulted) | Listed in `dependencies`, but no file under `src/` imports it; only the integration spec imports it to register `webex.internal.device` | — |
132
+ | `@webex/plugin-teams`, `@webex/plugin-rooms`, `@webex/plugin-logger` (peer dependencies; teams code consulted, rooms and logger specs consulted) | No file under `src/` imports or calls them; the integration spec uses `webex.teams.create` and `webex.rooms.create` to build its test team and imports the logger | — |
133
+ | Webex REST API team memberships resource (external) | Membership records and the membership rules | Errors propagate |
134
+
135
+ ## Requirements
136
+
137
+ | ID | WHAT | WHY | Source evidence | Test or example evidence | Assumptions or gaps | Confidence |
138
+ | -- | ---- | --- | --------------- | ------------------------ | ------------------- | ---------- |
139
+ | `MOD-001` | Importing the package registers `TeamMemberships` as public plugin `teamMemberships` with no config or other options. The entry re-exports only the default `TeamMemberships`. | Applications reach team memberships as `webex.teamMemberships`, and the `webex` and `webex-node` bundles register it by import (inferred from `registerPlugin` and those imports; webex-core MOD-013, MOD-014). | `src/index.js` | `test/integration/spec/team-memberships.js` imports the package and relies on it, but is not run | WHY inferred | Weak |
140
+ | `MOD-002` | `create(membership)` sends `POST team/memberships` to service `hydra` with `membership` as the body through `this.request` and resolves the response body. | The JSDoc: add someone to a team by person id or email address, optionally making them a moderator. | `src/team-memberships.js` | `test/integration/spec/team-memberships.js` create cases by person id, by email, and as moderator (not run) | — | Present |
141
+ | `MOD-003` | `get(membership)` takes `membership.id`, else `membership` itself, sends `GET team/memberships/<id>` to service `hydra` with no query, and resolves `res.body.items` when present, else `res.body`. | The JSDoc: get details for a membership by id. | `src/team-memberships.js` | `test/integration/spec/team-memberships.js` get case (not run) | Why `items` is checked is not stated | Present |
142
+ | `MOD-004` | `list(options)` sends `GET team/memberships` to service `hydra` with `qs: options` and resolves `new Page(res, webex)`. | The JSDoc: lists team memberships, by default those of the teams the authenticated user belongs to. Paging is the webex-core `Page` (webex-core MOD-054). | `src/team-memberships.js` | `test/integration/spec/team-memberships.js` list cases for a team, and with `max: 1` paging through three memberships (not run) | — | Present |
143
+ | `MOD-005` | `update(membership)` takes `membership.id`, else `membership`, sends `PUT team/memberships/<id>` to service `hydra` with the whole `membership` as the body, and resolves the response body. | The JSDoc: updates properties for a membership; the integration spec uses it to turn the moderator flag on and off. | `src/team-memberships.js` | `test/integration/spec/team-memberships.js` update case (not run) | A string argument is sent as the body; see Caller-visible failure modes | Present |
144
+ | `MOD-006` | `remove(membership)` takes `membership.id`, else `membership`, sends `DELETE team/memberships/<id>` to service `hydra`, and resolves `undefined` when the status is 204, else the response body. | The code comment: Firefox has issues with 204s or DELETE, and the handling should move to http-core. | `src/team-memberships.js` | `test/integration/spec/team-memberships.js` remove case expects an empty result and the membership gone from a later list (not run) | — | Present |
145
+
146
+ ## Design overview
147
+
148
+ `TeamMemberships` is a `WebexPlugin` with five methods and no state. Each method sends one request to
149
+ the `team/memberships` resource of catalog service `hydra` through `this.request`, so the webex-core
150
+ interceptors add authorization and resolve the service URL. The caller's object is the request body as
151
+ given, and the response body is the result; `list` wraps the response in a webex-core `Page`, and
152
+ `remove` turns a 204 into `undefined`.
153
+
154
+ `get`, `update`, and `remove` accept a membership object or its id. Who may list, add, change, or
155
+ remove members is decided by the service: the JSDoc says that, as in the Webex app, you must be a
156
+ member of the team to list its memberships or invite people. Nothing is cached; every call reaches the
157
+ service.
158
+
159
+ ## Data flow and sequence coverage
160
+
161
+ Call style: in-process method calls on `webex.teamMemberships`; outbound HTTPS through `webex.request`
162
+ to catalog service `hydra`. There is one operation group, and every method has the same shape: one
163
+ request per call, as Diagram 1 shows.
164
+
165
+ | Operation group | Entry and outcome | Diagram or evidence | Failure and recovery coverage |
166
+ | --------------- | ----------------- | ------------------- | ----------------------------- |
167
+ | Team membership records | `create`, `get`, `list`, `update`, `remove`; one Hydra request each | Diagram 1; `src/team-memberships.js` | The request error rejects; nothing is retried |
168
+
169
+ Diagram 1 — one team membership call:
170
+
171
+ ```mermaid
172
+ sequenceDiagram
173
+ participant C as Caller
174
+ participant T as TeamMemberships
175
+ participant W as webex-core request
176
+ participant H as Webex REST API
177
+ C->>T: create, get, list, update, or remove
178
+ T->>T: id from membership.id, else the argument
179
+ T->>W: request({method, service: 'hydra', resource: 'team/memberships...', body or qs})
180
+ W->>H: HTTPS with SDK authorization
181
+ H-->>W: response
182
+ W-->>T: res, or WebexHttpError
183
+ T-->>C: res.body, a Page, or undefined on 204
184
+ ```
185
+
186
+ ## Class and component relationships
187
+
188
+ ```mermaid
189
+ classDiagram
190
+ class WebexPlugin
191
+ class Page
192
+ class TeamMemberships {
193
+ create(membership)
194
+ get(membership)
195
+ list(options)
196
+ update(membership)
197
+ remove(membership)
198
+ }
199
+ WebexPlugin <|-- TeamMemberships
200
+ TeamMemberships ..> Page : list(options)
201
+ ```
202
+
203
+ ## Use cases and flows
204
+
205
+ | Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
206
+ | -------- | --------------- | ------------------------- | ---------------------------- | -------- |
207
+ | `UC-001` | Application adding a person to a team | `create({teamId, personId})` or `create({teamId, personEmail})`, optionally with `isModerator: true`; resolves the new membership | The Hydra error rejects; the plugin checks no field | `src/team-memberships.js` |
208
+ | `UC-002` | Application listing team members | `list({teamId, max})` resolves a `Page`; `hasNext()` and `next()` fetch further pages | The request error rejects | `src/team-memberships.js` |
209
+ | `UC-003` | Application reading one membership | `get(membership)` or `get(id)` resolves the membership | The request error rejects; a missing argument throws | `src/team-memberships.js` |
210
+ | `UC-004` | Application making someone a moderator, or not | Set `isModerator` on the membership object and `update(membership)`; resolves the updated membership | The request error rejects | `src/team-memberships.js` |
211
+ | `UC-005` | Application removing a person from a team | `remove(membership)` or `remove(id)`; resolves `undefined` on 204 | The request error rejects | `src/team-memberships.js` |
212
+
213
+ ### Cross-boundary use-case flow
214
+
215
+ | Boundary | Transport and ordering | Compatibility | Timeout, retry, and recovery |
216
+ | -------- | ---------------------- | ------------- | ---------------------------- |
217
+ | Webex REST API team memberships resource (`UC-001` to `UC-005`) | HTTPS through `webex.request`, catalog service `hydra`, one request per call | Requests and the membership object under Protocol and wire format | No retry or timeout in this module; webex-core interceptors apply |
218
+
219
+ ## Business rules and invariants
220
+
221
+ | ID | Invariant | WHY | Enforcement source | Test evidence |
222
+ | -- | --------- | --- | ------------------ | ------------- |
223
+ | `INV-001` | Every request goes through `this.request` to service `hydra` and a resource under `team/memberships`. | One request function carries all plugin HTTP traffic, so authorization, the service catalog, and error conversion apply (webex-core MOD-027, MOD-028). | `src/team-memberships.js` | Only `test/integration/spec/team-memberships.js`, which is not run |
224
+ | `INV-002` | `get`, `update`, and `remove` use `membership.id` as the id when it is truthy, and otherwise the argument itself. | The JSDoc types the `get` and `remove` argument as a membership object or a string; `update` is typed as an object only. | `src/team-memberships.js` | Only `test/integration/spec/team-memberships.js`, which passes objects, and is not run |
225
+ | `INV-003` | A 204 answer to `remove` resolves `undefined`, never a body. | The code comment on Firefox and 204 or DELETE responses. | `src/team-memberships.js` | Only `test/integration/spec/team-memberships.js`, which asserts an empty result, and is not run |
226
+ | `INV-004` | The plugin sends the caller's object as the body unchanged and returns the response unchanged; it adds, removes, and checks no field. | Membership rules belong to the service: the JSDoc says you must be a member of a team to list its memberships or invite people (inferred: the plugin does not repeat them). | `src/team-memberships.js` | None found |
227
+
228
+ ## Concurrency and reactive flow
229
+
230
+ - Execution model: one JavaScript event loop; every public method returns the promise of one request.
231
+ - Ordering guarantees: none across calls; each call settles independently, in the order the service
232
+ answers.
233
+ - Parallel work: none inside a method; callers may run several calls at once, as the integration spec
234
+ does with `Promise.all`.
235
+ - Idempotency and retry: `get` and `list` are reads and safe to repeat; `update` with the same body
236
+ repeats to the same end state; `remove` of a removed membership is answered by the service. `create`
237
+ sends a new request each time; what Hydra answers for a person already in the team is not recorded in
238
+ this repository. Nothing is retried here.
239
+ - Fire-and-forget work: none.
240
+ - Shared-state protection: the plugin holds no state.
241
+
242
+ ## Protocol and wire format
243
+
244
+ | Message or frame | Version | Producer or serializer | Consumer or parser | Compatibility and ordering rule |
245
+ | ---------------- | ------- | ---------------------- | ------------------ | ------------------------------- |
246
+ | `POST <hydra>/team/memberships` with the membership body | Unversioned path under the catalog URL | `create` | Webex REST API | Body is the caller's object as given |
247
+ | `GET <hydra>/team/memberships/<id>` | Unversioned | `get` | Webex REST API | No query is sent; the id is interpolated without URL encoding |
248
+ | `GET <hydra>/team/memberships?<options>` | Unversioned | `list` | Webex REST API | Every key of `options` becomes a query parameter; the response is read by `Page` |
249
+ | `PUT <hydra>/team/memberships/<id>` with the membership body | Unversioned | `update` | Webex REST API | The whole argument, `id` included, is the body |
250
+ | `DELETE <hydra>/team/memberships/<id>` | Unversioned | `remove` | Webex REST API | A 204 resolves `undefined` |
251
+ | Team membership object `{id, teamId, personId, personEmail, isModerator, created}` | — | Webex REST API | Callers | The JSDoc typedef names these fields and marks `id` and `created` as server generated; the test assertion `isTeamMembership` expects Hydra ids for `id`, `teamId`, and `personId`, an email, and an ISO `created` date |
252
+
253
+ ## Caller-visible failure modes
254
+
255
+ | Condition | Signal or result | Caller behavior | Retry or recovery | Evidence |
256
+ | --------- | ---------------- | --------------- | ----------------- | -------- |
257
+ | A Hydra request fails, for example when the caller is not a member of the team or the membership does not exist | The method rejects with the webex-core `WebexHttpError`, whose message names the method, service, and resource (webex-core MOD-027, MOD-048) | Handle the error | Call again | `src/team-memberships.js` |
258
+ | `get`, `update`, or `remove` is called with `null` or `undefined` | Reading `membership.id` throws a `TypeError` synchronously; no promise is returned and no request is sent | Pass a membership object or id | — | `src/team-memberships.js` |
259
+ | `get`, `update`, or `remove` is called with an object that has no `id` | The object itself becomes the id, so the path ends in `[object Object]`, and the service's error rejects the method | Pass an object with `id`, or the id | — | `src/team-memberships.js` |
260
+ | `update` is called with an id string | The id is right, but the string is also sent as the request body; what Hydra answers is not recorded in this repository | Pass the membership object | — | `src/team-memberships.js` |
261
+ | `create` is called without `teamId`, or without both `personId` and `personEmail` | The plugin sends the body anyway; the service's error rejects the method | Pass the fields the JSDoc names | — | `src/team-memberships.js` |
262
+
263
+ ## Pitfalls and constraints
264
+
265
+ - `get` accepts no options, unlike `list`, so a query cannot be added to a single read.
266
+ - The `list` JSDoc types `options.max` as a string and its return as the placeholder `[type]`; the
267
+ method resolves a `Page`, whose `length` and `items` the JSDoc example reads.
268
+ - The `get` JSDoc example asserts that the fetched membership deep-equals the created one, while the
269
+ integration spec skips that assertion because the `created` dates do not match.
270
+ - `update` is the only method without a JSDoc example.
271
+ - The integration spec's `max: 1` case expects exactly three memberships in its team (the team creator
272
+ plus two added users), so it depends on the team creator being listed as a member.
273
+ - `test:style` reports no warning or error for `src/index.js` and `src/team-memberships.js`, plus "File
274
+ ignored" for this specification.
275
+
276
+ ## Module-specific rules
277
+
278
+ - Do: send every request to service `hydra` through `this.request` so webex-core interceptors, the
279
+ catalog, and error conversion apply (`INV-001`).
280
+ - Do: keep accepting a membership object or its id in `get`, `update`, and `remove` (`INV-002`).
281
+ - Do: keep resolving `undefined` for a 204 from `remove` until http-core handles it, as the code comment
282
+ asks (`INV-003`).
283
+ - Do not: add client-side checks or field rewriting without a change request; callers rely on the body
284
+ passing through unchanged (`INV-004`).
285
+ - Do not: change the registered name `teamMemberships`; `webex`, `webex-node`, and their integration
286
+ spec rely on it.
287
+ - Do not: log person emails, person ids, or team ids through `webex.logger`; the plugin logs nothing
288
+ today.
289
+
290
+ ## Export stability
291
+
292
+ | Export or entry point | Consumer | Stability | Versioning and deprecation rule | Declaration or API report |
293
+ | --------------------- | -------- | --------- | ------------------------------- | ------------------------- |
294
+ | Import side effect: public plugin `teamMemberships` | `webex`, `webex-node` | Public | No rule is declared in the package | `src/index.js` |
295
+ | Default export `TeamMemberships` and its five public methods | Applications | Public | Same | `src/index.js`, `src/team-memberships.js` |
296
+
297
+ The build writes JavaScript only; `package.json` has no `types` entry, so no declarations or API
298
+ report are published.
299
+
300
+ ## Key design trade-off
301
+
302
+ | Chosen trade-off | Preserved invariant or benefit | Cost or limitation | Decision evidence |
303
+ | ---------------- | ------------------------------ | ------------------ | ----------------- |
304
+ | A thin pass-through: the caller's object is the body and the service's answer is the result, with no client-side check | One request per call, and the service stays the only judge of membership rules (`INV-001`, `INV-004`) | Bad input reaches the network, or throws synchronously when the argument is missing; field names are typed only by JSDoc | `src/team-memberships.js` |
305
+
306
+ ## Verification
307
+
308
+ | Requirement or invariant | Test level | Positive evidence | Negative or boundary evidence | Gap |
309
+ | ------------------------ | ---------- | ----------------- | ----------------------------- | --- |
310
+ | `MOD-001` | None run | `test/integration/spec/team-memberships.js` (not run) | None found | No unit case |
311
+ | `MOD-002` to `MOD-006` | None run | `test/integration/spec/team-memberships.js` (not run) | `test/integration/spec/team-memberships.js` remove case expects an empty result (not run) | No unit case for any request or result |
312
+ | `INV-001` to `INV-004` | None run | `test/integration/spec/team-memberships.js` (not run) | None found | The id rule, the 204 branch, and the missing-argument throw have no case |
313
+
314
+ The package has no unit tests: `package.json` defines no `test:unit` script and there is no `test/unit`
315
+ directory. No package script runs `test/integration/spec/team-memberships.js` either: there is no
316
+ `test:integration`, and `test:browser` reported 0 tests on 2026-11-12 because the karma bundle failed
317
+ to parse `isbot`, while still exiting 0. The aggregate `test` script exits 1 at the missing
318
+ `test:unit`. `build:src` and `test:style` exit 0. A module specification is complete only when its
319
+ public surface, invariants, failure modes, and test evidence agree with the implementation.
320
+ Generator-side field measurement is complete (100%, assessed 2026-11-12); independent validation
321
+ passed on 2026-11-12 under validator runtime 01a1d0de-3a7e-7e50-a7bb-141639802749, with no findings. The module stays Partial
322
+ until a unit suite, a characterization baseline, and promotion review are complete.