@webex/internal-plugin-support 3.13.0-next.1 → 3.13.0-next.11
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 +437 -0
- package/.sdd/manifest.json +430 -0
- package/AGENTS.md +197 -0
- package/dist/support.js +1 -1
- package/docs/adr/0001-retain-product-readme.md +97 -0
- package/docs/adr/index.md +25 -0
- package/docs/architecture.md +260 -0
- package/docs/getting-started.md +122 -0
- package/docs/index.md +42 -0
- package/docs/specs/README.md +67 -0
- package/package.json +12 -12
- package/schemas/repo-context.schema.json +796 -0
- package/src/docs/README.md +436 -0
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Module Spec
|
|
3
|
+
title: 'Support plugin specification'
|
|
4
|
+
description: Responsibilities, boundaries, design, invariants, and verification for the Support 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-12T12:27:40Z
|
|
13
|
+
validation_status: pass-with-warnings
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
# Support plugin
|
|
17
|
+
|
|
18
|
+
This source-local document at `src/docs/README.md` owns the stable specification for **the Support
|
|
19
|
+
plugin**: the internal plugin `webex.internal.support`. It fetches the desk feedback and desk support
|
|
20
|
+
URLs from the conversation service, and it uploads the SDK's logs, or logs the caller supplies, to the
|
|
21
|
+
client logs service (catalog service `clientLogs`) together with a key-value metadata list that
|
|
22
|
+
identifies the call, meeting, user, and organization. Ground every claim in package evidence and link
|
|
23
|
+
to the [package architecture](../../docs/architecture.md) instead of repeating broader facts. No
|
|
24
|
+
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 `3377fcc30e` |
|
|
38
|
+
| Module id | `internal-plugin-support` |
|
|
39
|
+
| Parent spec | — |
|
|
40
|
+
| Doc kind | Module spec |
|
|
41
|
+
| Coverage score | 100% assessed 2026-11-12 by the generator — 15 of 15 mandatory fields PRESENT, critical 8 of 8; `test:unit` runs 43 passing cases in `test/unit/spec/support.js`, while `MOD-001` to `MOD-004`, the client-token fallback of `MOD-006`, and `INV-005` have no test |
|
|
42
|
+
| Validation status | Pass with warnings — validator runtime `01a1cfae-ad4f-7710-befe-9beb15f9c6b4`, 2026-11-12; 0 Blocking and 1 Important finding (B11-001, command-source parity for five command entries), accepted as a warning |
|
|
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/support.js` | Tier |
|
|
49
|
+
| `module.has_ui` | N/A | `src/support.js` sends requests and resolves promises; it renders nothing | UI use-case flow |
|
|
50
|
+
| `module.crosses_service_boundaries` | Applicable | `src/support.js` calls the conversation service and the client logs service, and PUTs to a URL the client logs service returns | Cross-boundary use-case flow |
|
|
51
|
+
| `module.holds_client_state` | Applicable | `src/support.js` commits or rolls back the logger's buffer indexes and reads the device identity; its defaults live in `src/config.js` | Client state model |
|
|
52
|
+
| `module.enforces_domain_rules` | Applicable | The full-or-diff choice, the fixed metadata key list, and the log file name rule in `src/support.js` | Business rules and invariants |
|
|
53
|
+
| `module.is_concurrent_async` | Applicable | Every method returns a promise; `src/support.js` does not serialize concurrent log uploads | Concurrency and reactive flow |
|
|
54
|
+
| `module.owns_persistence` | N/A | Log buffers are held by the logger plugin; `src/support.js` stores nothing itself | Data, schema, and migration discipline |
|
|
55
|
+
| `module.stateful_transitions` | Applicable | A diff log span moves from pending to committed, rolled back, or skipped through `src/support.js` | State machine |
|
|
56
|
+
| `module.exposes_wire_protocol` | Applicable | The three upload phase bodies, the metadata list, and the desk URL requests in `src/support.js` | Protocol and wire format |
|
|
57
|
+
| `module.ui_multi_screen` | N/A | No UI | UI flow |
|
|
58
|
+
| `module.large_data_model` | N/A | No local data model; bodies are covered under Protocol and wire format | Data model |
|
|
59
|
+
| `module.returns_caller_errors` | Applicable | Token, upload, and request failures reject the methods in `src/support.js` | Caller-visible failure modes |
|
|
60
|
+
| `module.module_specific_conventions` | Applicable | The Support: log prefix and the metadata key list in `src/support.js` | Module-specific rules |
|
|
61
|
+
| `module.published_package` | Applicable | `package.json` names the package @webex/internal-plugin-support 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 | Client-token fallback, rollback only on request, and the logger readiness check in `src/support.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` | Imports `@webex/internal-plugin-device`, then `registerInternalPlugin('support', Support, {config})` at import time; re-exports the default `Support` |
|
|
71
|
+
| `src/support.js` | `Support` extends `WebexPlugin` in namespace `Support` with `getFeedbackUrl`, `getSupportUrl`, `submitLogs`, and `_constructFileMetadata`; the JSDoc of `submitLogs` and the comment on the logger readiness check are the only recorded rationale in the package |
|
|
72
|
+
| `src/config.js` | Defaults for `config.support` and for `config.device.preDiscoveryServices` |
|
|
73
|
+
| `package.json` | Name, `main` (`dist/index.js`), `devMain` (`src/index.js`), `engines` (`node >=18`), dependencies, and scripts; `test:unit` exists, `test:integration` does not |
|
|
74
|
+
| `test/unit/spec/support.js` | 43 jest cases over `_constructFileMetadata` and `submitLogs` with `@webex/test-helper-mock-webex` and sinon stubs; it imports the package by name, so it tests `dist/` |
|
|
75
|
+
| `test/integration/spec/support.js` | Live-service case for `submitLogs` with a test user; run only by `test:browser` |
|
|
76
|
+
| `README.md` | Retained npm page; context only. Its Usage block shows a placeholder member and no method; see `docs/adr/0001-retain-product-readme.md` |
|
|
77
|
+
| Sibling package webex-core, file src/docs/README.md | Module spec consulted, agrees with code. `registerInternalPlugin` keys the plugin by its raw name and the first registration wins; `upload` requires `file` (MOD-038), fills the three phase blocks (MOD-039), aborts above the size limit (MOD-040), resolves `$`-prefixed phase keys against the initialize body (MOD-041), and resolves the finalize body merged with its headers (MOD-042) |
|
|
78
|
+
| Sibling package webex-core, file src/lib/credentials/docs/README.md | Credentials spec consulted, agrees with code. `Token.toString` (MOD-007), `getUserToken` rejection when the state cannot authorize (MOD-031), uncached `getClientToken` (MOD-039) |
|
|
79
|
+
| Sibling package webex-core, files src/interceptors/docs/README.md, src/interceptors/auth.js | Interceptors spec consulted, agrees with code: on a 401 the auth interceptor deletes `authorization`, refreshes, and replays unless `shouldRefreshAccessToken` is `false` (INT-007). Source: an existing `authorization` header is kept |
|
|
80
|
+
| Sibling package webex-core, file src/lib/services/docs/README.md | Services spec consulted, agrees with code: `api` maps to `service` and the resource is joined to the catalog URL (SVC-022) |
|
|
81
|
+
| Sibling package plugin-logger, files src/docs/README.md, src/logger.js | Module spec consulted, agrees with code and names this package as the consumer. `formatLogs({diff})` returns newline-joined text and with `diff` advances `nextIndex` (MOD-011); `updateLastSubmittedIndex` and `resetBufferToLastSuccessfulUpload` move the indexes (MOD-012) |
|
|
82
|
+
| Sibling package internal-plugin-device, files src/docs/README.md, src/device.js | Spec consulted: registration DTO properties are set from the body and unknown fields are kept (`extraProperties: 'allow'`). Source: `userId` is declared; `orgId` is not, so it exists only when the registration body carries it |
|
|
83
|
+
| Workspace search for readers of device.preDiscoveryServices | No source file in the workspace reads `config.device.preDiscoveryServices`; webex-core, internal-plugin-user, and internal-plugin-metrics only define entries under it |
|
|
84
|
+
| Observation, no stated WHY | Behavior the code shows without stating a reason is recorded once, under Pitfalls and constraints |
|
|
85
|
+
|
|
86
|
+
## Purpose and boundary
|
|
87
|
+
|
|
88
|
+
- Responsibility: let a Webex client hand the user a desk feedback or desk support link, and upload the
|
|
89
|
+
SDK's logs to the client logs service tagged with the call, meeting, feedback, user, and organization
|
|
90
|
+
they belong to, sending only the logs since the last upload when asked.
|
|
91
|
+
- In scope: registration of `support` and its configuration defaults; `getFeedbackUrl`;
|
|
92
|
+
`getSupportUrl`; `submitLogs`, including the log choice, the token choice, the upload options, and the
|
|
93
|
+
logger index commit or rollback; `_constructFileMetadata`.
|
|
94
|
+
- Out of scope: buffering and formatting the logs (`@webex/plugin-logger`); the three-phase upload,
|
|
95
|
+
its size limit, and its retry (`webex.upload` in `@webex/webex-core`); token acquisition and refresh
|
|
96
|
+
(webex-core credentials); service-catalog resolution, authorization headers, and 401 handling
|
|
97
|
+
(webex-core interceptors and services); device registration and identity
|
|
98
|
+
(`@webex/internal-plugin-device`); what the services do with the logs and feedback.
|
|
99
|
+
- Consumers: in this repository `@webex/calling` (`uploadLogs` in its common utilities) and
|
|
100
|
+
`@webex/contact-center` (`WebexRequest.uploadLogs`) call `submitLogs` with `{type: 'diff'}`;
|
|
101
|
+
`@webex/plugin-meetings` (`LogsRequest.uploadLogs`) calls it with metadata only. `webex`,
|
|
102
|
+
`webex-node`, `@webex/webex-server`, `@webex/recipe-private-web-client`, and
|
|
103
|
+
`@webex/contact-center` import the package to register it. No in-repo code calls `getFeedbackUrl` or
|
|
104
|
+
`getSupportUrl`; first-party clients reach the plugin as `webex.internal.support`.
|
|
105
|
+
|
|
106
|
+
## Structure and key files
|
|
107
|
+
|
|
108
|
+
| Path | Responsibility |
|
|
109
|
+
| ---- | -------------- |
|
|
110
|
+
| `src/index.js` | Imports the device plugin, registers internal plugin `support` with its config, and exports the class as default |
|
|
111
|
+
| `src/support.js` | `Support`, where `getFeedbackUrl`, `getSupportUrl`, `submitLogs`, and `_constructFileMetadata` live |
|
|
112
|
+
| `src/config.js` | Defaults under `support` and `device.preDiscoveryServices` |
|
|
113
|
+
| `package.json` | Package name, entry points, scripts, and dependencies |
|
|
114
|
+
| `babel.config.js`, `jest.config.js` | Re-exports of the legacy Babel and Jest configurations |
|
|
115
|
+
| `.eslintrc.js` | Sets `root: true` and extends `@webex/eslint-config-legacy` |
|
|
116
|
+
| `process` | Package-root file exporting `{browser: true}`; not imported by `src/` |
|
|
117
|
+
| `src/docs/README.md` | This module specification; ignored by the build and by lint |
|
|
118
|
+
| `test/unit/spec/support.js` | Unit cases run by `test:unit` |
|
|
119
|
+
| `test/integration/spec/support.js` | Live-service case run by `test:browser` |
|
|
120
|
+
| dist/ (generated) | Build output of `build:src`; ignored by Git and never edited by hand |
|
|
121
|
+
|
|
122
|
+
## Public surface
|
|
123
|
+
|
|
124
|
+
| Surface | Consumer | Compatibility commitment | Source |
|
|
125
|
+
| ------- | -------- | ------------------------ | ------ |
|
|
126
|
+
| Import side effect: internal plugin `support` with the defaults of `MOD-002`, plus the device plugin | `webex`, `webex-node`, `@webex/webex-server`, `@webex/recipe-private-web-client`, `@webex/contact-center` | First registration of the name wins; reached as `webex.internal.support` | `src/index.js`, `src/config.js` |
|
|
127
|
+
| `submitLogs(metadata, logs, options)` | `@webex/calling`, `@webex/contact-center`, `@webex/plugin-meetings`; first-party clients | Resolves the finalize response body merged with its headers | `src/support.js` |
|
|
128
|
+
| `getFeedbackUrl(options)` | First-party clients | Resolves the feedback URL string | `src/support.js` |
|
|
129
|
+
| `getSupportUrl()` | First-party clients | Resolves the support URL string | `src/support.js` |
|
|
130
|
+
| `_constructFileMetadata(metadata)` | `submitLogs`; the unit spec | Underscore-prefixed; reachable on the instance but not a supported entry | `src/support.js` |
|
|
131
|
+
| Default export `Support` | Clients that mount the class themselves | The entry exports nothing else | `src/index.js` |
|
|
132
|
+
|
|
133
|
+
Contract ID `support-internal-sdk` is indexed in the
|
|
134
|
+
[package architecture](../../docs/architecture.md#public-and-consumer-surfaces) and registered in
|
|
135
|
+
`.sdd/manifest.json`. Export stability is under [Export stability](#export-stability).
|
|
136
|
+
|
|
137
|
+
## Dependencies
|
|
138
|
+
|
|
139
|
+
| Dependency | Why it is required | Failure behavior |
|
|
140
|
+
| ---------- | ------------------ | ---------------- |
|
|
141
|
+
| `@webex/webex-core` plugin host (module spec consulted) | `registerInternalPlugin`, `WebexPlugin` (`webex`, `config`, `logger`, `request`), `webex.request`, and `webex.sessionId` | A request rejection rejects the method |
|
|
142
|
+
| `@webex/webex-core` upload (module spec consulted) | `webex.upload` runs the three phases of `MOD-007` | Its rejection is handled by `MOD-009` |
|
|
143
|
+
| `@webex/webex-core` credentials (credentials spec consulted) | `getUserToken`, `getClientToken`, and `Token.toString` for the upload header | A `getClientToken` rejection rejects `submitLogs` |
|
|
144
|
+
| `@webex/webex-core` interceptors and services (specs consulted) | The auth interceptor keeps the explicit header; the service interceptor resolves `clientLogs` and `conversation` | See Pitfalls for 401 handling |
|
|
145
|
+
| `@webex/plugin-logger` (module spec consulted) | `webex.logger` buffers, `formatLogs`, `updateLastSubmittedIndex`, `resetBufferToLastSuccessfulUpload`, `error` | Not declared in `package.json`; the host provides `webex.logger` |
|
|
146
|
+
| `@webex/internal-plugin-device` (spec consulted; code consulted) | Imported for registration; `userId` and `orgId` for the metadata and the finalize body | Absent values are left out (`INV-004`) |
|
|
147
|
+
| `lodash` | `defaults` for the feedback body and the upload options | Not applicable |
|
|
148
|
+
| `uuid` | `v4` for a missing `feedbackId` | Not applicable |
|
|
149
|
+
| Conversation service and client logs service (external) | Desk URLs; log upload sessions and metadata | Errors propagate |
|
|
150
|
+
|
|
151
|
+
`package.json` also lists `@webex/internal-plugin-search` and four `@webex/test-helper-*` packages
|
|
152
|
+
under `dependencies`; `src/` imports none of them. The integration spec imports the search plugin and
|
|
153
|
+
the test helpers.
|
|
154
|
+
|
|
155
|
+
## Requirements
|
|
156
|
+
|
|
157
|
+
| ID | WHAT | WHY | Source evidence | Test or example evidence | Assumptions or gaps | Confidence |
|
|
158
|
+
| -- | ---- | --- | --------------- | ------------------------ | ------------------- | ---------- |
|
|
159
|
+
| `MOD-001` | Importing the package first imports `@webex/internal-plugin-device`, then registers `Support` as internal plugin `support` with the config of `MOD-002`, so the plugin is `webex.internal.support`. | `submitLogs` and `_constructFileMetadata` read `webex.internal.device`, so the device plugin must be registered with this one (inferred from the import and the reads; no comment states it). | `src/index.js` | `test/unit/spec/support.js` imports the package but mounts the class through a mock children map, so registration is not asserted | WHY inferred from code | Weak |
|
|
160
|
+
| `MOD-002` | Default config: `support` is `{appType: '', appVersion: '', languageCode: '', incrementalLogs: false}`; `device.preDiscoveryServices` sets `atlas` and `atlasServiceUrl` from `ATLAS_SERVICE_URL`, else `https://atlas-a.wbx2.com/admin/api/v1`, and `clientLogs` and `clientLogsServiceUrl` from `CLIENT_LOGS_SERVICE_URL`, else `https://client-logs-a.wbx2.com/api/v1`, read at import. `retryFailedLogUploadsAtNextInterval` has no default. | Gives the app identity and log mode a host can override, and pre-discovery addresses for the atlas and client logs services (inferred from the key names; no comment states it). | `src/config.js` | None found | WHY inferred; no test asserts the defaults; see Pitfalls on the pre-discovery entries | Weak |
|
|
161
|
+
| `MOD-003` | `getFeedbackUrl(options)` treats a missing `options` as `{}`, fills its undefined `appVersion`, `appType`, and `languageCode` from `config.support`, and `feedbackId` with `options.feedbackId` or a fresh `uuid.v4()`, on the caller's object; then sends `request({method: 'POST', api: 'conversation', resource: 'users/deskFeedbackUrl', body: options})` and resolves `res.body.url`. | A feedback form link is tied to the app and to one feedback id, which can also tag an uploaded log through `MOD-010` (inferred from the shared `feedbackId` key; no comment states it). | `src/support.js` | None found | WHY inferred; no test | Weak |
|
|
162
|
+
| `MOD-004` | `getSupportUrl()` sends `webex.request({method: 'GET', api: 'conversation', resource: 'users/deskSupportUrl', qs: {languageCode: config.languageCode}})` and resolves `res.body.url`. | The support page is localized by the configured language (inferred from the query; no comment states it). | `src/support.js` | None found | WHY inferred; no test | Weak |
|
|
163
|
+
| `MOD-005` | `submitLogs(metadata, logs, options = {})` uses a diff upload when `options.type` is `'diff'`, a full upload for any other defined `type`, and `config.incrementalLogs` when `type` is undefined. When `logs` is falsy and `webex.logger` has `sdkBuffer`, `clientBuffer`, and `buffer`, it sets `logs` to `webex.logger.formatLogs({diff})`; otherwise it sends `logs` unchanged. | The JSDoc: a diff sends only the logs since the last upload, a full upload all buffered logs, and the type option overrides the config; the code comment: the buffers exist only once the SDK is fully ready. | `src/support.js` | `test/unit/spec/support.js` six parametrized type and config cases, submits provided logs | None | Present |
|
|
164
|
+
| `MOD-006` | The log file name is `<locusId>_<callStart>.txt` when `metadata` has both, else `<webex.sessionId>.txt`. The upload is authorized with `getUserToken()`, or `getClientToken()` when that rejects, as `{authorization: token.toString()}`. | Logs from a call are named after the call (inferred from the name rule); a client without a usable user token can still upload (inferred from the fallback; no comment states it). | `src/support.js` | `test/unit/spec/support.js` calls getUserToken | The file name rule and the client-token fallback have no test | Weak |
|
|
165
|
+
| `MOD-007` | `submitLogs` calls `webex.upload` with `service: 'clientLogs'`, `resource: 'logs/urls'`, `file: logs`, `shouldAttemptReauth: false`, the header of `MOD-006`, and phases: initialize body `{file: <filename>}`; upload `$uri` from the session `tempURL`; finalize `service: 'clientLogs'`, `resource: 'logs/meta'`, and `$body` `{filename: session.logFilename, data: <the MOD-010 list>, userId: device.userId or session.userId}`, which also records `session.userId`. | The client logs service hands out an upload URL and then takes the metadata for the uploaded file (inferred from the resources; no comment states it). | `src/support.js` | `test/unit/spec/support.js` asserts the uploaded file and invokes the finalize body | The other phase options are not asserted | Present |
|
|
166
|
+
| `MOD-008` | When the upload resolves, `submitLogs` calls `webex.logger.updateLastSubmittedIndex()` and resolves the upload result, adding `userId` from the initialize session when that result has none. | Marks the uploaded span so the next diff starts after it (plugin-logger MOD-012); callers read the user id the logs were filed under. | `src/support.js` | `test/unit/spec/support.js` updateLastSubmittedIndex, response body, userId added and not overwritten cases | None | Present |
|
|
167
|
+
| `MOD-009` | When the upload rejects, a diff upload with a truthy `config.retryFailedLogUploadsAtNextInterval` logs `Support: Failed to upload logs. Will retry to upload these logs at next interval` with the error through `webex.logger.error` and calls `webex.logger.resetBufferToLastSuccessfulUpload()`; in every case `submitLogs` rejects with the upload error and does not call `updateLastSubmittedIndex`. | The log message: the failed logs are uploaded again at the next interval. | `src/support.js` | `test/unit/spec/support.js` eight parametrized reset cases and two rejection cases | None | Present |
|
|
168
|
+
| `MOD-010` | `_constructFileMetadata(metadata)` returns `{key, value}` entries for each truthy `metadata` value among `locusId`, `appVersion`, `callStart`, `feedbackId`, `correlationId`, `broadworksCorrelationInfo`, `meetingId`, `surveySessionId`, `productAreaTag`, `issueTypeTag`, `issueDescTag`, `locussessionid`, and `autoupload`, in that order, then appends `trackingId` (`webex.sessionId`), `appVersion` (`webex.internal.support.config.appVersion`), `userId` (`device.userId`), and `orgId` (`device.orgId`), each only when truthy. Other metadata keys are dropped. | The finalize body tags the uploaded file so it can be found by call, meeting, feedback, tracking id, user, and organization (inferred from the keys). | `src/support.js` | `test/unit/spec/support.js` #_constructFileMetadata, 16 cases | The trackingId omission case checks a key the code never emits (see Pitfalls) | Present |
|
|
169
|
+
|
|
170
|
+
## Design overview
|
|
171
|
+
|
|
172
|
+
`Support` is a thin `WebexPlugin` with no state of its own. Two methods are plain conversation-service
|
|
173
|
+
requests that resolve a URL. The third, `submitLogs`, is a coordinator: it decides which logs to send,
|
|
174
|
+
names the file, builds the metadata list, chooses a token, and hands everything to `webex.upload`, which
|
|
175
|
+
runs the three phases against the client logs service.
|
|
176
|
+
|
|
177
|
+
The logs normally come from `webex.logger`. In a diff upload, `formatLogs` advances the logger's next
|
|
178
|
+
index as it reads; `submitLogs` then commits that index on success or, when the host asked for it,
|
|
179
|
+
rolls it back on failure. The logger owns the buffers and the indexes; this plugin only decides which
|
|
180
|
+
call to make.
|
|
181
|
+
|
|
182
|
+
The configuration also places client logs and atlas addresses under `device.preDiscoveryServices`,
|
|
183
|
+
but the upload addresses the service by catalog name.
|
|
184
|
+
|
|
185
|
+
## Data flow and sequence coverage
|
|
186
|
+
|
|
187
|
+
Call style: in-process method calls on `webex.internal.support`; outbound HTTPS through
|
|
188
|
+
`webex.request` and `webex.upload`; log text read from `webex.logger`. Two operation groups differ in
|
|
189
|
+
actors and outcome, and each has a diagram.
|
|
190
|
+
|
|
191
|
+
| Operation group | Entry and outcome | Diagram or evidence | Failure and recovery coverage |
|
|
192
|
+
| --------------- | ----------------- | ------------------- | ----------------------------- |
|
|
193
|
+
| Desk URLs | `getFeedbackUrl` POSTs and `getSupportUrl` GETs on the conversation service, resolving `body.url` | Diagram 1; `src/support.js` | Request errors reject |
|
|
194
|
+
| Log upload | `submitLogs` reads the logs, chooses a token, runs the three upload phases, and commits or rolls back the logger index | Diagram 2; `src/support.js` | Token and upload errors reject; diff rollback on request |
|
|
195
|
+
|
|
196
|
+
Diagram 1 — desk URLs:
|
|
197
|
+
|
|
198
|
+
```mermaid
|
|
199
|
+
sequenceDiagram
|
|
200
|
+
participant C as Caller
|
|
201
|
+
participant S as Support
|
|
202
|
+
participant V as conversation service
|
|
203
|
+
C->>S: getFeedbackUrl(options)
|
|
204
|
+
S->>V: POST users/deskFeedbackUrl {appVersion, appType, feedbackId, languageCode, ...}
|
|
205
|
+
V-->>S: body.url
|
|
206
|
+
S-->>C: url
|
|
207
|
+
C->>S: getSupportUrl()
|
|
208
|
+
S->>V: GET users/deskSupportUrl?languageCode
|
|
209
|
+
V-->>S: body.url
|
|
210
|
+
S-->>C: url
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Diagram 2 — log upload:
|
|
214
|
+
|
|
215
|
+
```mermaid
|
|
216
|
+
sequenceDiagram
|
|
217
|
+
participant C as Caller
|
|
218
|
+
participant S as Support
|
|
219
|
+
participant L as webex.logger
|
|
220
|
+
participant K as credentials
|
|
221
|
+
participant U as webex.upload
|
|
222
|
+
participant G as clientLogs
|
|
223
|
+
C->>S: submitLogs(metadata, logs, {type})
|
|
224
|
+
opt no logs and the logger buffers exist
|
|
225
|
+
S->>L: formatLogs({diff})
|
|
226
|
+
end
|
|
227
|
+
S->>K: getUserToken()
|
|
228
|
+
alt rejects
|
|
229
|
+
S->>K: getClientToken()
|
|
230
|
+
end
|
|
231
|
+
S->>U: upload({service: clientLogs, file, headers, phases})
|
|
232
|
+
U->>G: POST logs/urls {file: filename}
|
|
233
|
+
G-->>U: session {tempURL, logFilename, userId}
|
|
234
|
+
U->>G: PUT tempURL (log text, no SDK authorization)
|
|
235
|
+
U->>G: POST logs/meta {filename, data, userId}
|
|
236
|
+
alt upload resolves
|
|
237
|
+
G-->>U: body and headers
|
|
238
|
+
S->>L: updateLastSubmittedIndex()
|
|
239
|
+
S-->>C: result, with session userId when missing
|
|
240
|
+
else upload rejects
|
|
241
|
+
opt diff and retryFailedLogUploadsAtNextInterval
|
|
242
|
+
S->>L: error(...), resetBufferToLastSuccessfulUpload()
|
|
243
|
+
end
|
|
244
|
+
S-->>C: rejects with the upload error
|
|
245
|
+
end
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Class and component relationships
|
|
249
|
+
|
|
250
|
+
```mermaid
|
|
251
|
+
classDiagram
|
|
252
|
+
class WebexPlugin
|
|
253
|
+
class Support {
|
|
254
|
+
namespace Support
|
|
255
|
+
getFeedbackUrl(options)
|
|
256
|
+
getSupportUrl()
|
|
257
|
+
submitLogs(metadata, logs, options)
|
|
258
|
+
_constructFileMetadata(metadata)
|
|
259
|
+
}
|
|
260
|
+
WebexPlugin <|-- Support
|
|
261
|
+
Support ..> logger : formatLogs, updateLastSubmittedIndex, resetBufferToLastSuccessfulUpload
|
|
262
|
+
Support ..> credentials : getUserToken, getClientToken
|
|
263
|
+
Support ..> upload : webex.upload
|
|
264
|
+
Support ..> device : userId, orgId
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Use cases and flows
|
|
268
|
+
|
|
269
|
+
| Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
|
|
270
|
+
| -------- | --------------- | ------------------------- | ---------------------------- | -------- |
|
|
271
|
+
| `UC-001` | Calling SDK uploading logs | `submitLogs({...metadata, feedbackId}, undefined, {type: 'diff'})`; reads `trackingid` and `url` from the result | Rejects on failure; the caller logs and reports a metric | `src/support.js` |
|
|
272
|
+
| `UC-002` | Contact center SDK uploading logs | As `UC-001` | As `UC-001` | `src/support.js` |
|
|
273
|
+
| `UC-003` | Meetings SDK uploading a meeting's logs | `submitLogs({autoupload, locussessionid, feedbackId, locusId, correlationId, meetingId, callStart})`; the config decides full or diff | Rejects on failure; the caller logs and rethrows | `src/support.js` |
|
|
274
|
+
| `UC-004` | Client uploading its own log text | `submitLogs(metadata, logs)`; the logger is not read | As `UC-001` | `src/support.js`, `test/unit/spec/support.js` |
|
|
275
|
+
| `UC-005` | Client opening a feedback or support page | `getFeedbackUrl({feedbackId})` or `getSupportUrl()` | Request errors reject | `src/support.js` |
|
|
276
|
+
|
|
277
|
+
The consumers of `UC-001` to `UC-003` live in the sibling packages calling, contact-center, and
|
|
278
|
+
plugin-meetings.
|
|
279
|
+
|
|
280
|
+
### Cross-boundary use-case flow
|
|
281
|
+
|
|
282
|
+
| Boundary | Transport and ordering | Compatibility | Timeout, retry, and recovery |
|
|
283
|
+
| -------- | ---------------------- | ------------- | ---------------------------- |
|
|
284
|
+
| Conversation service (`UC-005`) | HTTPS through `webex.request`, service `conversation` from the catalog | Requests under Protocol and wire format | No retry or timeout in this module; webex-core interceptors apply |
|
|
285
|
+
| Client logs service (`UC-001` to `UC-004`) | `webex.upload`: initialize, upload, finalize, in that order | Bodies under Protocol and wire format | `webex.upload` retries the upload phase only; a rejection is handled by `MOD-009` |
|
|
286
|
+
| Credentials (`UC-001` to `UC-004`) | User token, then client token on rejection, before the upload | Owned by webex-core credentials | A client-token rejection rejects `submitLogs` |
|
|
287
|
+
|
|
288
|
+
## Client state model
|
|
289
|
+
|
|
290
|
+
| State or slice | Owner | Initial state | Transition triggers | Reset or persistence boundary |
|
|
291
|
+
| -------------- | ----- | ------------- | ------------------- | ----------------------------- |
|
|
292
|
+
| Logger `nextIndex` and `lastSubmitted` per buffer | `@webex/plugin-logger` | `0` | `formatLogs({diff: true})` advances `nextIndex`; `submitLogs` commits it or rolls it back (`MOD-008`, `MOD-009`) | In memory with the logger; see the logger spec |
|
|
293
|
+
| `config.support` | webex-core config, defaults from `src/config.js` | `MOD-002` | Host config at construction | For the life of the SDK instance |
|
|
294
|
+
| Device `userId` and `orgId` | `@webex/internal-plugin-device` | Unset until registration | Device registration | Read only here |
|
|
295
|
+
|
|
296
|
+
## Business rules and invariants
|
|
297
|
+
|
|
298
|
+
| ID | Invariant | WHY | Enforcement source | Test evidence |
|
|
299
|
+
| -- | --------- | --- | ------------------ | ------------- |
|
|
300
|
+
| `INV-001` | `updateLastSubmittedIndex` is called once after a resolved upload and never after a rejected one. | Only uploaded logs may count as submitted. | `src/support.js` | `test/unit/spec/support.js` |
|
|
301
|
+
| `INV-002` | `resetBufferToLastSuccessfulUpload` is called only for a rejected diff upload with a truthy `retryFailedLogUploadsAtNextInterval`. | A full upload does not move the diff index, and the host decides whether failed spans are resent. | `src/support.js` | `test/unit/spec/support.js` |
|
|
302
|
+
| `INV-003` | `submitLogs` never hides an upload rejection: it rejects with the same error, with or without the rollback. | The caller decides how to report the failure. | `src/support.js` | `test/unit/spec/support.js` |
|
|
303
|
+
| `INV-004` | The metadata list carries only truthy values and only the keys named in `MOD-010`. | The finalize body holds known tags only (inferred from the fixed list). | `src/support.js` | `test/unit/spec/support.js` |
|
|
304
|
+
| `INV-005` | Every feedback URL request carries a `feedbackId`, the caller's or a new v4 uuid. | The id ties the feedback to later records (inferred from `MOD-003`). | `src/support.js` | None found |
|
|
305
|
+
|
|
306
|
+
## Concurrency and reactive flow
|
|
307
|
+
|
|
308
|
+
- Execution model: one JavaScript event loop; every method returns a promise.
|
|
309
|
+
- Ordering guarantees: in `submitLogs` the logs are read synchronously before the token request, the
|
|
310
|
+
token is chosen before the upload, and the index commit or rollback follows the upload result.
|
|
311
|
+
- Idempotency and retry: nothing is retried here; `webex.upload` retries its upload phase. A rolled-back
|
|
312
|
+
diff span is resent by the next diff call, not by this one.
|
|
313
|
+
- Fire-and-forget work: none.
|
|
314
|
+
- Shared-state protection: none. Concurrent `submitLogs` calls are not serialized and share the
|
|
315
|
+
logger's indexes. Depending on the order in which interleaved calls settle, the next diff can resend
|
|
316
|
+
a span another call uploaded, or never resend one another call failed to upload (inferred from code;
|
|
317
|
+
no test).
|
|
318
|
+
|
|
319
|
+
## State machine
|
|
320
|
+
|
|
321
|
+
```mermaid
|
|
322
|
+
stateDiagram-v2
|
|
323
|
+
[*] --> settled
|
|
324
|
+
settled --> pending: diff submitLogs reads new entries
|
|
325
|
+
pending --> settled: upload resolves, index committed
|
|
326
|
+
pending --> settled: upload rejects with retry config, index rolled back
|
|
327
|
+
pending --> skipped: upload rejects without retry config
|
|
328
|
+
skipped --> settled: a later upload resolves
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
A diff log span, per logger buffer. `settled` means `nextIndex` equals `lastSubmitted`. In `pending`
|
|
332
|
+
the span has been read but not committed. After a rollback the next diff reads the span again. In
|
|
333
|
+
`skipped` the span stays behind `nextIndex`, so no later diff sends it, and the next resolved upload
|
|
334
|
+
moves `lastSubmitted` past it. Full uploads read every entry and leave `nextIndex` unchanged.
|
|
335
|
+
|
|
336
|
+
## Protocol and wire format
|
|
337
|
+
|
|
338
|
+
| Message or frame | Version | Producer or serializer | Consumer or parser | Compatibility and ordering rule |
|
|
339
|
+
| ---------------- | ------- | ---------------------- | ------------------ | ------------------------------- |
|
|
340
|
+
| `POST <conversation>/users/deskFeedbackUrl`, body: the caller's options with `appVersion`, `appType`, `feedbackId`, `languageCode` filled | Unversioned | `getFeedbackUrl` | Conversation service | Response `body.url` |
|
|
341
|
+
| `GET <conversation>/users/deskSupportUrl?languageCode=<config>` | Unversioned | `getSupportUrl` | Conversation service | Response `body.url` |
|
|
342
|
+
| `POST <clientLogs>/logs/urls`, body `{file: <filename>, uploadProtocol: 'content-length'}`, header `authorization` | Unversioned | `submitLogs` through `webex.upload` | Client logs service | Response session: `tempURL`, `logFilename`, `userId` |
|
|
343
|
+
| `PUT <tempURL>`, body: the log text | Unversioned | `webex.upload` | Storage behind the client logs service | No SDK authorization and no credentials |
|
|
344
|
+
| `POST <clientLogs>/logs/meta`, body `{filename, data: [{key, value}], userId}`, header `authorization` | Unversioned | `submitLogs` through `webex.upload` | Client logs service | Key order of `data` per `MOD-010`; response body and headers are merged into the result |
|
|
345
|
+
| Log text | Unversioned | `formatLogs` in plugin-logger | The upload body | Entries joined by newlines; see the logger spec |
|
|
346
|
+
|
|
347
|
+
## Caller-visible failure modes
|
|
348
|
+
|
|
349
|
+
| Condition | Signal or result | Caller behavior | Retry or recovery | Evidence |
|
|
350
|
+
| --------- | ---------------- | --------------- | ----------------- | -------- |
|
|
351
|
+
| `submitLogs` called without `metadata` | Throws `TypeError` synchronously instead of returning a rejected promise | Always pass an object | Call again with `{}` | `src/support.js` |
|
|
352
|
+
| No logs passed and the logger has no buffers, or a diff finds no new entries (empty text) | Rejects with `` `options.file` is required `` from `webex.upload`; for a diff with retry config the error line and rollback of `MOD-009` also run | Treat as nothing to upload | Call again later | `src/support.js` |
|
|
353
|
+
| Neither a user nor a client token is available | Rejects with the `getClientToken` error | Treat log upload as unavailable | Call again | `src/support.js` |
|
|
354
|
+
| Any upload phase rejects | Rejects with that error (`INV-003`), after the optional rollback | Report the failure | A diff with retry config resends the span at the next diff call | `src/support.js` |
|
|
355
|
+
| The conversation service rejects a desk URL request | The `webex.request` rejection, unchanged | Handle the HTTP error | Call again | `src/support.js` |
|
|
356
|
+
| A desk URL response has no `body` | Rejects with `TypeError`; a body without `url` resolves `undefined` | Check the result | Call again | `src/support.js` |
|
|
357
|
+
|
|
358
|
+
## Pitfalls and constraints
|
|
359
|
+
|
|
360
|
+
- `shouldAttemptReauth: false` is read by no code: the auth interceptor checks
|
|
361
|
+
`shouldRefreshAccessToken`. On a 401 from `logs/urls` or `logs/meta` it therefore deletes the chosen
|
|
362
|
+
header, refreshes when it can, and replays, and the replay can carry the user token in place of a
|
|
363
|
+
client token (inferred from webex-core code and INT-007; no test).
|
|
364
|
+
- No workspace source reads `config.device.preDiscoveryServices`, so the `clientLogs` and `atlas`
|
|
365
|
+
entries of `MOD-002`, and their environment overrides, do not change where logs go; the upload
|
|
366
|
+
resolves `clientLogs` from the service catalog (inferred from a workspace search; no test).
|
|
367
|
+
- `retryFailedLogUploadsAtNextInterval` is set nowhere in this repository; a host enables the rollback
|
|
368
|
+
of `MOD-009` only by setting `config.support.retryFailedLogUploadsAtNextInterval`.
|
|
369
|
+
- The size limit of `webex.upload` (webex-core MOD-040) reads `file.byteLength`. Log text from the
|
|
370
|
+
logger is a string, which has no `byteLength`, so the limit never applies to SDK logs.
|
|
371
|
+
- `metadata.appVersion` and `config.support.appVersion` each add an `appVersion` entry, so both can
|
|
372
|
+
appear in `data` (`MOD-010`).
|
|
373
|
+
- `getFeedbackUrl` modifies the caller's options object (`MOD-003`); reusing it sends the same
|
|
374
|
+
`feedbackId` again.
|
|
375
|
+
- `_constructFileMetadata` reads `appVersion` from `webex.internal.support.config`, not `this.config`;
|
|
376
|
+
the two differ only when the class is mounted under another name.
|
|
377
|
+
- The unit case "does not send sessionId key if sessionId is not defined" looks for key `sessionId`,
|
|
378
|
+
which the code never emits (it emits `trackingId`), so the case passes whatever the code does.
|
|
379
|
+
- The integration spec's comment "Disabled because rackspace is broken" sits on a `describe` that is
|
|
380
|
+
not disabled.
|
|
381
|
+
- `test:style` reports two `require-jsdoc` warnings, on `getFeedbackUrl` and `getSupportUrl`, plus
|
|
382
|
+
"File ignored" for this specification.
|
|
383
|
+
|
|
384
|
+
## Module-specific rules
|
|
385
|
+
|
|
386
|
+
- Do: prefix log lines `Support:` and log no log text, metadata values, token, user id, or org id.
|
|
387
|
+
- Do: add a new metadata tag to the fixed key list of `MOD-010` and to its unit cases; keys outside
|
|
388
|
+
the list are dropped.
|
|
389
|
+
- Do: keep the logger readiness check before calling `formatLogs`, and keep the commit and rollback
|
|
390
|
+
calls tied to the upload result (`INV-001`, `INV-002`).
|
|
391
|
+
- Do not: retry the upload inside `submitLogs`; `webex.upload` retries its upload phase and the
|
|
392
|
+
rollback defers the rest to the next diff call.
|
|
393
|
+
|
|
394
|
+
## Export stability
|
|
395
|
+
|
|
396
|
+
| Export or entry point | Consumer | Stability | Versioning and deprecation rule | Declaration or API report |
|
|
397
|
+
| --------------------- | -------- | --------- | ------------------------------- | ------------------------- |
|
|
398
|
+
| Import side effect: internal plugin `support` and its config defaults | `webex`, `webex-node`, `@webex/webex-server`, `@webex/recipe-private-web-client`, `@webex/contact-center` | Internal | The README states that internal plugins do not strictly follow semantic versioning | `src/index.js` |
|
|
399
|
+
| Default export `Support` and `getFeedbackUrl`, `getSupportUrl`, `submitLogs` | `@webex/calling`, `@webex/contact-center`, `@webex/plugin-meetings`; first-party clients | Internal | Same | `src/index.js`, `src/support.js` |
|
|
400
|
+
|
|
401
|
+
The build writes JavaScript only; `package.json` has no `types` entry, so no declarations or API
|
|
402
|
+
report are published.
|
|
403
|
+
|
|
404
|
+
## Key design trade-off
|
|
405
|
+
|
|
406
|
+
| Chosen trade-off | Preserved invariant or benefit | Cost or limitation | Decision evidence |
|
|
407
|
+
| ---------------- | ------------------------------ | ------------------ | ----------------- |
|
|
408
|
+
| Fall back to a client token when the user token is unavailable | Logs can be uploaded without a usable user token | The upload is then not tied to a user token, and a 401 replay can switch tokens (see Pitfalls) | `src/support.js` |
|
|
409
|
+
| Roll the diff index back only when the host sets `retryFailedLogUploadsAtNextInterval` | A failed span can be resent at the next interval without re-uploading everything | Without the flag a failed span is never resent (State machine) | `src/support.js` |
|
|
410
|
+
| Read the logger only when its three buffers exist | No `formatLogs` call before the SDK is ready | A call before then has nothing to send unless the caller passes logs (see Caller-visible failure modes) | `src/support.js` |
|
|
411
|
+
|
|
412
|
+
## Verification
|
|
413
|
+
|
|
414
|
+
| Requirement or invariant | Test level | Positive evidence | Negative or boundary evidence | Gap |
|
|
415
|
+
| ------------------------ | ---------- | ----------------- | ----------------------------- | --- |
|
|
416
|
+
| `MOD-001` | None | None found | None found | Registration untested |
|
|
417
|
+
| `MOD-002` | None | None found | None found | Defaults and overrides untested |
|
|
418
|
+
| `MOD-003`, `INV-005` | None | None found | None found | Feedback request untested |
|
|
419
|
+
| `MOD-004` | None | None found | None found | Support request untested |
|
|
420
|
+
| `MOD-005` | Unit | `test/unit/spec/support.js` type and config cases | `test/unit/spec/support.js` provided-logs cases | Logger readiness check untested |
|
|
421
|
+
| `MOD-006` | Unit | `test/unit/spec/support.js` getUserToken case | None found | File name and client-token fallback untested |
|
|
422
|
+
| `MOD-007` | Unit, integration | `test/unit/spec/support.js` file and finalize body; `test/integration/spec/support.js` | None found | Phase options not asserted; integration case does not run |
|
|
423
|
+
| `MOD-008`, `INV-001` | Unit | `test/unit/spec/support.js` success cases | `test/unit/spec/support.js` failure cases | None |
|
|
424
|
+
| `MOD-009`, `INV-002`, `INV-003` | Unit | `test/unit/spec/support.js` reset cases | `test/unit/spec/support.js` no-reset and rejection cases | Empty-diff rejection untested |
|
|
425
|
+
| `MOD-010`, `INV-004` | Unit | `test/unit/spec/support.js` #_constructFileMetadata | `test/unit/spec/support.js` omission cases | trackingId omission case is vacuous (see Pitfalls) |
|
|
426
|
+
|
|
427
|
+
`yarn workspace @webex/internal-plugin-support test:unit` ran 43 cases, all passing, on 2026-11-12
|
|
428
|
+
under Node 22.14 after `build:src`. The unit spec imports `@webex/internal-plugin-support` by name, so
|
|
429
|
+
it tests `dist/`; run `build:src` first. `test:browser` runs the integration spec through karma and
|
|
430
|
+
reported 0 tests on 2026-11-12 because the bundle failed to parse `isbot`. `package.json` has no
|
|
431
|
+
`test:integration` script (a script named `test:integratio:broken` runs the integration spec under
|
|
432
|
+
mocha), so the aggregate `test` script stops there. A module specification is complete only when its
|
|
433
|
+
public surface, invariants, failure modes, and test evidence agree with the implementation.
|
|
434
|
+
Generator-side field measurement is complete (100%, assessed 2026-11-12); independent semantic validation passed with warnings on 2026-11-12 (0 Blocking; one Important finding). B11-001, the command-source parity of the workspace-qualified
|
|
435
|
+
command form for five entries, is an accepted warning recorded in `.sdd/manifest.json`
|
|
436
|
+
`modules[0].coverage_evidence`. A characterization baseline and promotion past Partial remain pending.
|