@webex/webex-core 3.12.0-next.7 → 3.12.0-next.71

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 (75) hide show
  1. package/.repo-context.json +653 -0
  2. package/.sdd/manifest.json +605 -0
  3. package/AGENTS.md +209 -0
  4. package/README.md +5 -2
  5. package/dist/config.js +45 -0
  6. package/dist/config.js.map +1 -1
  7. package/dist/credentials-config.js +12 -0
  8. package/dist/credentials-config.js.map +1 -1
  9. package/dist/index.js +14 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/interceptors/catalog-url.js +87 -0
  12. package/dist/interceptors/catalog-url.js.map +1 -0
  13. package/dist/interceptors/payload-transformer.js +25 -4
  14. package/dist/interceptors/payload-transformer.js.map +1 -1
  15. package/dist/lib/batcher.js +23 -7
  16. package/dist/lib/batcher.js.map +1 -1
  17. package/dist/lib/credentials/credentials.js +103 -4
  18. package/dist/lib/credentials/credentials.js.map +1 -1
  19. package/dist/lib/credentials/token.js +1 -1
  20. package/dist/lib/domains.js +90 -0
  21. package/dist/lib/domains.js.map +1 -0
  22. package/dist/lib/services/service-catalog.js +108 -18
  23. package/dist/lib/services/service-catalog.js.map +1 -1
  24. package/dist/lib/services/services.js +242 -38
  25. package/dist/lib/services/services.js.map +1 -1
  26. package/dist/lib/services-v2/service-catalog.js +14 -13
  27. package/dist/lib/services-v2/service-catalog.js.map +1 -1
  28. package/dist/lib/services-v2/services-v2.js +255 -42
  29. package/dist/lib/services-v2/services-v2.js.map +1 -1
  30. package/dist/lib/static-asset-loader.js +153 -0
  31. package/dist/lib/static-asset-loader.js.map +1 -0
  32. package/dist/plugins/logger.js +1 -1
  33. package/dist/webex-core.js +11 -3
  34. package/dist/webex-core.js.map +1 -1
  35. package/docs/adr/index.md +32 -0
  36. package/docs/architecture.md +298 -0
  37. package/docs/getting-started.md +96 -0
  38. package/docs/index.md +55 -0
  39. package/docs/specs/README.md +76 -0
  40. package/package.json +13 -13
  41. package/schemas/repo-context.schema.json +796 -0
  42. package/src/config.js +49 -0
  43. package/src/credentials-config.js +13 -0
  44. package/src/docs/README.md +732 -0
  45. package/src/index.js +2 -0
  46. package/src/interceptors/catalog-url.js +66 -0
  47. package/src/interceptors/docs/README.md +658 -0
  48. package/src/interceptors/payload-transformer.js +23 -1
  49. package/src/lib/batcher.js +25 -10
  50. package/src/lib/credentials/credentials.js +93 -3
  51. package/src/lib/credentials/docs/README.md +846 -0
  52. package/src/lib/domains.ts +94 -0
  53. package/src/lib/services/docs/README.md +737 -0
  54. package/src/lib/services/service-catalog.js +112 -16
  55. package/src/lib/services/services.js +220 -22
  56. package/src/lib/services-v2/docs/README.md +751 -0
  57. package/src/lib/services-v2/service-catalog.ts +16 -12
  58. package/src/lib/services-v2/services-v2.ts +234 -24
  59. package/src/lib/static-asset-loader.ts +128 -0
  60. package/src/lib/storage/docs/README.md +646 -0
  61. package/src/webex-core.js +8 -0
  62. package/test/fixtures/activation-email.ts +22 -0
  63. package/test/integration/spec/services/services.js +183 -112
  64. package/test/integration/spec/services-v2/services-v2.js +169 -98
  65. package/test/unit/spec/credentials/credentials.js +247 -3
  66. package/test/unit/spec/interceptors/auth.js +56 -0
  67. package/test/unit/spec/interceptors/catalog-url.js +224 -0
  68. package/test/unit/spec/interceptors/payload-transformer.js +119 -1
  69. package/test/unit/spec/lib/batcher.js +56 -0
  70. package/test/unit/spec/services/service-catalog.js +368 -11
  71. package/test/unit/spec/services/services.js +466 -2
  72. package/test/unit/spec/services-v2/service-catalog.ts +134 -11
  73. package/test/unit/spec/services-v2/services-v2.ts +588 -0
  74. package/test/unit/spec/static-asset-loader.ts +224 -0
  75. package/test/unit/spec/webex-core.js +77 -1
