@webex/http-core 3.12.0-next.7 → 3.12.0-next.9
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 +590 -0
- package/.sdd/manifest.json +362 -0
- package/AGENTS.md +219 -0
- package/docs/adr/0001-fork-xhr-for-frozen-object-environments.md +111 -0
- package/docs/adr/index.md +26 -0
- package/docs/architecture.md +335 -0
- package/docs/getting-started.md +108 -0
- package/docs/index.md +46 -0
- package/docs/specs/README.md +79 -0
- package/package.json +8 -8
- package/schemas/repo-context.schema.json +796 -0
- package/src/docs/README.md +485 -0
- package/src/request/docs/README.md +481 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 1,
|
|
3
|
+
"repository": {
|
|
4
|
+
"name": "@webex/http-core",
|
|
5
|
+
"purpose": "Promise-based core HTTP client for the Cisco Webex JS SDK: request execution through an interceptor pipeline, interchangeable Node and browser transports, an HTTP status to error-class taxonomy, upload/download progress events, and buffer file-type detection.",
|
|
6
|
+
"category": "cat2-legacy",
|
|
7
|
+
"primary_languages": [
|
|
8
|
+
"javascript",
|
|
9
|
+
"typescript"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"topology": "Single-repo",
|
|
13
|
+
"commands": {
|
|
14
|
+
"compile": {
|
|
15
|
+
"command": "yarn workspace @webex/http-core build:src",
|
|
16
|
+
"source_file": "package.json",
|
|
17
|
+
"role": "compile"
|
|
18
|
+
},
|
|
19
|
+
"build": {
|
|
20
|
+
"command": "yarn workspace @webex/http-core build:src",
|
|
21
|
+
"source_file": "package.json",
|
|
22
|
+
"role": "build"
|
|
23
|
+
},
|
|
24
|
+
"unit-test": {
|
|
25
|
+
"command": "yarn workspace @webex/http-core test:unit",
|
|
26
|
+
"source_file": "package.json",
|
|
27
|
+
"role": "unit-test"
|
|
28
|
+
},
|
|
29
|
+
"integration-test": {
|
|
30
|
+
"command": "yarn workspace @webex/http-core test:integration",
|
|
31
|
+
"source_file": "package.json",
|
|
32
|
+
"role": "integration-test"
|
|
33
|
+
},
|
|
34
|
+
"browser-test": {
|
|
35
|
+
"command": "yarn workspace @webex/http-core test:browser",
|
|
36
|
+
"source_file": "package.json",
|
|
37
|
+
"role": "other"
|
|
38
|
+
},
|
|
39
|
+
"lint": {
|
|
40
|
+
"command": "yarn workspace @webex/http-core test:style",
|
|
41
|
+
"source_file": "package.json",
|
|
42
|
+
"role": "lint"
|
|
43
|
+
},
|
|
44
|
+
"test-all": {
|
|
45
|
+
"command": "yarn workspace @webex/http-core test",
|
|
46
|
+
"source_file": "package.json",
|
|
47
|
+
"role": "other"
|
|
48
|
+
},
|
|
49
|
+
"deploy": {
|
|
50
|
+
"command": "yarn workspace @webex/http-core deploy:npm",
|
|
51
|
+
"source_file": "package.json",
|
|
52
|
+
"role": "deploy"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"toolchain": [
|
|
56
|
+
{
|
|
57
|
+
"name": "node",
|
|
58
|
+
"version": ">=18",
|
|
59
|
+
"origin": "repo-config",
|
|
60
|
+
"source_file": "package.json"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"tests": {
|
|
64
|
+
"unit": {
|
|
65
|
+
"command_ref": "unit-test",
|
|
66
|
+
"dir": "test/unit",
|
|
67
|
+
"framework": "jest"
|
|
68
|
+
},
|
|
69
|
+
"integration": {
|
|
70
|
+
"command_ref": "integration-test",
|
|
71
|
+
"dir": "test/integration",
|
|
72
|
+
"framework": "mocha",
|
|
73
|
+
"external_deps": [
|
|
74
|
+
"local fixture HTTP server via @webex/test-helper-make-local-url",
|
|
75
|
+
"provisioned Webex test users via @webex/test-helper-test-users"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"quality_gates": {
|
|
80
|
+
"code_coverage": {
|
|
81
|
+
"origin": "none",
|
|
82
|
+
"declared_by": "rarajes2@cisco.com via bootstrap questionnaire"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"coverage_status_definitions": {
|
|
86
|
+
"specced": ">=80% public surface specced, drift <5% - spec is authoritative",
|
|
87
|
+
"partial": "40-80% specced - spec is a hint, cross-check code",
|
|
88
|
+
"untracked": "<40% specced - code is the source of truth"
|
|
89
|
+
},
|
|
90
|
+
"modules": [
|
|
91
|
+
{
|
|
92
|
+
"path": "src",
|
|
93
|
+
"coverage_status": "Partial",
|
|
94
|
+
"coverage_evidence": "Field coverage 93.3% (14/15) assessed 2026-09-23; critical field coverage 16/16. Outstanding: no characterization baseline. Independent validation by codex returned pass-with-warnings on 2026-09-23 with 0 Blocking, 1 Important, and 1 Medium finding at repository scope; promotion to Specced remains held pending the characterization baseline.",
|
|
95
|
+
"canonical_spec": "src/docs/README.md",
|
|
96
|
+
"contracts": {
|
|
97
|
+
"provides": [
|
|
98
|
+
"http-core-sdk",
|
|
99
|
+
"http-core-progress-events",
|
|
100
|
+
"http-core-xhr-fork"
|
|
101
|
+
],
|
|
102
|
+
"requires": [
|
|
103
|
+
"http-core-request-transport",
|
|
104
|
+
"webex-common-sdk"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"last_assessed": "2026-09-23",
|
|
108
|
+
"section_profile": {
|
|
109
|
+
"has_ui": false,
|
|
110
|
+
"crosses_service_boundaries": true,
|
|
111
|
+
"enforces_domain_rules": false,
|
|
112
|
+
"is_concurrent_async": true,
|
|
113
|
+
"owns_persistence": false,
|
|
114
|
+
"returns_caller_errors": true,
|
|
115
|
+
"has_design_tradeoff": true,
|
|
116
|
+
"stateful_transitions": false,
|
|
117
|
+
"exposes_wire_protocol": false,
|
|
118
|
+
"ui_multi_screen": false,
|
|
119
|
+
"large_data_model": false,
|
|
120
|
+
"has_tiers": false,
|
|
121
|
+
"module_specific_conventions": true,
|
|
122
|
+
"published_package": true,
|
|
123
|
+
"embedded_in_host": false,
|
|
124
|
+
"holds_client_state": false,
|
|
125
|
+
"resolved_by": "claude-code/claude-opus-5 (host metadata; bootstrap questionnaire)",
|
|
126
|
+
"resolved_at": "2026-09-23T00:00:00Z",
|
|
127
|
+
"has_submodules": true,
|
|
128
|
+
"has_submodules_computed_by": "scripts/module_tree.py",
|
|
129
|
+
"has_submodules_computed_at": "2026-09-23T04:52:28Z"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"path": "src/request",
|
|
134
|
+
"coverage_status": "Partial",
|
|
135
|
+
"coverage_evidence": "Field coverage 93.3% (14/15) assessed 2026-09-23; critical field coverage 16/16. Outstanding: no characterization baseline; browser-transport behavior remains the least test-covered area. Independent validation by codex returned pass-with-warnings on 2026-09-23 with 0 Blocking, 1 Important, and 1 Medium finding at repository scope; promotion to Specced remains held pending the characterization baseline.",
|
|
136
|
+
"canonical_spec": "src/request/docs/README.md",
|
|
137
|
+
"contracts": {
|
|
138
|
+
"provides": [
|
|
139
|
+
"http-core-request-transport"
|
|
140
|
+
],
|
|
141
|
+
"requires": [
|
|
142
|
+
"http-core-sdk",
|
|
143
|
+
"http-core-progress-events",
|
|
144
|
+
"http-core-xhr-fork",
|
|
145
|
+
"webex-common-sdk",
|
|
146
|
+
"nodejs-request-library"
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"last_assessed": "2026-09-23",
|
|
150
|
+
"section_profile": {
|
|
151
|
+
"has_ui": false,
|
|
152
|
+
"crosses_service_boundaries": true,
|
|
153
|
+
"enforces_domain_rules": false,
|
|
154
|
+
"is_concurrent_async": true,
|
|
155
|
+
"owns_persistence": false,
|
|
156
|
+
"returns_caller_errors": true,
|
|
157
|
+
"has_design_tradeoff": true,
|
|
158
|
+
"stateful_transitions": false,
|
|
159
|
+
"exposes_wire_protocol": false,
|
|
160
|
+
"ui_multi_screen": false,
|
|
161
|
+
"large_data_model": false,
|
|
162
|
+
"has_tiers": false,
|
|
163
|
+
"module_specific_conventions": true,
|
|
164
|
+
"published_package": false,
|
|
165
|
+
"embedded_in_host": false,
|
|
166
|
+
"holds_client_state": false,
|
|
167
|
+
"resolved_by": "claude-code/claude-opus-5 (host metadata; bootstrap questionnaire)",
|
|
168
|
+
"resolved_at": "2026-09-23T00:00:00Z",
|
|
169
|
+
"has_submodules": false,
|
|
170
|
+
"has_submodules_computed_by": "scripts/module_tree.py",
|
|
171
|
+
"has_submodules_computed_at": "2026-09-23T04:52:28Z"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"contract_catalog": {
|
|
176
|
+
"index_path": "docs/architecture.md",
|
|
177
|
+
"definitions": {
|
|
178
|
+
"http-core-sdk": {
|
|
179
|
+
"kind": "sdk",
|
|
180
|
+
"publication": "published",
|
|
181
|
+
"source_kind": "repository-path",
|
|
182
|
+
"source": "package.json",
|
|
183
|
+
"summary": "Published npm package export surface declared by main/devMain/browser: the request and defaults clients, protoprepareFetchOptions and setTimingsAndFetch, the Interceptor extension contract subclasses implement, HttpStatusInterceptor, the HttpError taxonomy and its status-to-class select(), ProgressEvent, and detect. Per-export detail lives in the owning module spec Public surface."
|
|
184
|
+
},
|
|
185
|
+
"http-core-progress-events": {
|
|
186
|
+
"kind": "event",
|
|
187
|
+
"publication": "published",
|
|
188
|
+
"source_kind": "repository-path",
|
|
189
|
+
"source": "src/progress-event.js",
|
|
190
|
+
"summary": "progress events emitted on the caller-visible options.download and options.upload emitters, carrying a ProgressEvent with loaded, total, and lengthComputable."
|
|
191
|
+
},
|
|
192
|
+
"http-core-xhr-fork": {
|
|
193
|
+
"kind": "sdk",
|
|
194
|
+
"publication": "internal",
|
|
195
|
+
"source_kind": "repository-path",
|
|
196
|
+
"source": "src/lib/xhr.js",
|
|
197
|
+
"summary": "Vendored fork of naugtur/xhr held deliberately close to upstream so it keeps working in fully object-frozen environments."
|
|
198
|
+
},
|
|
199
|
+
"http-core-request-transport": {
|
|
200
|
+
"kind": "sdk",
|
|
201
|
+
"publication": "internal",
|
|
202
|
+
"source_kind": "repository-path",
|
|
203
|
+
"source": "src/request/index.js",
|
|
204
|
+
"summary": "Internal transport interface used by the package entry point: applies request interceptors, dispatches to the platform transport or a caller-supplied options.request, then applies response interceptors in reverse order."
|
|
205
|
+
},
|
|
206
|
+
"webex-common-sdk": {
|
|
207
|
+
"kind": "sdk",
|
|
208
|
+
"publication": "published",
|
|
209
|
+
"source_kind": "external",
|
|
210
|
+
"source": "@webex/common (workspace package; Exception and isBuffer exports)",
|
|
211
|
+
"summary": "Shared SDK primitives: the Exception base class HttpError extends, and the isBuffer predicate used for body and response detection."
|
|
212
|
+
},
|
|
213
|
+
"nodejs-request-library": {
|
|
214
|
+
"kind": "sdk",
|
|
215
|
+
"publication": "published",
|
|
216
|
+
"source_kind": "external",
|
|
217
|
+
"source": "request@^2.88.0 (npm)",
|
|
218
|
+
"summary": "Third-party Node HTTP client used as the Node transport; option names are passed through largely unchanged, which is why the public option shape mirrors it."
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"spec_policy": {
|
|
223
|
+
"require_what_and_why": true,
|
|
224
|
+
"require_provenance": true,
|
|
225
|
+
"protected_specs": [
|
|
226
|
+
"src/docs/README.md",
|
|
227
|
+
"src/request/docs/README.md"
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"validation": {
|
|
231
|
+
"generator_runtime": "claude-code",
|
|
232
|
+
"generator_model": "claude-opus-5",
|
|
233
|
+
"generator_run_id": "55d96b7f-265b-4b23-a9d7-e83dbf0dd321",
|
|
234
|
+
"generator_runtime_source": "host-metadata",
|
|
235
|
+
"validator_runtime": "codex",
|
|
236
|
+
"validator_runtime_source": "invocation-input",
|
|
237
|
+
"runtime_fallback_tier": "different-runtime",
|
|
238
|
+
"minimum_independence": "different-runtime",
|
|
239
|
+
"blocking_severities": [
|
|
240
|
+
"Blocking"
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
"layout": {
|
|
244
|
+
"sdd_root": ".sdd",
|
|
245
|
+
"docs_root": "docs",
|
|
246
|
+
"agent_entry_path": "AGENTS.md",
|
|
247
|
+
"standing_docs_root": "docs",
|
|
248
|
+
"spec_index_path": "docs/specs/README.md",
|
|
249
|
+
"module_docs_strategy": "source-local",
|
|
250
|
+
"module_docs_relative_path": "docs/README.md",
|
|
251
|
+
"module_docs_decision": {
|
|
252
|
+
"basis": "repo-standards-default",
|
|
253
|
+
"reason": "No module-local documentation convention exists in this package, so the repo-standards source-local default applies unchanged.",
|
|
254
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
255
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
256
|
+
},
|
|
257
|
+
"repo_context_decision": {
|
|
258
|
+
"path": ".repo-context.json",
|
|
259
|
+
"schema_path": "schemas/repo-context.schema.json",
|
|
260
|
+
"action": "create",
|
|
261
|
+
"schema_action": "create",
|
|
262
|
+
"reason": "Neither the operational context nor its schema exists in this package; both are created from the bundled Repo Standards templates and verified repository evidence.",
|
|
263
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
264
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
265
|
+
},
|
|
266
|
+
"artifact_decisions": [
|
|
267
|
+
{
|
|
268
|
+
"path": "docs/service.md",
|
|
269
|
+
"action": "omit",
|
|
270
|
+
"reason": "This package is a published library, not a deployable service; no deployment descriptor, container, or runtime entry point exists.",
|
|
271
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
272
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"path": "mkdocs.yml",
|
|
276
|
+
"action": "omit",
|
|
277
|
+
"reason": "No package-level documentation build exists; documentation is published by the surrounding workspace pipeline.",
|
|
278
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
279
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"path": "api-specs/openapi.yaml",
|
|
283
|
+
"action": "omit",
|
|
284
|
+
"reason": "The package is an HTTP client and serves no routes; its published surface is the npm package export described by http-core-sdk.",
|
|
285
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
286
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"path": "SECURITY.md",
|
|
290
|
+
"action": "omit",
|
|
291
|
+
"reason": "Absent at both package and workspace root; a per-package security policy would be the wrong home and no reporting contact is established.",
|
|
292
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
293
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"path": "CONTRIBUTING.md",
|
|
297
|
+
"action": "omit",
|
|
298
|
+
"reason": "Contribution instructions are owned at the workspace root and already linked from this package README.md.",
|
|
299
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
300
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"path": "CHANGELOG.md",
|
|
304
|
+
"action": "omit",
|
|
305
|
+
"reason": "Changelog generation is owned at the workspace root; no package-level changelog exists.",
|
|
306
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
307
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"path": "CTO_CHECKLIST.yml",
|
|
311
|
+
"action": "omit",
|
|
312
|
+
"reason": "The CTO readiness workflow applies to deployable services; this package is a published library.",
|
|
313
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
314
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"path": "schemas/cto-checklist.schema.json",
|
|
318
|
+
"action": "omit",
|
|
319
|
+
"reason": "Selected together with CTO_CHECKLIST.yml, which is omitted.",
|
|
320
|
+
"decided_by": "claude-code (bootstrap questionnaire)",
|
|
321
|
+
"decided_at": "2026-09-23T00:00:00Z"
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
"template_roots": {
|
|
325
|
+
"canonical": ".sdd/templates/repo-standards"
|
|
326
|
+
},
|
|
327
|
+
"repo_skills_root": ".sdd/skills",
|
|
328
|
+
"contract_index_path": "docs/architecture.md"
|
|
329
|
+
},
|
|
330
|
+
"substrate": {
|
|
331
|
+
"source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
|
|
332
|
+
"consumed": [
|
|
333
|
+
"@webex/eslint-config-legacy via .eslintrc.js",
|
|
334
|
+
"@webex/babel-config-legacy via babel.config.js",
|
|
335
|
+
"@webex/jest-config-legacy via jest.config.js",
|
|
336
|
+
"@webex/legacy-tools build and test runner via package.json",
|
|
337
|
+
"package README.md"
|
|
338
|
+
],
|
|
339
|
+
"compliance_tier": "baseline"
|
|
340
|
+
},
|
|
341
|
+
"section_profiles": {
|
|
342
|
+
"repo": {
|
|
343
|
+
"owns_datastore": false,
|
|
344
|
+
"holds_client_state": false,
|
|
345
|
+
"components_interact": true,
|
|
346
|
+
"domain_data_across_components": false,
|
|
347
|
+
"caches_data": false,
|
|
348
|
+
"observability_convention": true,
|
|
349
|
+
"deploys_to_infra": false,
|
|
350
|
+
"shared_base_libs": true,
|
|
351
|
+
"is_monorepo": false,
|
|
352
|
+
"multi_platform": true,
|
|
353
|
+
"published_package": true,
|
|
354
|
+
"embedded_in_host": false,
|
|
355
|
+
"cross_repo_deps_material": false,
|
|
356
|
+
"security_arch_warranted": true,
|
|
357
|
+
"exposes_commands_or_artifacts": true
|
|
358
|
+
},
|
|
359
|
+
"resolved_by": "claude-code/claude-opus-5 (host metadata; bootstrap questionnaire)",
|
|
360
|
+
"resolved_at": "2026-09-23T00:00:00Z"
|
|
361
|
+
}
|
|
362
|
+
}
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<!-- sdd-generated-metadata
|
|
2
|
+
doc_kind: agent-entry
|
|
3
|
+
generated_from: agents@0.3.0
|
|
4
|
+
generated_by: claude-code
|
|
5
|
+
approved_by: pending
|
|
6
|
+
updated_at: 2026-09-23T06:29:48Z
|
|
7
|
+
validation_status: pass-with-warnings
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# AI Agent Instructions
|
|
11
|
+
|
|
12
|
+
Instructions for AI coding assistants working in `@webex/http-core`, the core HTTP client of the
|
|
13
|
+
Webex JS SDK.
|
|
14
|
+
|
|
15
|
+
## Working Method
|
|
16
|
+
|
|
17
|
+
- Read the relevant repository files before editing. Do not edit blind.
|
|
18
|
+
- Understand the task and affected surfaces before writing code.
|
|
19
|
+
- Prefer focused edits over rewriting whole files.
|
|
20
|
+
- Do not invent commands, paths, exports, or behavior. Verify them from repository-local source.
|
|
21
|
+
- Test or validate before declaring done.
|
|
22
|
+
- Keep output concise. If something is uncertain, say so instead of guessing.
|
|
23
|
+
- Derive rationale from code and tests. This package's commit history begins at the 2022 workspace
|
|
24
|
+
migration while the code predates it, so commit messages are not a reliable source for why current
|
|
25
|
+
behavior exists.
|
|
26
|
+
|
|
27
|
+
## Canonical Repository Documentation
|
|
28
|
+
|
|
29
|
+
Before changing code or documentation, start with:
|
|
30
|
+
|
|
31
|
+
- `docs/index.md` for repository documentation navigation;
|
|
32
|
+
- `docs/architecture.md` for repository boundaries and interactions;
|
|
33
|
+
- `docs/specs/README.md` for the manifest-backed module and contract registry;
|
|
34
|
+
- the affected module's manifest-routed `<module-path>/docs/README.md`; and
|
|
35
|
+
- `docs/adr/index.md` plus applicable concrete ADRs for durable decisions.
|
|
36
|
+
|
|
37
|
+
Follow `.sdd/manifest.json` for each contract's publication state and canonical source. Published
|
|
38
|
+
repository-owned HTTP APIs use their linked OpenAPI document; internal HTTP surfaces may link route
|
|
39
|
+
code, and published SDKs use their ecosystem-native API artifact. The manifest remains authoritative
|
|
40
|
+
for canonical paths and artifact decisions.
|
|
41
|
+
|
|
42
|
+
This package publishes an SDK surface rather than serving HTTP routes, so its native contract source
|
|
43
|
+
is `package.json` and the export surface it declares. There is no OpenAPI document.
|
|
44
|
+
|
|
45
|
+
## 1. Commands (Run First)
|
|
46
|
+
|
|
47
|
+
Use only documented commands. Do not invent alternatives when a command is missing.
|
|
48
|
+
|
|
49
|
+
| Task | Command |
|
|
50
|
+
| ---------------------- | --------------------------------------------------- |
|
|
51
|
+
| Install dependencies | `yarn install` (from the workspace root) |
|
|
52
|
+
| Start dev environment | Not applicable — this package is a library |
|
|
53
|
+
| Run tests | `yarn workspace @webex/http-core test:unit` |
|
|
54
|
+
| Run linters | `yarn workspace @webex/http-core test:style` |
|
|
55
|
+
| Build/release artifact | `yarn workspace @webex/http-core build:src` |
|
|
56
|
+
| Format code | No format script is defined; `prettier` is available as a devDependency in `package.json` |
|
|
57
|
+
|
|
58
|
+
Additional verified commands from `package.json`:
|
|
59
|
+
|
|
60
|
+
| Task | Command |
|
|
61
|
+
| ----------------------------- | ---------------------------------------------------- |
|
|
62
|
+
| Integration tests (mocha) | `yarn workspace @webex/http-core test:integration` |
|
|
63
|
+
| Browser tests (karma) | `yarn workspace @webex/http-core test:browser` |
|
|
64
|
+
| All tiers in sequence | `yarn workspace @webex/http-core test` |
|
|
65
|
+
| Publish | `yarn workspace @webex/http-core deploy:npm` |
|
|
66
|
+
|
|
67
|
+
No command builds the package and runs its tests together. `build` delegates to `build:src` and
|
|
68
|
+
compiles only; `test` chains the test tiers without building. If you need both, run them separately.
|
|
69
|
+
|
|
70
|
+
If a required command is unknown, stop and ask for the exact command.
|
|
71
|
+
|
|
72
|
+
## 2. Agent Persona and Scope
|
|
73
|
+
|
|
74
|
+
You are the engineering assistant for `@webex/http-core`, the HTTP transport layer every other Webex
|
|
75
|
+
SDK plugin makes network calls through.
|
|
76
|
+
|
|
77
|
+
Primary outcomes:
|
|
78
|
+
|
|
79
|
+
- Deliver production-safe changes with passing tests.
|
|
80
|
+
- Preserve existing behavior unless a change request explicitly requires a behavior change.
|
|
81
|
+
- Keep docs and configuration aligned with code changes.
|
|
82
|
+
|
|
83
|
+
Definition of done:
|
|
84
|
+
|
|
85
|
+
1. Requested change is implemented.
|
|
86
|
+
2. Relevant tests/lint/build checks pass locally.
|
|
87
|
+
3. Updated docs/config cover new behavior.
|
|
88
|
+
4. PR summary includes risks and rollback notes.
|
|
89
|
+
|
|
90
|
+
## 3. Repository Knowledge
|
|
91
|
+
|
|
92
|
+
### Tech Stack
|
|
93
|
+
|
|
94
|
+
| Area | Tooling | Version |
|
|
95
|
+
| ---------------- | ----------------------------------------- | ------------------------------ |
|
|
96
|
+
| Language runtime | Node.js | `>=18` (`package.json` engines) |
|
|
97
|
+
| Language | JavaScript with one TypeScript source file | `src/request/utils.ts` |
|
|
98
|
+
| Build tool | `@webex/legacy-tools` (`webex-legacy-tools build`) | workspace |
|
|
99
|
+
| Test framework | Jest (unit), Mocha (integration), Karma (browser) | `jest.config.js`, `package.json` |
|
|
100
|
+
| Lint/format | ESLint via `@webex/eslint-config-legacy`; Prettier | `^8.24.0` / `^2.7.1` (`package.json`) |
|
|
101
|
+
|
|
102
|
+
### Project Map
|
|
103
|
+
|
|
104
|
+
- `src/index.js`: package entry point; builds the curried `request`/`defaults` clients and re-exports the public surface.
|
|
105
|
+
- `src/request/`: the request pipeline and its two platform transports. Has its own specification.
|
|
106
|
+
- `src/interceptors/http-status.js`: turns 4xx/5xx responses into rejected typed errors.
|
|
107
|
+
- `src/lib/interceptor.js`: the `Interceptor` base class downstream plugins subclass.
|
|
108
|
+
- `src/lib/detect.js`: buffer/blob MIME detection used for request and response bodies.
|
|
109
|
+
- `src/lib/xhr.js`: vendored fork of `naugtur/xhr`, used only by the browser transport.
|
|
110
|
+
- `src/http-error.js`, `src/http-error-subtypes.js`: the `HttpError` base and its status-code subtype tree.
|
|
111
|
+
- `src/progress-event.js`: the `ProgressEvent` payload emitted for upload/download progress.
|
|
112
|
+
- `test/unit/`: Jest unit tests.
|
|
113
|
+
- `test/integration/`: Mocha integration tests that need a local fixture server and provisioned test users.
|
|
114
|
+
|
|
115
|
+
### Critical Constraints
|
|
116
|
+
|
|
117
|
+
- **Node and browser transports must stay behaviorally aligned.** `package.json` swaps
|
|
118
|
+
`src/request/request.js` for `src/request/request.shim.js` in browser builds. A change to one
|
|
119
|
+
transport that is not mirrored in the other silently diverges by platform.
|
|
120
|
+
- **`src/lib/xhr.js` is a vendored fork and is deliberately held close to upstream.** Its own header
|
|
121
|
+
says so. Keep diffs minimal and do not reformat it; its `eslint-disable` is intentional.
|
|
122
|
+
- **Error subtype identity is a published contract.** Consumers branch on classes such as
|
|
123
|
+
`NotFound` and `TooManyRequests` from `src/http-error-subtypes.js`. Renaming, removing, or
|
|
124
|
+
reparenting a subtype is a breaking change.
|
|
125
|
+
- **A network failure resolves as a response with `statusCode: 0`; it does not reject.** Both
|
|
126
|
+
transports do this so the interceptor chain can map it to `NetworkOrCORSError` uniformly.
|
|
127
|
+
- **`HttpStatusInterceptor` deliberately lets two 404 bodies through as successes** — the Locus and
|
|
128
|
+
App API redirect codes in `src/interceptors/http-status.js`. Do not "fix" these into rejections.
|
|
129
|
+
|
|
130
|
+
## 4. Testing Workflow
|
|
131
|
+
|
|
132
|
+
Run checks in this order:
|
|
133
|
+
|
|
134
|
+
1. `yarn workspace @webex/http-core test:unit`
|
|
135
|
+
2. `yarn workspace @webex/http-core test:style`
|
|
136
|
+
3. `yarn workspace @webex/http-core test:integration` (requires a local fixture server and provisioned test users)
|
|
137
|
+
|
|
138
|
+
Testing rules:
|
|
139
|
+
|
|
140
|
+
- Add or update tests for every behavior change.
|
|
141
|
+
- Cover failure paths and edge cases, not only happy paths.
|
|
142
|
+
- Do not remove tests to make CI pass.
|
|
143
|
+
- Mirror a transport change in both Node and browser tests where the behavior is shared.
|
|
144
|
+
|
|
145
|
+
This package defines no coverage threshold; the repository owner confirmed there is no coverage gate
|
|
146
|
+
for it. Do not infer one from a platform or CI default.
|
|
147
|
+
|
|
148
|
+
## 5. Code Style and Patterns
|
|
149
|
+
|
|
150
|
+
Coding expectations:
|
|
151
|
+
|
|
152
|
+
- Follow repository style rules and static analysis output.
|
|
153
|
+
- Prefer small, composable functions over large procedural blocks.
|
|
154
|
+
- Make error handling explicit at system boundaries.
|
|
155
|
+
- Keep public interfaces stable unless a breaking change is requested.
|
|
156
|
+
- Before adding a literal path, filename, command, workflow identifier, status,
|
|
157
|
+
or other policy value, search the repository for exact and semantically
|
|
158
|
+
equivalent uses. When repeated production values represent one shared
|
|
159
|
+
contract, move them to the narrowest owning shared module or catalog as one
|
|
160
|
+
canonical named constant, enum, or type and update consumers. Keep incidental
|
|
161
|
+
similarities, one-off implementation details, and independent test fixtures
|
|
162
|
+
local.
|
|
163
|
+
- Do not import a default, named, object, or namespace binding and immediately
|
|
164
|
+
re-export it. Consumers should import from the owning module; package barrels
|
|
165
|
+
should use direct named re-exports.
|
|
166
|
+
- Do not write inline runtime `typeof` checks outside descriptively named guard
|
|
167
|
+
implementations. Import and reuse the owning guard instead; TypeScript
|
|
168
|
+
type-position `typeof` queries remain allowed.
|
|
169
|
+
|
|
170
|
+
Pattern example:
|
|
171
|
+
|
|
172
|
+
```text
|
|
173
|
+
Preferred:
|
|
174
|
+
- Validate external input close to the boundary.
|
|
175
|
+
- Return typed/structured results.
|
|
176
|
+
- Include actionable error messages.
|
|
177
|
+
|
|
178
|
+
Avoid:
|
|
179
|
+
- Passing unvalidated payloads deep into the system.
|
|
180
|
+
- Swallowing exceptions or returning ambiguous null values.
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## 6. Git Workflow
|
|
184
|
+
|
|
185
|
+
- Branch naming: `[feature|fix|chore]/[short-description]`
|
|
186
|
+
- Commit format: conventional commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`)
|
|
187
|
+
- Keep commits focused and reversible.
|
|
188
|
+
- Rebase on the target branch before opening PR.
|
|
189
|
+
|
|
190
|
+
PR checklist:
|
|
191
|
+
|
|
192
|
+
- What changed and why.
|
|
193
|
+
- Tests run and results.
|
|
194
|
+
- Risk/impact areas.
|
|
195
|
+
- Rollback approach.
|
|
196
|
+
|
|
197
|
+
## 7. Boundaries and Escalation
|
|
198
|
+
|
|
199
|
+
### Always
|
|
200
|
+
|
|
201
|
+
- Prefer existing patterns over introducing new architecture.
|
|
202
|
+
- Keep changes minimal for the requested scope.
|
|
203
|
+
- Call out assumptions and unknowns explicitly.
|
|
204
|
+
|
|
205
|
+
### Ask First
|
|
206
|
+
|
|
207
|
+
- Adding new dependencies or external services.
|
|
208
|
+
- Large refactors or schema migrations.
|
|
209
|
+
- Security-sensitive changes (auth, encryption, secrets handling) — this package builds
|
|
210
|
+
`Authorization` headers and controls cookie credentials.
|
|
211
|
+
- Any destructive data or infrastructure operation.
|
|
212
|
+
- Changing an `HttpError` subtype name or its position in the subtype tree.
|
|
213
|
+
|
|
214
|
+
### Never
|
|
215
|
+
|
|
216
|
+
- Commit secrets, keys, or credentials.
|
|
217
|
+
- Bypass required checks by disabling tests or linters.
|
|
218
|
+
- Rewrite history on shared branches.
|
|
219
|
+
- Change unrelated files "while here" without clear need.
|