@techspokes/typescript-wsdl-client 0.27.0 → 0.29.0
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/README.md +4 -4
- package/dist/app/generateApp.js +2 -2
- package/dist/gateway/generators.d.ts +3 -2
- package/dist/gateway/generators.d.ts.map +1 -1
- package/dist/gateway/generators.js +51 -9
- package/dist/openapi/generateOpenAPI.d.ts.map +1 -1
- package/dist/openapi/generateOpenAPI.js +4 -1
- package/dist/runtime/jsonArray.d.ts +24 -0
- package/dist/runtime/jsonArray.d.ts.map +1 -0
- package/dist/runtime/jsonArray.js +52 -0
- package/dist/test/generators.d.ts.map +1 -1
- package/dist/test/generators.js +25 -3
- package/docs/README.md +2 -2
- package/docs/api-reference.md +3 -1
- package/docs/architecture.md +1 -1
- package/docs/cli-reference.md +1 -1
- package/docs/concepts.md +2 -2
- package/docs/configuration.md +1 -0
- package/docs/decisions/002-streamable-responses.md +32 -10
- package/docs/gateway-guide.md +5 -10
- package/docs/generated-code.md +1 -1
- package/docs/migration-playbook.md +1 -1
- package/docs/migration.md +1 -1
- package/docs/output-anatomy.md +26 -4
- package/docs/production.md +2 -2
- package/docs/releases/v0.28.0.md +32 -0
- package/docs/releases/v0.29.0.md +32 -0
- package/docs/roadmap/README.md +31 -18
- package/docs/roadmap/v1.0-capability-conformance-framework.md +219 -0
- package/docs/roadmap/v1.0-contract-audit.md +14 -13
- package/docs/roadmap/v1.0-json-array-streaming.md +21 -19
- package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +15 -13
- package/docs/roadmap/v1.0-release-candidate-gates.md +2 -0
- package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +15 -13
- package/docs/start-here.md +4 -2
- package/docs/supported-patterns.md +1 -1
- package/docs/testing.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/package.json +5 -5
- package/src/runtime/jsonArray.ts +55 -0
package/docs/output-anatomy.md
CHANGED
|
@@ -75,7 +75,7 @@ CLI OpenAPI generation always validates the generated spec using `@apidevtools/s
|
|
|
75
75
|
|
|
76
76
|
### Stream Schema Extension
|
|
77
77
|
|
|
78
|
-
Stream operations do not use the standard success envelope for `200` responses.
|
|
78
|
+
Stream operations do not use the standard success envelope for `200` responses. NDJSON streams declare the configured stream media type (default `application/x-ndjson`) with `schema: { "type": "string" }` and an `x-wsdl-tsc-stream` extension that carries the record schema reference:
|
|
79
79
|
|
|
80
80
|
```json
|
|
81
81
|
{
|
|
@@ -94,7 +94,29 @@ Stream operations do not use the standard success envelope for `200` responses.
|
|
|
94
94
|
}
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
JSON array streams default to `application/json` and declare the record schema as the array item schema while keeping the same extension:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"200": {
|
|
102
|
+
"description": "Successful streamed SOAP operation response",
|
|
103
|
+
"content": {
|
|
104
|
+
"application/json": {
|
|
105
|
+
"schema": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": { "$ref": "#/components/schemas/UnitDescriptiveContentType" }
|
|
108
|
+
},
|
|
109
|
+
"x-wsdl-tsc-stream": {
|
|
110
|
+
"format": "json-array",
|
|
111
|
+
"itemSchema": { "$ref": "#/components/schemas/UnitDescriptiveContentType" }
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
OpenAPI 3.1 cannot fully describe an NDJSON sequence as a standard JSON Schema document, so the extension makes the item schema explicit for generated gateways, documentation tools, and future SDK generators. JSON array streams use a normal array schema and keep the extension for downstream tooling. Error responses (400, 502, and the rest) still use the normal envelope.
|
|
98
120
|
|
|
99
121
|
## Gateway Output
|
|
100
122
|
|
|
@@ -117,11 +139,11 @@ Each route file in `routes/` follows the same pattern: validate the JSON request
|
|
|
117
139
|
|
|
118
140
|
### Stream Routes
|
|
119
141
|
|
|
120
|
-
Stream-configured operations generate a different route shape. The Fastify response serialization schema is omitted because
|
|
142
|
+
Stream-configured operations generate a different route shape. The Fastify response serialization schema is omitted because the handler sends a `Readable` directly. NDJSON handlers set `reply.type("application/x-ndjson")` and return `reply.send(toNdjson(result.records))`; JSON array handlers set `reply.type("application/json")` and return `reply.send(toJsonArray(result.records))`. `runtime.ts` gains `toNdjson<T>(records: AsyncIterable<T>): Readable` and `toJsonArray<T>(records: AsyncIterable<T>): Readable` helpers. See the [Gateway Guide](gateway-guide.md#streaming-handlers) for the full handler example and terminal-error policy.
|
|
121
143
|
|
|
122
144
|
### Generated Test Surface
|
|
123
145
|
|
|
124
|
-
When `--test-dir` is combined with `--stream-config`, the generated happy-path tests for stream operations assert on the
|
|
146
|
+
When `--test-dir` is combined with `--stream-config`, the generated happy-path tests for stream operations assert on the configured content type. NDJSON tests parse each line as a separate JSON record, and JSON array tests parse the response body once as an array. Mock clients use async-generator overrides that yield records to drive those tests; see the [Testing Guide](testing.md) for the pattern.
|
|
125
147
|
|
|
126
148
|
### Plugin registration
|
|
127
149
|
|
package/docs/production.md
CHANGED
|
@@ -83,7 +83,7 @@ Log the time to first record, not just the time to response completion. First-re
|
|
|
83
83
|
|
|
84
84
|
### Terminal-Error Policy
|
|
85
85
|
|
|
86
|
-
Errors raised before the first record use the normal gateway error envelope
|
|
86
|
+
Errors raised before the first record use the normal gateway error envelope because the JSON array helper prefetches the first record before emitting `[`. Errors raised mid-stream truncate the response. NDJSON consumers detect this as an incomplete HTTP response, and JSON array consumers must treat an incomplete or invalid JSON document as a failed stream. Document this behavior for downstream API consumers so they distinguish truncation from a legitimate empty stream.
|
|
87
87
|
|
|
88
88
|
## Known Limitations
|
|
89
89
|
|
|
@@ -105,7 +105,7 @@ Single-child sequences with maxOccurs>1 become array schemas. Sequences with mul
|
|
|
105
105
|
|
|
106
106
|
### Stream Format Coverage
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
`ndjson` is the default stream format. `json-array` is supported for operations that need a single JSON document response; it streams records incrementally as a JSON array and does not buffer the full SOAP response.
|
|
109
109
|
|
|
110
110
|
### Stream Transport Bypasses node-soap
|
|
111
111
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# TypeScript WSDL Client v0.28.0
|
|
2
|
+
|
|
3
|
+
## JSON Array Streaming
|
|
4
|
+
|
|
5
|
+
This release implements `format: "json-array"` for operations opted into streaming with `--stream-config`.
|
|
6
|
+
|
|
7
|
+
## What This Improves
|
|
8
|
+
|
|
9
|
+
Teams can now serve large SOAP response records as one streamed `application/json` array without buffering the full upstream response. NDJSON remains the default stream format, and JSON array operations keep the same generated client return shape: `StreamOperationResponse<RecordType>` with `records: AsyncIterable<RecordType>`.
|
|
10
|
+
|
|
11
|
+
## Highlights
|
|
12
|
+
|
|
13
|
+
- Adds `toJsonArray()` runtime streaming alongside the existing NDJSON helper.
|
|
14
|
+
- Emits OpenAPI `application/json` array schemas for JSON array stream operations.
|
|
15
|
+
- Generates Fastify routes that call `toJsonArray(result.records)` for `format: "json-array"`.
|
|
16
|
+
- Generates route tests that parse JSON array stream responses as one array document.
|
|
17
|
+
- Documents the terminal-error behavior for JSON array streams.
|
|
18
|
+
|
|
19
|
+
## Upgrade Notes
|
|
20
|
+
|
|
21
|
+
No special upgrade steps. Existing stream operations keep `ndjson` unless the stream config opts an operation into `format: "json-array"`.
|
|
22
|
+
|
|
23
|
+
## Validation
|
|
24
|
+
|
|
25
|
+
- CI passed.
|
|
26
|
+
- NPM package contents were validated.
|
|
27
|
+
- Documentation links and TypeScript fenced snippets were validated.
|
|
28
|
+
- Agent skill artifact was validated and packaged.
|
|
29
|
+
|
|
30
|
+
## Notes
|
|
31
|
+
|
|
32
|
+
Release tag: `v0.28.0`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# TypeScript WSDL Client v0.29.0
|
|
2
|
+
|
|
3
|
+
## Dependency And Roadmap Maintenance
|
|
4
|
+
|
|
5
|
+
This release brings the project dependency floor and generated app scaffold pins up to date after Dependabot and security review updates. It also carries forward the latest 1.0 readiness documentation so maintainers and adopters can track the remaining capability conformance work.
|
|
6
|
+
|
|
7
|
+
## What This Improves
|
|
8
|
+
|
|
9
|
+
Developers get current dependency minimums in both the published package and newly scaffolded Fastify gateway apps. The refreshed lockfile includes transitive security maintenance for build and request-related packages, while the roadmap documentation now reflects the JSON array streaming release and the 1.0 conformance planning model.
|
|
10
|
+
|
|
11
|
+
## Highlights
|
|
12
|
+
|
|
13
|
+
- Updates root dependency minimums for `fast-xml-parser`, `fastify-plugin`, `@types/node`, and `vitest`.
|
|
14
|
+
- Refreshes lockfile security updates for `esbuild`, `form-data`, and `hasown`.
|
|
15
|
+
- Updates generated app scaffold pins for `fastify-plugin` and `@types/node`.
|
|
16
|
+
- Refreshes 1.0 roadmap documentation after the JSON array streaming release.
|
|
17
|
+
- Adds the 1.0 capability conformance framework documentation.
|
|
18
|
+
|
|
19
|
+
## Upgrade Notes
|
|
20
|
+
|
|
21
|
+
No special upgrade steps. Regenerate generated Fastify app scaffolds when you want new app projects to start with the updated dependency pins.
|
|
22
|
+
|
|
23
|
+
## Validation
|
|
24
|
+
|
|
25
|
+
- CI passed.
|
|
26
|
+
- NPM package contents were validated.
|
|
27
|
+
- Documentation links and TypeScript fenced snippets were validated.
|
|
28
|
+
- Agent skill artifact was validated and packaged.
|
|
29
|
+
|
|
30
|
+
## Notes
|
|
31
|
+
|
|
32
|
+
Release tag: `v0.29.0`.
|
package/docs/roadmap/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Version 1.0 Roadmap Plan
|
|
2
2
|
|
|
3
|
-
Detailed plan for moving `@techspokes/typescript-wsdl-client` from `0.
|
|
3
|
+
Detailed plan for moving `@techspokes/typescript-wsdl-client` from the released `0.28.x` line to a stable `1.0.0` release.
|
|
4
4
|
|
|
5
5
|
See the root [README.md](../../README.md) for project overview and the root [ROADMAP.md](../../ROADMAP.md) for the public roadmap summary.
|
|
6
6
|
|
|
@@ -8,28 +8,29 @@ See the root [README.md](../../README.md) for project overview and the root [ROA
|
|
|
8
8
|
|
|
9
9
|
This plan turns the 1.0 roadmap into implementation slices that can be picked up independently. Each slice has its own plan document with scope, testing strategy, acceptance gates, and release implications.
|
|
10
10
|
|
|
11
|
-
The plan is optimized for preserving quality.
|
|
11
|
+
The plan is optimized for preserving quality. The contract and compatibility baselines now exist, choice union mode is shipped, and JSON array streaming is shipped. The remaining readiness work is WSDL coverage evidence and the final release candidate gate pass.
|
|
12
12
|
|
|
13
13
|
## Route Summary
|
|
14
14
|
|
|
15
|
-
| Slice
|
|
16
|
-
|
|
17
|
-
| Contract audit
|
|
18
|
-
| OpenAPI compatibility | [OpenAPI Fastify Compatibility](v1.0-openapi-fastify-compatibility.md) | Schema strategy is proven
|
|
19
|
-
| Choice union mode
|
|
20
|
-
| JSON array streaming
|
|
21
|
-
|
|
|
22
|
-
|
|
|
15
|
+
| Slice | Document | Status | Outcome |
|
|
16
|
+
|-----------------------|------------------------------------------------------------------------------|-------------------|---------------------------------|
|
|
17
|
+
| Contract audit | [Contract Audit](v1.0-contract-audit.md) | baseline complete | Public surfaces match behavior |
|
|
18
|
+
| OpenAPI compatibility | [OpenAPI Fastify Compatibility](v1.0-openapi-fastify-compatibility.md) | baseline complete | Schema strategy is proven |
|
|
19
|
+
| Choice union mode | [Choice Union Mode](v1.0-choice-union-mode.md) | complete | Implemented in `0.26.0` |
|
|
20
|
+
| JSON array streaming | [JSON Array Streaming](v1.0-json-array-streaming.md) | complete | Implemented in `0.28.0` |
|
|
21
|
+
| Conformance framework | [Capability Conformance Framework](v1.0-capability-conformance-framework.md) | planned | Pipeline claims are test-backed |
|
|
22
|
+
| WSDL coverage matrix | [WSDL Coverage Matrix](v1.0-wsdl-coverage-matrix.md) | remaining | Feature support is test-backed |
|
|
23
|
+
| Release candidate | [Release Candidate Gates](v1.0-release-candidate-gates.md) | remaining | 1.0 release is repeatable |
|
|
23
24
|
|
|
24
25
|
## Execution Order
|
|
25
26
|
|
|
26
27
|
### Slice 1: Contract Audit
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
The baseline contract audit is complete. Keep it active as release hygiene so CLI docs, API docs, configuration docs, examples, roadmap statements, and generated behavior stay aligned.
|
|
29
30
|
|
|
30
31
|
### Slice 2: OpenAPI Fastify Compatibility
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
Compatibility research is complete for choice union mode and JSON array streaming. Run the same local Fastify probes before any future schema output changes.
|
|
33
34
|
|
|
34
35
|
### Slice 3: Choice Union Mode
|
|
35
36
|
|
|
@@ -37,16 +38,28 @@ Choice union mode is complete in `0.26.0`. The default `all-optional` mode remai
|
|
|
37
38
|
|
|
38
39
|
### Slice 4: JSON Array Streaming
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
JSON array streaming is complete in `0.28.0`. The default `ndjson` format remains unchanged, and `format: "json-array"` streams records incrementally without buffering the full SOAP response.
|
|
41
42
|
|
|
42
|
-
### Slice 5:
|
|
43
|
+
### Slice 5: Capability Conformance Framework
|
|
43
44
|
|
|
44
|
-
Build the
|
|
45
|
+
Build the conformance registry, fixture strategy, stage runners, and issue-triage model. This slice turns feature claims into testable pipeline-wide capability cases.
|
|
45
46
|
|
|
46
|
-
### Slice 6:
|
|
47
|
+
### Slice 6: WSDL Coverage Matrix
|
|
48
|
+
|
|
49
|
+
Build the automated WSDL feature matrix next. The matrix should drive the remaining WSDL support, diagnostic, and deferral decisions.
|
|
50
|
+
|
|
51
|
+
### Slice 7: Release Candidate Gates
|
|
47
52
|
|
|
48
53
|
Run the release candidate gates after feature work and documentation have converged. This slice validates docs, tests, generated examples, package contents, skill artifact, release notes, and provenance workflow readiness.
|
|
49
54
|
|
|
55
|
+
## Remaining Before 1.0
|
|
56
|
+
|
|
57
|
+
- Build the capability conformance registry and runner.
|
|
58
|
+
- Build and run the WSDL feature matrix as the first conformance domain.
|
|
59
|
+
- Turn unsupported or partial matrix rows into diagnostics, documentation, or scoped fixes.
|
|
60
|
+
- Confirm `docs/supported-patterns.md` matches the matrix.
|
|
61
|
+
- Run the release-candidate gates.
|
|
62
|
+
|
|
50
63
|
## Quality Principles
|
|
51
64
|
|
|
52
65
|
- Keep default generated output stable unless a slice explicitly changes it.
|
|
@@ -72,8 +85,8 @@ Run the release candidate gates after feature work and documentation have conver
|
|
|
72
85
|
|
|
73
86
|
### Coverage Gate
|
|
74
87
|
|
|
75
|
-
- A
|
|
76
|
-
- Each matrix entry has a fixture and
|
|
88
|
+
- A capability conformance matrix runs under test automation.
|
|
89
|
+
- Each matrix entry has a fixture, status, and stage expectations.
|
|
77
90
|
- Unsupported features fail loudly or are documented as deliberately unsupported.
|
|
78
91
|
|
|
79
92
|
### Release Gate
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Version 1.0 Capability Conformance Framework
|
|
2
|
+
|
|
3
|
+
Status: planned before `1.0.0`.
|
|
4
|
+
|
|
5
|
+
Plan for turning SOAP, WSDL, OpenAPI, gateway, app, generated-test, and documentation support claims into fixture-backed conformance evidence.
|
|
6
|
+
|
|
7
|
+
See the root [README.md](../../README.md) for project overview and [Version 1.0 Roadmap Plan](README.md) for the complete 1.0 route.
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
The project should have an internal conformance framework that proves what each important SOAP and WSDL capability does across the full generation pipeline. A capability claim is not complete until the relevant compile, client, OpenAPI, gateway, app, generated-test, runtime, and documentation surfaces either pass or fail with an explicit diagnostic.
|
|
12
|
+
|
|
13
|
+
The framework should also give maintainers a repeatable issue triage path. When a user reports that a WSDL pattern does not work, maintainers should be able to reduce the report to a fixture, add a matrix row, run the conformance suite, and state exactly which stage supports, rejects, or partially supports that pattern.
|
|
14
|
+
|
|
15
|
+
## Values To Preserve
|
|
16
|
+
|
|
17
|
+
- Preserve deterministic generated output.
|
|
18
|
+
- Preserve strict TypeScript and NodeNext behavior.
|
|
19
|
+
- Preserve the current smoke fixture as the canonical happy path.
|
|
20
|
+
- Prefer small minimized fixtures over large real-world WSDL files.
|
|
21
|
+
- Prefer diagnostics and documented deferrals over silent miscompilation.
|
|
22
|
+
- Keep generated gateway behavior proven through Fastify, not only snapshots.
|
|
23
|
+
- Keep OpenAPI behavior proven through schema assertions and validation.
|
|
24
|
+
- Keep docs aligned with machine-readable capability IDs.
|
|
25
|
+
- Avoid new dependencies unless the existing toolchain cannot provide the evidence.
|
|
26
|
+
- Keep public CLI changes separate from internal conformance infrastructure.
|
|
27
|
+
|
|
28
|
+
## Capability Model
|
|
29
|
+
|
|
30
|
+
A capability is a named repository behavior that can be detected, documented, and tested. Examples include `xs:choice` union mode, JSON array streaming, external `PolicyReference`, abstract complex types, substitution groups, multi-binding WSDLs, and MTOM/XOP attachments.
|
|
31
|
+
|
|
32
|
+
Each capability should have a stable ID, a status, one or more fixtures, and per-stage expectations. The status describes the product contract. The stage expectations describe how the repository proves the contract.
|
|
33
|
+
|
|
34
|
+
## Capability Statuses
|
|
35
|
+
|
|
36
|
+
- `supported`: the capability works through every relevant stage.
|
|
37
|
+
- `partial`: the capability has deliberate limits that docs must describe.
|
|
38
|
+
- `diagnostic`: the capability is rejected or warned about clearly.
|
|
39
|
+
- `unsupported`: the capability is intentionally out of scope.
|
|
40
|
+
- `research`: the capability needs fixture evidence before a final status.
|
|
41
|
+
|
|
42
|
+
## Stage Expectations
|
|
43
|
+
|
|
44
|
+
Each matrix row should declare only the stages that apply to that capability. A diagnostic row might stop at compile. A supported gateway feature should prove compile, client, OpenAPI, gateway, and runtime behavior.
|
|
45
|
+
|
|
46
|
+
### Compile Stage
|
|
47
|
+
|
|
48
|
+
The compile stage proves WSDL loading, schema compilation, catalog shape, and diagnostics. Assertions should prefer catalog metadata and structured errors over brittle full generated-file comparisons.
|
|
49
|
+
|
|
50
|
+
### Client Stage
|
|
51
|
+
|
|
52
|
+
The client stage proves generated `types.ts`, `operations.ts`, `client.ts`, and helpers type-check under the repository TypeScript settings. Capability-specific assertions should inspect generated types only where the type shape is part of the public contract.
|
|
53
|
+
|
|
54
|
+
### OpenAPI Stage
|
|
55
|
+
|
|
56
|
+
The OpenAPI stage proves the generated spec validates and uses the expected schema strategy. Assertions should cover schema shape, media types, operation metadata, extensions such as `x-wsdl-tsc-stream`, and security output where relevant.
|
|
57
|
+
|
|
58
|
+
### Gateway Generation Stage
|
|
59
|
+
|
|
60
|
+
The gateway generation stage proves route, schema, runtime, plugin, and type-check fixture output can be generated from the OpenAPI result. Assertions should cover route registration shape and generated helper selection when those are part of the capability contract.
|
|
61
|
+
|
|
62
|
+
### Gateway Runtime Stage
|
|
63
|
+
|
|
64
|
+
The gateway runtime stage proves generated Fastify routes with a mock operations client behave correctly under `fastify.inject`. Assertions should cover valid requests, invalid requests, response envelopes, response content types, stream formats, and terminal-error behavior where relevant.
|
|
65
|
+
|
|
66
|
+
### App Stage
|
|
67
|
+
|
|
68
|
+
The app stage proves the standalone app scaffold can consume the generated gateway when the capability affects app wiring, package dependencies, environment variables, or gateway plugin registration. Most rows can skip this stage unless the capability changes app behavior.
|
|
69
|
+
|
|
70
|
+
### Generated Test Stage
|
|
71
|
+
|
|
72
|
+
The generated test stage proves `--test-dir` emits tests that compile and pass for supported capabilities. It should also prove generated tests include capability-specific invalid cases when request validation is part of the contract.
|
|
73
|
+
|
|
74
|
+
### Documentation Stage
|
|
75
|
+
|
|
76
|
+
The documentation stage proves `docs/supported-patterns.md` agrees with the capability registry. It should prevent docs from claiming support, partial support, or non-support without a matching conformance row.
|
|
77
|
+
|
|
78
|
+
## Registry Shape
|
|
79
|
+
|
|
80
|
+
The first implementation should use a TypeScript manifest because tests can import it with full type safety. JSON can be added later if external tooling needs a stable data format.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
declare const capabilities: CapabilityCase[];
|
|
84
|
+
|
|
85
|
+
interface CapabilityCase {
|
|
86
|
+
id: string;
|
|
87
|
+
title: string;
|
|
88
|
+
status: "supported" | "partial" | "diagnostic" | "unsupported" | "research";
|
|
89
|
+
featureTags: string[];
|
|
90
|
+
fixture: string;
|
|
91
|
+
docsAnchor?: string;
|
|
92
|
+
stages: CapabilityStages;
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Stage payloads should stay small and explicit. Avoid a generic assertion language in the first version; use typed expectation objects and small runner helpers instead.
|
|
97
|
+
|
|
98
|
+
## Fixture Strategy
|
|
99
|
+
|
|
100
|
+
Fixtures should live under a dedicated conformance fixture directory, separate from the weather smoke fixture. Each fixture should be minimal, synthetic, deterministic, and focused on one capability unless the purpose is to prove a composition case.
|
|
101
|
+
|
|
102
|
+
Reported user WSDLs should not be committed wholesale by default. Maintainers should reduce them to the smallest reproducible fixture and remove private endpoints, credentials, business names, and proprietary type names.
|
|
103
|
+
|
|
104
|
+
## Fastify Gateway Testing Pattern
|
|
105
|
+
|
|
106
|
+
Gateway conformance rows should generate the gateway into a temporary directory, import the generated plugin, provide a mock operations client, and call routes with `fastify.inject`. This proves the generated gateway works as a Fastify integration, not just as emitted text.
|
|
107
|
+
|
|
108
|
+
Supported request-validation capabilities should include at least one accepted request and one rejected request when the schema can represent invalid input. Response capabilities should assert envelope shape, status code, content type, and serialized payload.
|
|
109
|
+
|
|
110
|
+
Streaming capabilities should assert the configured content type, NDJSON or JSON array parsing behavior, and terminal-error behavior. JSON array rows should keep the pre-first-record and post-first-byte error cases distinct.
|
|
111
|
+
|
|
112
|
+
## Issue Triage Workflow
|
|
113
|
+
|
|
114
|
+
When a user reports a WSDL incompatibility, maintainers should first run or approximate the future inspector output. The report should be classified by capability IDs before generator code changes are considered.
|
|
115
|
+
|
|
116
|
+
The triage flow should be:
|
|
117
|
+
|
|
118
|
+
1. Reduce the reported WSDL to a minimal fixture.
|
|
119
|
+
2. Add or update a capability row.
|
|
120
|
+
3. Mark the row as `research`, `diagnostic`, `partial`, or `supported`.
|
|
121
|
+
4. Run the relevant conformance stages.
|
|
122
|
+
5. Decide whether to implement support, add diagnostics, or document a deferral.
|
|
123
|
+
6. Link the issue to the capability ID in the changelog or release notes when behavior changes.
|
|
124
|
+
|
|
125
|
+
## WSDL Inspector Direction
|
|
126
|
+
|
|
127
|
+
The WSDL inspector should be built after the first conformance registry exists. It should reuse the same capability IDs and statuses rather than maintaining a separate feature list.
|
|
128
|
+
|
|
129
|
+
The inspector should analyze a WSDL and report detected patterns, support status, known limitations, and suggested workarounds. It should have a JSON output for CI and issue templates, and a Markdown or text output for humans.
|
|
130
|
+
|
|
131
|
+
The inspector should not be treated as proof that generation will succeed. It is an orientation and triage tool. The conformance runner remains the proof mechanism.
|
|
132
|
+
|
|
133
|
+
## Inspector Research Questions
|
|
134
|
+
|
|
135
|
+
- Which feature signals are visible in the raw WSDL and XSD AST before compilation?
|
|
136
|
+
- Which feature signals require the compiled catalog?
|
|
137
|
+
- Which current limitations silently compile and need diagnostics first?
|
|
138
|
+
- Which recommendations can be stable enough for user-facing output?
|
|
139
|
+
- Which output shape should be public if the inspector becomes a CLI command?
|
|
140
|
+
|
|
141
|
+
## Phase 1: Registry And Compile Matrix
|
|
142
|
+
|
|
143
|
+
Create the capability registry, fixture directory, and a Vitest runner for compile-stage expectations. Include the existing roadmap priority rows and keep unsupported rows diagnostic or research-only until behavior is proven.
|
|
144
|
+
|
|
145
|
+
Acceptance criteria:
|
|
146
|
+
|
|
147
|
+
- The registry includes every priority row from the WSDL coverage slice.
|
|
148
|
+
- Each row has a stable ID, status, fixture, and compile expectation.
|
|
149
|
+
- `docs/supported-patterns.md` has matching capability IDs or anchors.
|
|
150
|
+
- The runner works without network access.
|
|
151
|
+
|
|
152
|
+
## Phase 2: Client And OpenAPI Evidence
|
|
153
|
+
|
|
154
|
+
Extend supported rows to generate clients and OpenAPI specs. Add type-check verification for generated clients and schema assertions for OpenAPI output.
|
|
155
|
+
|
|
156
|
+
Acceptance criteria:
|
|
157
|
+
|
|
158
|
+
- Supported rows type-check generated client output.
|
|
159
|
+
- OpenAPI specs validate for supported rows.
|
|
160
|
+
- Capability-specific schema strategies are asserted where they matter.
|
|
161
|
+
- Diagnostic rows stop before downstream stages.
|
|
162
|
+
|
|
163
|
+
## Phase 3: Gateway Runtime Evidence
|
|
164
|
+
|
|
165
|
+
Extend relevant rows to generate gateways and test Fastify runtime behavior through `fastify.inject`. Add mock operations clients and request/response fixtures as part of the registry.
|
|
166
|
+
|
|
167
|
+
Acceptance criteria:
|
|
168
|
+
|
|
169
|
+
- Supported gateway rows register generated plugins successfully.
|
|
170
|
+
- Valid request fixtures return expected envelopes or streams.
|
|
171
|
+
- Invalid request fixtures fail with expected status codes.
|
|
172
|
+
- Stream rows prove NDJSON and JSON array behavior separately.
|
|
173
|
+
|
|
174
|
+
## Phase 4: Generated Test And App Evidence
|
|
175
|
+
|
|
176
|
+
Extend relevant rows to generate `--test-dir` output and app scaffolds. Run generated tests only for rows where generated-test behavior is part of the capability contract.
|
|
177
|
+
|
|
178
|
+
Acceptance criteria:
|
|
179
|
+
|
|
180
|
+
- Generated tests pass for supported rows that request them.
|
|
181
|
+
- Generated validation tests include capability-specific invalid cases.
|
|
182
|
+
- App scaffolds type-check when the capability affects app wiring.
|
|
183
|
+
- Runtime dependency assumptions stay aligned with `package.json`.
|
|
184
|
+
|
|
185
|
+
## Phase 5: Documentation And Release Gates
|
|
186
|
+
|
|
187
|
+
Wire the conformance framework into docs validation, CI, or release preflight once runtime cost is acceptable. Keep a focused command for maintainers who want only conformance checks.
|
|
188
|
+
|
|
189
|
+
Acceptance criteria:
|
|
190
|
+
|
|
191
|
+
- `docs/supported-patterns.md` cannot drift from the registry.
|
|
192
|
+
- CI or release preflight runs the selected conformance subset.
|
|
193
|
+
- Full conformance can run locally before `1.0.0`.
|
|
194
|
+
- Release notes can cite capability IDs for behavior changes.
|
|
195
|
+
|
|
196
|
+
## Phase 6: WSDL Inspector
|
|
197
|
+
|
|
198
|
+
Build the inspector after the registry has enough stable coverage to be useful. Start with a programmatic API and internal CLI output before committing to public command semantics.
|
|
199
|
+
|
|
200
|
+
Acceptance criteria:
|
|
201
|
+
|
|
202
|
+
- The inspector maps detected WSDL patterns to capability IDs.
|
|
203
|
+
- JSON output is stable enough for issue templates.
|
|
204
|
+
- Human output includes status, limitation, and workaround text.
|
|
205
|
+
- Inspector findings link back to matrix evidence.
|
|
206
|
+
|
|
207
|
+
## Open Decisions
|
|
208
|
+
|
|
209
|
+
- Decide whether the first registry lives under `test/fixtures` or `test/conformance`.
|
|
210
|
+
- Decide whether conformance should be a normal `npm test` suite or a separate script at first.
|
|
211
|
+
- Decide how much generated output type-checking is acceptable in CI runtime.
|
|
212
|
+
- Decide which inspector output format becomes public before `1.0.0`.
|
|
213
|
+
- Decide whether docs should remain manually maintained or eventually generated from the registry.
|
|
214
|
+
|
|
215
|
+
## Release Implications
|
|
216
|
+
|
|
217
|
+
This framework is 1.0 readiness infrastructure. It can ship incrementally in `0.28.x` or later patch releases as tests, docs, and diagnostics improve.
|
|
218
|
+
|
|
219
|
+
Do not block the first conformance slice on the WSDL inspector. The registry and runner create the durable foundation; the inspector should reuse that foundation after it proves useful.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Version 1.0 Contract Audit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Status: baseline completed in `0.25.2`; ongoing as release hygiene.
|
|
4
|
+
|
|
5
|
+
Plan for keeping public flags, programmatic options, docs, generated behavior, and roadmap statements aligned through `1.0.0`.
|
|
4
6
|
|
|
5
7
|
See the root [README.md](../../README.md) for project overview and [Version 1.0 Roadmap Plan](README.md) for the complete 1.0 route.
|
|
6
8
|
|
|
@@ -8,39 +10,38 @@ See the root [README.md](../../README.md) for project overview and [Version 1.0
|
|
|
8
10
|
|
|
9
11
|
The contract audit makes every public promise explicit before 1.0. A public promise includes CLI flags, programmatic options, configuration files, generated file shapes, documentation examples, release workflow claims, and roadmap statements.
|
|
10
12
|
|
|
11
|
-
## Why This Slice
|
|
13
|
+
## Why This Slice Remains Active
|
|
12
14
|
|
|
13
|
-
This slice prevents later work from building on ambiguous behavior.
|
|
15
|
+
This slice prevents later work from building on ambiguous behavior. Choice union mode and JSON array streaming are shipped, so the audit now protects those contracts while WSDL coverage and release-candidate work proceed.
|
|
14
16
|
|
|
15
|
-
## Scope
|
|
17
|
+
## Ongoing Scope
|
|
16
18
|
|
|
17
19
|
- Audit CLI flags in `src/cli.ts` against `docs/cli-reference.md`.
|
|
18
20
|
- Audit programmatic options in exported types against `docs/api-reference.md`.
|
|
19
21
|
- Audit configuration file formats against `docs/configuration.md`.
|
|
20
22
|
- Audit generated output claims against snapshots and `examples/generated-output`.
|
|
21
23
|
- Refresh `ROADMAP.md` so shipped work is not listed as future work.
|
|
22
|
-
- Add
|
|
24
|
+
- Add focused tests for public behavior when the audit finds a real drift risk.
|
|
23
25
|
|
|
24
26
|
## Out Of Scope
|
|
25
27
|
|
|
26
|
-
- Do not implement choice union mode in this slice.
|
|
27
|
-
- Do not implement JSON array streaming in this slice.
|
|
28
28
|
- Do not expand WSDL feature support in this slice.
|
|
29
29
|
- Do not change default generated output unless a contract is already wrong.
|
|
30
|
+
- Do not treat release metadata gaps as feature support.
|
|
30
31
|
|
|
31
32
|
## Required Findings
|
|
32
33
|
|
|
33
34
|
### Choice Mode
|
|
34
35
|
|
|
35
|
-
`--client-choice-mode union`
|
|
36
|
+
`--client-choice-mode union` is implemented in `0.26.0`. Audit passes should keep CLI docs, API docs, generated-code docs, supported-pattern docs, tests, and examples aligned with the released opt-in behavior.
|
|
36
37
|
|
|
37
38
|
### JSON Array Streaming
|
|
38
39
|
|
|
39
|
-
`format: "json-array"`
|
|
40
|
+
`format: "json-array"` is implemented in `0.28.0`. The audit should keep every parser, client, OpenAPI, gateway, runtime, and docs surface aligned across both stream formats.
|
|
40
41
|
|
|
41
42
|
### Roadmap State
|
|
42
43
|
|
|
43
|
-
`ROADMAP.md` must reflect `0.
|
|
44
|
+
`ROADMAP.md` must reflect the released `0.28.x` line. Choice union mode and JSON array streaming must be treated as shipped work, while WSDL coverage and release-candidate gates remain the active 1.0 work.
|
|
44
45
|
|
|
45
46
|
### Release Metadata
|
|
46
47
|
|
|
@@ -58,15 +59,15 @@ Add or update focused tests that inspect CLI option availability and generated m
|
|
|
58
59
|
|
|
59
60
|
### Negative Tests
|
|
60
61
|
|
|
61
|
-
Add tests
|
|
62
|
+
Add negative tests only for newly identified contract gaps that a follow-up slice can consume. These tests should be skipped or marked as expected failures only if the repository already has an accepted pattern for that.
|
|
62
63
|
|
|
63
64
|
## Acceptance Criteria
|
|
64
65
|
|
|
65
|
-
- `ROADMAP.md` names `0.
|
|
66
|
+
- `ROADMAP.md` names released `0.28.x` work accurately.
|
|
66
67
|
- `docs/roadmap/README.md` links every 1.0 slice.
|
|
67
68
|
- CLI, API, and configuration docs agree on required 1.0 behavior.
|
|
68
69
|
- Known contract gaps are linked to implementation slices.
|
|
69
|
-
- `CHANGELOG.md` has one `docs(roadmap):` entry
|
|
70
|
+
- `CHANGELOG.md` has one `docs(roadmap):` entry when audit docs change.
|
|
70
71
|
- `npm run docs:validate` passes.
|
|
71
72
|
|
|
72
73
|
## Release Implications
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
# Version 1.0 JSON Array Streaming
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Status: implemented for `0.28.0`.
|
|
4
4
|
|
|
5
|
-
This
|
|
5
|
+
This document records the implementation slice for `format: "json-array"` streaming for SOAP operations that already use the stream configuration model.
|
|
6
6
|
|
|
7
7
|
See the root [README.md](../../README.md) for project overview and [Version 1.0 Roadmap Plan](README.md) for the complete 1.0 route.
|
|
8
8
|
|
|
9
9
|
## Goal
|
|
10
10
|
|
|
11
|
-
`format: "json-array"`
|
|
11
|
+
`0.28.0` completes `format: "json-array"` streaming as a valid JSON array without buffering the full SOAP response. The implementation is compatible with generated clients, OpenAPI output, Fastify routes, generated tests, and production docs.
|
|
12
12
|
|
|
13
13
|
## Design Direction
|
|
14
14
|
|
|
15
|
-
JSON array streaming
|
|
15
|
+
JSON array streaming writes an opening bracket with the first record, streams comma-separated JSON records, and writes a closing bracket after the async iterable completes. The implementation preserves backpressure by converting the async iterable into a Node `Readable` stream.
|
|
16
16
|
|
|
17
|
-
The key
|
|
17
|
+
The key researched constraint is error timing. The helper prefetches the first record before sending the first byte, so an upstream error before the first record still returns the normal error envelope. Once the JSON array response has started, a later error truncates the response and clients must treat the JSON parse failure as a failed stream.
|
|
18
18
|
|
|
19
|
-
## Scope
|
|
19
|
+
## Completed Scope
|
|
20
20
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
21
|
+
- Implemented a runtime helper for JSON array streaming.
|
|
22
|
+
- Preserved existing NDJSON behavior.
|
|
23
|
+
- Emitted JSON array route handlers when stream metadata says `format: "json-array"`.
|
|
24
|
+
- Emitted `application/json` OpenAPI content with an array item schema.
|
|
25
|
+
- Generated stream-aware mock clients and tests for JSON array operations.
|
|
26
|
+
- Documented terminal-error behavior for JSON array clients.
|
|
27
27
|
|
|
28
28
|
## Out Of Scope
|
|
29
29
|
|
|
@@ -31,29 +31,29 @@ The key research question is error timing. If the route can observe an upstream
|
|
|
31
31
|
- Do not change buffered SOAP operations.
|
|
32
32
|
- Do not make JSON array the default stream format.
|
|
33
33
|
|
|
34
|
-
## Research
|
|
34
|
+
## Research Findings
|
|
35
35
|
|
|
36
36
|
### First-Byte Timing
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Generated routes prefetch the first record before emitting the first JSON array byte. This preserves normal error envelopes for errors that happen before any record is available, with the tradeoff that response headers wait for the first upstream record.
|
|
39
39
|
|
|
40
40
|
### Empty Stream Handling
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
An empty stream returns `[]` with `application/json`. The helper emits a syntactically valid empty array without special route code.
|
|
43
43
|
|
|
44
44
|
### Backpressure Handling
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Tests confirm that the helper does not pull from the async iterable faster than the HTTP stream can write. The coverage mirrors the existing NDJSON backpressure tests.
|
|
47
47
|
|
|
48
48
|
### Terminal Error Handling
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
Fastify surfaces stream errors after the JSON array has begun as a destroyed or reset response under inject and as a truncated response to real clients. Production docs and troubleshooting docs describe this as a failed stream.
|
|
51
51
|
|
|
52
52
|
## Implementation Units
|
|
53
53
|
|
|
54
54
|
### Runtime Helper
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
Added `toJsonArray<T>(records: AsyncIterable<T>): Readable` beside `toNdjson`. The helper serializes records with `JSON.stringify`, inserts commas between records, and closes the array when iteration completes.
|
|
57
57
|
|
|
58
58
|
### Gateway Emitter
|
|
59
59
|
|
|
@@ -87,6 +87,8 @@ Test errors before the first emitted record separately from errors after at leas
|
|
|
87
87
|
|
|
88
88
|
## Acceptance Criteria
|
|
89
89
|
|
|
90
|
+
Satisfied by `0.28.0`:
|
|
91
|
+
|
|
90
92
|
- `format: "json-array"` generates working client, OpenAPI, gateway, and tests.
|
|
91
93
|
- JSON array output is parseable when the source completes normally.
|
|
92
94
|
- Output is streamed incrementally and does not buffer the full response.
|
|
@@ -96,4 +98,4 @@ Test errors before the first emitted record separately from errors after at leas
|
|
|
96
98
|
|
|
97
99
|
## Release Implications
|
|
98
100
|
|
|
99
|
-
This slice
|
|
101
|
+
This slice shipped as the `0.28.0` user-facing feature release. The release notes state that `json-array` can be selected per operation with `stream-config`, while NDJSON remains the default stream format.
|