@@ -0,0 +1,298 @@
1
+ ---
2
+ type: Architecture
3
+ title: '@webex/webex-core architecture'
4
+ description: Package boundaries, resources, interactions, dependencies, and cross-cutting architecture of @webex/webex-core.
5
+ tags: [architecture]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: architecture@0.3.0
10
+ generated_by: claude-code
11
+ approved_by: rsarika@cisco.com
12
+ updated_at: 2026-10-07T13:20:21Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # @webex/webex-core architecture
17
+
18
+ Canonical architecture for the `@webex/webex-core` package. This document owns facts that span its
19
+ modules and its neighbors in the Webex JS SDK workspace. Owner-local detail lives in the module
20
+ specifications linked from the [specification registry](specs/README.md).
21
+
22
+ Related context: [specification registry](specs/README.md) · [agent instructions](../AGENTS.md)
23
+
24
+ ## Applicability
25
+
26
+ | Condition ID | Status | Evidence or reason | Owned section |
27
+ | --- | --- | --- | --- |
28
+ | `repo.owns_datastore` | N/A | The package provisions no datastore; persistence goes through a host-supplied storage adapter (`src/lib/storage/index.js`) | Repository data and schema |
29
+ | `repo.holds_client_state` | Applicable | `WebexCore` is an observable state model holding config, session id and load flags (`src/webex-core.js`), and credentials hold tokens (`src/lib/credentials/credentials.js`) | Client state model |
30
+ | `repo.components_interact` | Applicable | `src/webex-core.js` wires interceptors, credentials, services and storage together | Dependency and interaction topology |
31
+ | `repo.domain_data_across_components` | N/A | No domain object spans resources; each module owns its own state | Object and data ownership |
32
+ | `repo.caches_data` | Applicable | The U2C hostmap is cached in `localStorage` with a TTL (`src/lib/services/services.js`, `src/lib/services-v2/services-v2.ts`) | Caching catalog |
33
+ | `repo.observability_convention` | Applicable | Plugin logger with level precedence (`src/plugins/logger.js`), request events and tracking ids (`src/interceptors/request-event.js`, `src/interceptors/webex-tracking-id.js`) | Observability patterns |
34
+ | `repo.deploys_to_infra` | N/A | A library published to npm; `package.json` declares no container, deployment manifest or start command | Runtime and infrastructure |
35
+ | `repo.shared_base_libs` | Applicable | Lint, babel, jest and build tooling are inherited from the workspace legacy config packages (`.eslintrc.js`, `babel.config.js`, `jest.config.js`) | Shared and base libraries |
36
+ | `repo.is_monorepo` | Applicable | One workspace package among many in the Webex JS SDK yarn workspace (`package.json` `repository.directory`) | Package map and inter-package dependencies |
37
+ | `repo.multi_platform` | Applicable | Runs in Node and browsers; `package.json` declares a `browserify` transform and tests carry `browserOnly`/`nodeOnly` guards | Platform matrix |
38
+ | `repo.published_package` | Applicable | `package.json` declares `main`, `devMain` and `deploy:npm` | Release and versioning |
39
+ | `repo.embedded_in_host` | Applicable | It runs inside host applications that supply storage, config and a network stack | Host integration |
40
+ | `repo.exposes_commands_or_artifacts` | N/A | The only build artifact is the transpiled `dist` of the same exports; no CLI or generator | Commands and generated artifacts |
41
+ | `repo.cross_repo_deps_material` | N/A | Dependencies are workspace packages and npm libraries; no separate repository is required | Cross-repository topology |
42
+ | `repo.security_arch_warranted` | Applicable | It holds OAuth tokens, attaches bearer headers, and persists tokens as plain JSON (`src/lib/credentials/credentials.js`, `src/interceptors/auth.js`) | Security architecture |
43
+
44
+ ## Design overview
45
+
46
+ `@webex/webex-core` is the base of the Webex JS SDK. The default export, `WebexCore`
47
+ (`src/webex-core.js`), is an observable model that owns a process-global plugin registry. Other SDK
48
+ packages register public (`registerPlugin`) and internal (`registerInternalPlugin`) plugins against it,
49
+ and each `WebexCore` instance materializes them as `webex.<name>` and `webex.internal.<name>`.
50
+
51
+ Five modules sit under the root module `src`:
52
+
53
+ - **Interceptors** (`src/interceptors`) form the request pipeline that `WebexCore.request` runs through
54
+ the `@webex/http-core` client: tracking ids, auth with refresh-and-replay, redirects, rate limiting,
55
+ catalog URL validation, timing, events and logging.
56
+ - **Credentials** (`src/lib/credentials`) hold the OAuth supertoken and scoped user tokens and keep them
57
+ usable through refresh, downscope and revoke.
58
+ - **Services** (`src/lib/services`, and the opt-in `src/lib/services-v2`) discover the Webex service
59
+ catalog from U2C, resolve service names and URLs, fail hosts over, and gate `webex.ready`.
60
+ - **Storage** (`src/lib/storage`) provides the `@persist` decorator, store factories and an in-memory
61
+ adapter, with concrete adapters supplied by sibling packages or the host.
62
+
63
+ Services and credentials live in core on purpose: the header comment of `src/index.js` explains that, as
64
+ plugins outside core, they would initialize after credentials and every earlier request would miss the
65
+ federation rules. The same file's import order is therefore load-bearing. Parallel v1 and v2 service
66
+ discovery is kept side by side; v1 is registered by default and v2 only through an explicit
67
+ `registerInternalPlugin(..., {replace: true})`.
68
+
69
+ ## Resource inventory and responsibilities
70
+
71
+ | Resource | Kind | Responsibility | Owner | Source | Detailed specification |
72
+ | --- | --- | --- | --- | --- | --- |
73
+ | Root module | Module | Plugin host, config defaults, plugin base classes, Batcher, Page, WebexHttpError, export surface | Cisco Webex for Developers | `src` | [src/docs/README.md](../src/docs/README.md) |
74
+ | Interceptors | Module | Request/response interceptors | Cisco Webex for Developers | `src/interceptors` | [README](../src/interceptors/docs/README.md) |
75
+ | Credentials | Module | OAuth token lifecycle | Cisco Webex for Developers | `src/lib/credentials` | [README](../src/lib/credentials/docs/README.md) |
76
+ | Services v1 | Module | Service discovery and host selection | Cisco Webex for Developers | `src/lib/services` | [README](../src/lib/services/docs/README.md) |
77
+ | Services v2 | Module | Opt-in v2 service discovery | Cisco Webex for Developers | `src/lib/services-v2` | [README](../src/lib/services-v2/docs/README.md) |
78
+ | Storage | Module | Persistence decorators and store factories | Cisco Webex for Developers | `src/lib/storage` | [README](../src/lib/storage/docs/README.md) |
79
+
80
+ The repository CODEOWNERS entry assigns this package to `@webex/web-client` and `@webex/web-sdk`; the Owner column names the documentation owner, Cisco Webex for Developers.
81
+
82
+ ## Interaction and execution flows
83
+
84
+ ```mermaid
85
+ flowchart LR
86
+ Host[Host app or SDK plugin] -->|webex.request| Core[WebexCore]
87
+ Core --> Pre["Pre interceptors: tracking id, rate limit, catalog URL"]
88
+ Pre --> Mid["Registered interceptors, incl. service and auth"]
89
+ Mid --> Http[http-core request]
90
+ Http -->|HTTP| Net[(Webex services)]
91
+ Mid -->|resolve service URL| Svc[Services]
92
+ Mid -->|bearer token, refresh| Cred[Credentials]
93
+ Cred -->|token endpoints| Idb[(Identity broker)]
94
+ Svc -->|hostmap| U2C[(U2C)]
95
+ Cred -->|persist| Store[Storage adapter]
96
+ Svc -->|cache| LS[(localStorage)]
97
+ ```
98
+
99
+ | From | To | Interaction or transport | Purpose | Failure or compatibility behavior |
100
+ | --- | --- | --- | --- | --- |
101
+ | `WebexCore` | Interceptors | Ordered interceptor chain built at construction | Shape every request and response | `config.interceptors` replaces the whole chain; plugin-registered interceptors are then lost (see root spec) |
102
+ | Auth interceptor | Credentials | Token read and refresh | Attach `Authorization`, replay once after a 401 | Replay is bounded by `maxAuthenticationReplays`; a second 401 rejects |
103
+ | Service interceptor | Services | Name-to-URL resolution | Replace `service:` URIs with real hosts | Resolution failure surfaces as an unknown-service error |
104
+ | Credentials | Identity broker | HTTPS token, revoke and downscope calls | Maintain tokens | OAuth errors map to `grantErrors` classes |
105
+ | Services | U2C | HTTPS catalog fetch | Learn service hosts | Gated by `catalogInitTimeout`; failure marks `initFailed` |
106
+ | Credentials, services | Storage | `@persist` write and rehydrate | Survive restarts | Non-`NotFoundError` read failures can leave startup unfinished (see storage spec) |
107
+
108
+ ## Dependency topology
109
+
110
+ | Dependency | Type | Used by | Purpose | Version, failure, or fallback policy |
111
+ | --- | --- | --- | --- | --- |
112
+ | `@webex/http-core` | Internal | Root, interceptors, services | HTTP client and Interceptor base | Workspace version; specified in the http-core module spec |
113
+ | `@webex/common` | Internal | All modules | Exception, Defer, oneFlight and helpers | Workspace version; specified in the common module spec |
114
+ | `@webex/common-timers` | Internal | Credentials | Unref-ing timers and the Timer class | Workspace version; specified in the common-timers module spec |
115
+ | `@webex/storage-adapter-spec` | Internal | Tests of storage | Shared adapter conformance suite | Declared as a runtime dependency but imported only by tests |
116
+ | `@webex/internal-plugin-device` | Internal (dev) | Services, tests | Feature flags and device data consumed by services | Dev dependency only; services call it without a guard (see services spec) |
117
+ | `@webex/plugin-logger` | Internal (dev) | Tests | Logger test support | Code-only dependency: no module spec exists for it |
118
+ | `ampersand-state`, `ampersand-collection`, `ampersand-events` | External | Root, credentials, services, storage | Observable models | Pinned by `package.json` |
119
+ | `lodash`, `uuid`, `crypto-js`, `jsonwebtoken`, `core-decorators` | External | Various | Helpers, tracking ids, hashing, JWT decode, decorators | Pinned by `package.json`; `jsonwebtoken` is used only to decode |
120
+
121
+ Cycles and ordering: services and credentials are imported by `src/index.js` before any consumer can
122
+ register a plugin, and the services module imports the credentials module. Both services plugins read
123
+ the device plugin at runtime, so a host that omits it hits unguarded calls.
124
+
125
+ ## Public and consumer surfaces
126
+
127
+ Exact export names live in [`src/index.js`](../src/index.js) and the owning module specification. 49 workspace packages declare a dependency on this package.
128
+
129
+ | Surface | Type | Owner | Consumers | Compatibility policy | Source |
130
+ | --- | --- | --- | --- | --- | --- |
131
+ | `webex-core-sdk` | SDK | `src` | Every SDK plugin and host application | No deprecation policy is declared in `package.json`; treat export removal as breaking | `package.json` |
132
+ | `webex-core-interceptors` | SDK | `src/interceptors` | `src/webex-core.js` instantiates them; hosts may subclass | No deprecation policy declared; treat removal as breaking | `src/index.js` |
133
+ | `webex-core-credentials` | SDK | `src/lib/credentials` | Authorization plugins, contact-center, metrics, mercury and others | No deprecation policy declared; treat removal as breaking | `src/lib/credentials/index.js` |
134
+ | `webex-core-services` | SDK | `src/lib/services` | Many packages through `internal.services` | No deprecation policy declared; treat removal as breaking | `src/lib/services/index.js` |
135
+ | `webex-core-services-v2` | SDK | `src/lib/services-v2` | No production consumer; opt-in | Work-in-progress per its README; no stability promise | `src/lib/services-v2/index.ts` |
136
+ | `webex-core-storage` | SDK | `src/lib/storage` | Storage adapter packages, user, device and encryption plugins | No deprecation policy declared; treat removal as breaking | `src/lib/storage/index.js` |
137
+
138
+ External contracts the package requires: `http-core-sdk`, `webex-common-js-api`, `common-timers-sdk`,
139
+ `storage-adapter-spec-suite`, the U2C service-discovery API (`u2c-service`), the identity-broker OAuth API
140
+ (`idbroker-oauth-service`) and the ampersand state library. They are registered in
141
+ `.sdd/manifest.json` `contract_catalog`.
142
+
143
+ ## Client state model
144
+
145
+ | State or slice | Owner | Transition triggers | Persistence or reset boundary |
146
+ | --- | --- | --- | --- |
147
+ | `WebexCore` config, session id, `loaded`, `ready` | `src` | Construction, plugin readiness events, `logout` | In memory; `ready` waits for plugin and catalog readiness |
148
+ | Supertoken and user tokens | `src/lib/credentials` | Authorize, refresh, downscope, invalidate, logout | Persisted through `@persist('@')` to the bounded store |
149
+ | Service catalog groups and `ready` flags | `src/lib/services`, `src/lib/services-v2` | Catalog fetch, cache warm, failover | In memory plus a `localStorage` cache with a 24 hour TTL |
150
+ | Interceptor counters (rate limit, tracking sequence, replay) | `src/interceptors` | Each request | In memory only |
151
+ | Per-key load records and the startup stack | `src/lib/storage` | `@persist`/`@waitForValue` activity | Process-global registries |
152
+
153
+ ## Cross-cutting architecture
154
+
155
+ ### Security
156
+
157
+ - Trust boundaries and identity flow: the SDK attaches bearer tokens only to allow-listed hosts
158
+ (`services.validateDomains`, `allowedDomains`) and optionally validates every outbound URL against the
159
+ catalog (`services.validateCatalogUrls`, default off).
160
+ - Sensitive surfaces and data classes: access and refresh tokens, client secrets read from environment
161
+ variables, and plain-text persisted token documents.
162
+ - Encryption and secret boundaries: the package performs no encryption of its own; persisted tokens are
163
+ stored as plaintext JSON through whatever adapter the host configures. Revocation is skipped when no
164
+ client secret is configured, so it does not happen in typical browser builds.
165
+
166
+ ### Observability and operations
167
+
168
+ - Logging and correlation: `webex.logger` with per-level console fallback; `trackingid` headers carry a
169
+ per-instance prefix and sequence number; token refresh logs outside production builds.
170
+ - Metrics, traces, and audit signals: `request:start|success|failure|end` events consumed by the metrics
171
+ plugin, and a service-not-found metric emitted by services.
172
+ - Ownership and operational entry points: there are no dashboards or runbooks in the package.
173
+
174
+ ### Quality attributes
175
+
176
+ Compatibility is the dominant attribute: dozens of workspace packages and external applications import
177
+ this package, so exported names, event names and config keys are treated as public. No coverage gate is
178
+ enforced, and several behaviors named in the module specifications have no test (rate limiting
179
+ positive cases, JWT refresh, startup failure paths).
180
+
181
+ ## Dependency and interaction topology
182
+
183
+ ```mermaid
184
+ flowchart LR
185
+ Root[src root] --> Int[src/interceptors]
186
+ Root --> Cred[src/lib/credentials]
187
+ Root --> Svc[src/lib/services]
188
+ Root --> Svc2[src/lib/services-v2]
189
+ Root --> Sto[src/lib/storage]
190
+ Int --> Cred
191
+ Int --> Svc
192
+ Cred --> Sto
193
+ Svc2 --> Svc
194
+ Svc --> Cred
195
+ ```
196
+
197
+ | From | To | Kind | Purpose | Ordering or failure boundary |
198
+ | --- | --- | --- | --- | --- |
199
+ | `src` | all children | Import and registration | Compose the plugin host | Import order in `src/index.js` is load-bearing |
200
+ | `src/interceptors` | `src/lib/credentials` | Call | Token attach and refresh | Replay bounded by config |
201
+ | `src/interceptors` | `src/lib/services` | Call | Catalog URL validation and service resolution | Fails closed only when validation is enabled |
202
+ | `src/lib/credentials` | `src/lib/storage` | Decorator | Persist tokens | Plaintext; read failures can stall startup |
203
+ | `src/lib/services` | `src/lib/credentials` | Call | Authenticated catalog fetch | Preauth versus postauth groups |
204
+ | `src/lib/services-v2` | `src/lib/services` | Import | Reuses URL-matching helpers from the v1 catalog | v2 cannot be loaded without v1 files |
205
+
206
+ ## Caching catalog
207
+
208
+ | Cache | Owner | Backend | Contents | TTL or bound | Invalidation trigger | Failure behavior |
209
+ | --- | --- | --- | --- | --- | --- | --- |
210
+ | U2C hostmap v1 | `src/lib/services` | `localStorage` key `services.v1.u2cHostMap` | Catalog groups | 24 hours; only when `calling.cacheU2C` is true | `clearCatalogCache`; nothing clears it on logout | Cache miss falls back to a network fetch |
211
+ | U2C hostmap v2 | `src/lib/services-v2` | `localStorage` key `services.v2.u2cHostMap` | Catalog groups | 24 hours; same flag | `clearCatalogCache`, `invalidateCache` | A warm start leaves some name maps empty (see v2 spec) |
212
+ | Plugin bindings | `src/lib/storage` | In-memory registries | Bound store handles per namespace | Process lifetime | None | Shared across instances |
213
+
214
+ ## Observability patterns
215
+
216
+ | Signal | Convention or required fields | Propagation or naming rule | Primary evidence |
217
+ | --- | --- | --- | --- |
218
+ | Logs | Level methods with console fallback; token redaction is limited | `webex.logger` shared by plugins | `src/plugins/logger.js` |
219
+ | Metrics | Request lifecycle events and a service-not-found metric | Event names `request:*` | `src/interceptors/request-event.js`, `src/lib/metrics.js` |
220
+ | Traces | `trackingid` header: prefix, instance uuid and sequence number | Re-sent with a replay suffix | `src/interceptors/webex-tracking-id.js` |
221
+ | Audit | None | N/A | N/A |
222
+
223
+ ## Shared and base libraries
224
+
225
+ | Library | Inherited responsibility | Consumers | Version floor | Compatibility rule |
226
+ | --- | --- | --- | --- | --- |
227
+ | `@webex/eslint-config-legacy` | Lint rules | This package | Workspace | Change in the shared package, not here |
228
+ | `@webex/babel-config-legacy` | Transpilation | This package | Workspace | Same |
229
+ | `@webex/jest-config-legacy` | Unit-test config; coverage collection is off | This package | Workspace | Same |
230
+ | `@webex/legacy-tools` | Build and test runners | This package | Workspace | Same |
231
+
232
+ ## Package map and inter-package dependencies
233
+
234
+ | Package | Visibility | Responsibility | Depends on | Consumers |
235
+ | --- | --- | --- | --- | --- |
236
+ | `@webex/webex-core` | Public | Core plugin host and base services | `@webex/common`, `@webex/common-timers`, `@webex/http-core`, `@webex/storage-adapter-spec` | 49 workspace packages |
237
+ | `@webex/http-core` | Public | HTTP client | `@webex/common` | webex-core and others |
238
+ | `@webex/common` | Public | Shared helpers | — | Most packages |
239
+ | `@webex/common-timers` | Public | Timer primitives | — | webex-core and others |
240
+ | `@webex/storage-adapter-spec` | Public | Adapter conformance suite | — | Storage tests |
241
+
242
+ Workspace packages are resolved by yarn workspaces. The two dev-only edges to
243
+ `@webex/internal-plugin-device` and `@webex/plugin-logger` are declared under `devDependencies` in
244
+ `package.json`; the services modules nevertheless read the device plugin at runtime.
245
+
246
+ ## Platform matrix
247
+
248
+ | Platform | Shared versus platform-specific boundary | Entry or build | Support and compatibility constraints |
249
+ | --- | --- | --- | --- |
250
+ | Node.js | Shared code; some interceptors and tests are Node-only | `dist/index.js` from `yarn workspace @webex/webex-core build:src` | `engines.node >=18` |
251
+ | Browser | Shared code; `localStorage` and browser-only interceptor paths | Same bundle through the `browserify` transform | Caches and logout flows assume browser APIs only where guarded |
252
+
253
+ ## Release and versioning
254
+
255
+ | Artifact | Publish target | Versioning rule | Deprecation window | Changelog or migration obligation |
256
+ | --- | --- | --- | --- | --- |
257
+ | `@webex/webex-core` | npm through `deploy:npm` | Managed at the workspace root | None declared in `package.json`; owned at the workspace root | Owned at the workspace root |
258
+
259
+ ## Host integration and theming
260
+
261
+ | Host or integration | Mount or entry contract | Required providers or peers | Theming and accessibility constraints |
262
+ | --- | --- | --- | --- |
263
+ | Browser or Node application | Construct `WebexCore` (usually through the `webex` package) with config and credentials | A storage adapter (memory by default), the device plugin for services, a network stack | N/A — no UI |
264
+
265
+ ## Security architecture
266
+
267
+ ```mermaid
268
+ flowchart LR
269
+ App[Host config and credentials] --> Cred[Credentials]
270
+ Cred -->|bearer token| Auth[Auth interceptor]
271
+ Auth -->|allow-listed hosts only| Net[(Webex services)]
272
+ Cred -->|plaintext JSON| Store[Storage adapter]
273
+ Cat[Service catalog] -->|allowed domains| Auth
274
+ ```
275
+
276
+ Trust boundary: the auth interceptor attaches tokens only to hosts known from the catalog, the
277
+ discovery configuration or `allowedDomains`. Tokens are persisted unencrypted, so the host must treat
278
+ the storage adapter as a secret store. The detailed controls are in the credentials and interceptors
279
+ specifications.
280
+
281
+ ## Domain language
282
+
283
+ | Term | Repository-specific meaning | Authoritative source |
284
+ | --- | --- | --- |
285
+ | Supertoken | The user's top-level token set from which scoped user tokens are downscoped | `src/lib/credentials/credentials.js` |
286
+ | Downscope | Obtaining a token with a reduced scope from the supertoken | `src/lib/credentials/credentials.js` |
287
+ | U2C | The service-discovery API that returns the hostmap | `src/config.js` |
288
+ | Hostmap or catalog | The service-name to host list mapping the services plugins hold | `src/lib/services/service-catalog.js` |
289
+ | Preauth, postauth, signin | Catalog groups collected before login, after login and during sign-in | `src/lib/services/service-catalog.js` |
290
+ | Interceptor | A request/response hook run in a fixed chain | `src/index.js` |
291
+ | Bounded and unbounded storage | The two store instances configured by `storage.boundedAdapter` and `storage.unboundedAdapter` | `src/config.js` |
292
+
293
+ ## References and maintenance
294
+
295
+ - Decisions: [adr/](adr/index.md)
296
+ - Instantiated specifications and routing: [specs/README.md](specs/README.md)
297
+ - Update this document in the same change that alters package boundaries, module ownership,
298
+ cross-module interaction or cross-cutting architecture.
@@ -0,0 +1,96 @@
1
+ ---
2
+ type: Getting Started
3
+ title: Getting started
4
+ description: Local setup, build, and test routing for @webex/webex-core.
5
+ tags: [onboarding]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: getting-started@0.3.0
10
+ generated_by: claude-code
11
+ approved_by: rsarika@cisco.com
12
+ updated_at: 2026-10-07T13:20:21Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # Getting started
17
+
18
+ Onboarding for **@webex/webex-core**, a workspace package of the Webex JS SDK monorepo. Every command
19
+ runs from the workspace root.
20
+
21
+ ## Prerequisites
22
+
23
+ | Tool or access | Version or requirement |
24
+ | --- | --- |
25
+ | Node.js | `>=18` per the package `engines`; the repository `.nvmrc` pins `lts/jod`, and the repo AGENTS instructions ask for 22.14 |
26
+ | Yarn | 3.4.1 (root `packageManager`) |
27
+ | Webex test users and network access | Required only for the integration and browser suites (see Tests) |
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ yarn install
33
+ ```
34
+
35
+ ## Build
36
+
37
+ ```bash
38
+ yarn workspace @webex/webex-core build:src
39
+ ```
40
+
41
+ The build transpiles `src` (js and ts) into the git-ignored `dist` directory that `main` points at.
42
+ Consumers inside the workspace that resolve the package by name read `dist`, so rebuild after changing
43
+ `src` before trusting a dependent package's tests.
44
+
45
+ ## Run
46
+
47
+ N/A — the package is a library with no runnable entry point. It is exercised through the unit and
48
+ integration suites and through dependent plugins.
49
+
50
+ ## Tests
51
+
52
+ ```bash
53
+ yarn workspace @webex/webex-core test:unit
54
+ ```
55
+
56
+ | Tier | Command | Test location | Framework | External dependencies |
57
+ | --- | --- | --- | --- | --- |
58
+ | Unit | `yarn workspace @webex/webex-core test:unit` | `test/unit/spec` | Jest, sinon, chai | None |
59
+ | Integration | `yarn workspace @webex/webex-core test:integration` | `test/integration/spec` | Mocha | Provisioned Webex test users, live U2C and identity-broker services, a local fixture server |
60
+ | Browser | `yarn workspace @webex/webex-core test:browser` | `test/integration/spec` | Karma | A browser runner plus the integration dependencies |
61
+ | Lint | `yarn workspace @webex/webex-core test:style` | `src` | ESLint | None |
62
+
63
+ - Coverage or quality gate: none enforced for this package (`quality_gates.code_coverage.origin: none`).
64
+ - Enforcement source: `.sdd/manifest.json` `quality_gates`.
65
+ - Test environment or QA dependencies: the integration tiers need provisioned test users from the shared
66
+ test helpers; the unit tier needs nothing external.
67
+ - To run one unit file, pass a path relative to `test/unit/spec`, for example
68
+ `yarn workspace @webex/webex-core test:unit --targets credentials/token.js`.
69
+ - The aggregate `test` script chains lint, unit, integration and browser tiers, so it needs the
70
+ integration environment.
71
+
72
+ ## Configuration and secrets
73
+
74
+ - Required configuration: none for unit tests. Many defaults in `src/config.js` and
75
+ `src/credentials-config.js` read environment variables at import time (for example `U2C_SERVICE_URL`,
76
+ `HYDRA_SERVICE_URL`, `WEBEX_CLIENT_ID`); see the root module specification.
77
+ - Secret source: client ids and secrets come from environment variables or host config; never commit them.
78
+ - Package or artifact access: the workspace resolves siblings through yarn workspaces; publishing uses
79
+ `yarn workspace @webex/webex-core deploy:npm`.
80
+ - Required neighboring packages: `@webex/common`, `@webex/common-timers`, `@webex/http-core` and
81
+ `@webex/storage-adapter-spec` (workspace dependencies).
82
+ - Never commit credentials or copy production secrets into a local config.
83
+
84
+ ## First-run verification
85
+
86
+ 1. Run `yarn install`.
87
+ 2. Run `yarn workspace @webex/webex-core test:unit --targets lib/batcher.js`.
88
+ 3. Run `yarn workspace @webex/webex-core test:style`.
89
+
90
+ Expected result: the targeted Jest file passes and ESLint reports no errors.
91
+
92
+ ## Next steps
93
+
94
+ - [Repository architecture](architecture.md)
95
+ - [Specification registry](specs/README.md)
96
+ - [Documentation index](index.md)
package/docs/index.md ADDED
@@ -0,0 +1,55 @@
1
+ ---
2
+ okf_version: '0.1'
3
+ ---
4
+ <!-- sdd-generated-metadata
5
+ doc_kind: standing-doc
6
+ generated_from: docs-index@0.3.0
7
+ generated_by: claude-code
8
+ approved_by: rsarika@cisco.com
9
+ updated_at: 2026-10-07T13:20:21Z
10
+ validation_status: pass-with-warnings
11
+ -->
12
+
13
+ # @webex/webex-core documentation
14
+
15
+ Doc map for developers and agents working on the core library of the Webex JS SDK: the plugin host,
16
+ request interceptor pipeline, credentials, service discovery and storage layer.
17
+
18
+ ## Start here
19
+
20
+ - [Getting started](getting-started.md) — prerequisites, build, and the test router
21
+ - [Repository architecture](architecture.md) — package boundaries, flows, dependencies and the contract index
22
+
23
+ There is no service specification and no API specification: the package is a published library with no
24
+ deployable runtime and no HTTP surface of its own. Both omissions are recorded in `.sdd/manifest.json`
25
+ under `layout.artifact_decisions`.
26
+
27
+ ## Decisions
28
+
29
+ - [adr/](adr/) — architectural decision records. None are registered yet; the design trade-offs that
30
+ shape the current code are recorded in each module specification's trade-off section.
31
+
32
+ ## Specifications and contracts
33
+
34
+ - [architecture.md](architecture.md) — canonical package-wide architecture and the contract index
35
+ - [specs/README.md](specs/README.md) — manifest-backed module and contract registry
36
+ - [`src/docs/README.md`](../src/docs/README.md) — the root module: plugin host, public export surface, config
37
+ - [`src/interceptors/docs/README.md`](../src/interceptors/docs/README.md) — request/response interceptors
38
+ - [`src/lib/credentials/docs/README.md`](../src/lib/credentials/docs/README.md) — OAuth tokens and credentials
39
+ - [`src/lib/services/docs/README.md`](../src/lib/services/docs/README.md) — v1 service discovery
40
+ - [`src/lib/services-v2/docs/README.md`](../src/lib/services-v2/docs/README.md) — opt-in v2 service discovery
41
+ - [`src/lib/storage/docs/README.md`](../src/lib/storage/docs/README.md) — persistence layer
42
+ - [adr/](adr/) — concrete architectural decisions; the blank ADR template stays under `.sdd/`
43
+
44
+ The package's published contracts are npm package exports whose native source is the entry point
45
+ declared by `main` and `devMain` in [`package.json`](../package.json) and the barrel
46
+ [`src/index.js`](../src/index.js). The architecture page indexes them; the module specifications detail
47
+ them; neither copies declarations into Markdown.
48
+
49
+ ## Related repository resources
50
+
51
+ - [`README.md`](../README.md) — the package's npm-facing readme (install and basic usage). Its storage
52
+ example is stale relative to the code; see the storage module specification.
53
+ - [`src/lib/services-v2/README.md`](../src/lib/services-v2/README.md) — a work-in-progress note kept as-is
54
+ - Contribution guidelines, changelog generation and the release pipeline are owned at the Webex JS SDK
55
+ workspace root
@@ -0,0 +1,76 @@
1
+ ---
2
+ type: Reference
3
+ title: Specification registry
4
+ description: Canonical specification registry and change-routing guide.
5
+ tags: [specifications, registry]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: spec-index@0.3.0
10
+ generated_by: claude-code
11
+ approved_by: rsarika@cisco.com
12
+ updated_at: 2026-10-07T13:20:21Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # Specification registry
17
+
18
+ Use this page to find the canonical package architecture and every module specification plus native
19
+ contract. Keep technical facts in one owning document and use this page only for navigation, ownership,
20
+ status, and change/test routing.
21
+
22
+ Start with the [repository architecture](../architecture.md). There is no service specification because
23
+ the package is a library, not a deployable service.
24
+
25
+ ## Document roles
26
+
27
+ | Document | Canonical ownership |
28
+ | --- | --- |
29
+ | [Repository architecture](../architecture.md) | Package boundaries, resource inventory, interactions, dependency topology, contract index and cross-cutting architecture |
30
+ | Module specifications | Stable behavior and design at each manifest-routed `<module-path>/docs/README.md` |
31
+ | [ADR](../adr/index.md) | A durable decision, its deciders, rationale, consequences and supersession lineage |
32
+
33
+ ## Instantiated specification registry
34
+
35
+ | Resource | Role | Canonical path | Owner | Status | Last verified |
36
+ | --- | --- | --- | --- | --- | --- |
37
+ | Package | Architecture | `docs/architecture.md` | Cisco Webex for Developers | Active | 2026-10-07 |
38
+ | `src` | Module — plugin host and export surface | `src/docs/README.md` | Cisco Webex for Developers | Active | 2026-10-07 |
39
+ | `src/interceptors` | Module — request/response interceptors | `src/interceptors/docs/README.md` | Cisco Webex for Developers | Active | 2026-10-07 |
40
+ | `src/lib/credentials` | Module — OAuth credentials | `src/lib/credentials/docs/README.md` | Cisco Webex for Developers | Active | 2026-10-07 |
41
+ | `src/lib/services` | Module — v1 service discovery | `src/lib/services/docs/README.md` | Cisco Webex for Developers | Active | 2026-10-07 |
42
+ | `src/lib/services-v2` | Module — v2 service discovery | `src/lib/services-v2/docs/README.md` | Cisco Webex for Developers | Active | 2026-10-07 |
43
+ | `src/lib/storage` | Module — persistence layer | `src/lib/storage/docs/README.md` | Cisco Webex for Developers | Active | 2026-10-07 |
44
+
45
+ ### Module registry
46
+
47
+ One row per module in `.sdd/manifest.json`, which stays authoritative; this table is its
48
+ human-readable mirror and the reconciliation surface for `scripts/check_spec_index.py`.
49
+
50
+ | Module | Responsibility | Manifest coverage state | Start here |
51
+ | --- | --- | --- | --- |
52
+ | `src/` | Plugin host: WebexCore construction, plugin registration, interceptor-chain assembly, config defaults, plugin base classes, Batcher, Page, WebexHttpError and the package export surface | Partial | `src/docs/README.md` |
53
+ | ↳ `src/interceptors/` | The sixteen request/response interceptors that implement auth replay, redirects, tracking ids, rate limits, catalog URL validation, timing and logging | Partial | `src/interceptors/docs/README.md` |
54
+ | ↳ `src/lib/credentials/` | OAuth supertoken and scoped user-token lifecycle: refresh, downscope, revoke, login/logout URLs, scope helpers and grant errors | Partial | `src/lib/credentials/docs/README.md` |
55
+ | ↳ `src/lib/services/` | v1 U2C service discovery, host selection and failover, readiness gating, and the service/hostmap/server-error interceptors | Partial | `src/lib/services/docs/README.md` |
56
+ | ↳ `src/lib/services-v2/` | Opt-in TypeScript v2 service discovery over the U2CV2 hostmap, not registered by default | Partial | `src/lib/services-v2/docs/README.md` |
57
+ | ↳ `src/lib/storage/` | persist/waitForValue decorators, bounded and unbounded store factories, MemoryStoreAdapter and storage errors | Partial | `src/lib/storage/docs/README.md` |
58
+
59
+ ## Change and verification routing
60
+
61
+ | Change affects | Load and update | Verification route |
62
+ | --- | --- | --- |
63
+ | Package boundaries or cross-cutting architecture | `docs/architecture.md` and applicable ADRs | `yarn workspace @webex/webex-core test:unit` and affected owner specs |
64
+ | Plugin registration, config defaults, request orchestration or the export barrel | `src/docs/README.md` | Unit tests under `test/unit/spec` plus a dependent-plugin review |
65
+ | An interceptor or the interceptor order | `src/interceptors/docs/README.md` (and `src/docs/README.md` for ordering) | `test/unit/spec/interceptors` and `test/unit/spec/webex-core.js` |
66
+ | Tokens, scopes, refresh or logout | `src/lib/credentials/docs/README.md` | `test/unit/spec/credentials` |
67
+ | Service catalog, host selection or readiness | `src/lib/services/docs/README.md` or `src/lib/services-v2/docs/README.md` | `test/unit/spec/services` or `test/unit/spec/services-v2` |
68
+ | Persistence decorators or store factories | `src/lib/storage/docs/README.md` | `test/unit/spec/storage` |
69
+ | A public API, event, package or file contract | The owning module section plus the native source listed in the contract index | Compatibility review across dependent workspace packages |
70
+
71
+ ## Module and contract registration
72
+
73
+ Every module specification lives at the exact `modules[].canonical_spec` path recorded in
74
+ `.sdd/manifest.json`. The package's contracts are registered in `contract_catalog` and indexed in
75
+ [`docs/architecture.md`](../architecture.md#public-and-consumer-surfaces); each owning module links the
76
+ same native source. The package is an SDK, so no OpenAPI document applies.
package/package.json CHANGED
@@ -33,16 +33,16 @@
33
33
  "@sinonjs/fake-timers": "^6.0.1",
34
34
  "@webex/babel-config-legacy": "0.0.0",
35
35
  "@webex/eslint-config-legacy": "0.0.0",
36
- "@webex/internal-plugin-device": "3.12.0-next.7",
36
+ "@webex/internal-plugin-device": "3.12.0-next.66",
37
37
  "@webex/jest-config-legacy": "0.0.0",
38
38
  "@webex/legacy-tools": "0.0.0",
39
- "@webex/plugin-logger": "3.12.0-next.7",
40
- "@webex/test-helper-chai": "3.11.0-next.1",
41
- "@webex/test-helper-make-local-url": "3.11.0-next.1",
42
- "@webex/test-helper-mocha": "3.11.0-next.1",
43
- "@webex/test-helper-mock-webex": "3.11.0-next.1",
44
- "@webex/test-helper-refresh-callback": "3.11.0-next.1",
45
- "@webex/test-helper-test-users": "3.11.0-next.1",
39
+ "@webex/plugin-logger": "3.12.0-next.68",
40
+ "@webex/test-helper-chai": "3.12.0-next.13",
41
+ "@webex/test-helper-make-local-url": "3.12.0-next.13",
42
+ "@webex/test-helper-mocha": "3.12.0-next.13",
43
+ "@webex/test-helper-mock-webex": "3.12.0-next.13",
44
+ "@webex/test-helper-refresh-callback": "3.12.0-next.13",
45
+ "@webex/test-helper-test-users": "3.12.0-next.13",
46
46
  "chai": "^4.3.4",
47
47
  "chai-as-promised": "^7.1.1",
48
48
  "eslint": "^8.24.0",
@@ -50,10 +50,10 @@
50
50
  "sinon": "^9.2.4"
51
51
  },
52
52
  "dependencies": {
53
- "@webex/common": "3.11.0-next.1",
54
- "@webex/common-timers": "3.11.0-next.1",
55
- "@webex/http-core": "3.11.0-next.1",
56
- "@webex/storage-adapter-spec": "3.11.0-next.1",
53
+ "@webex/common": "3.12.0-next.13",
54
+ "@webex/common-timers": "3.12.0-next.14",
55
+ "@webex/http-core": "3.12.0-next.13",
56
+ "@webex/storage-adapter-spec": "3.12.0-next.14",
57
57
  "ampersand-collection": "^2.0.2",
58
58
  "ampersand-events": "^2.0.2",
59
59
  "ampersand-state": "^5.0.3",
@@ -73,5 +73,5 @@
73
73
  "test:style": "eslint ./src/**/*.*",
74
74
  "test:unit": "webex-legacy-tools test --unit --runner jest"
75
75
  },
76
- "version": "3.12.0-next.7"
76
+ "version": "3.12.0-next.71"
77
77
  }