@techspokes/typescript-wsdl-client 0.25.0 → 0.26.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.
Files changed (37) hide show
  1. package/README.md +3 -2
  2. package/dist/app/generateApp.js +1 -1
  3. package/dist/client/generateTypes.d.ts.map +1 -1
  4. package/dist/client/generateTypes.js +136 -65
  5. package/dist/compiler/schemaCompiler.d.ts +19 -0
  6. package/dist/compiler/schemaCompiler.d.ts.map +1 -1
  7. package/dist/compiler/schemaCompiler.js +152 -49
  8. package/dist/compiler/shapeResolver.js +15 -0
  9. package/dist/openapi/generateSchemas.d.ts.map +1 -1
  10. package/dist/openapi/generateSchemas.js +39 -3
  11. package/dist/test/generateTests.js +1 -1
  12. package/dist/test/generators.d.ts +2 -2
  13. package/dist/test/generators.d.ts.map +1 -1
  14. package/dist/test/generators.js +84 -3
  15. package/dist/test/mockData.d.ts +19 -0
  16. package/dist/test/mockData.d.ts.map +1 -1
  17. package/dist/test/mockData.js +9 -0
  18. package/docs/README.md +1 -0
  19. package/docs/api-reference.md +21 -0
  20. package/docs/cli-reference.md +37 -8
  21. package/docs/concepts.md +18 -4
  22. package/docs/generated-code.md +18 -0
  23. package/docs/migration-playbook.md +1 -1
  24. package/docs/migration.md +1 -1
  25. package/docs/output-anatomy.md +1 -1
  26. package/docs/production.md +3 -3
  27. package/docs/releases/v0.25.2.md +32 -0
  28. package/docs/releases/v0.26.0.md +32 -0
  29. package/docs/roadmap/README.md +89 -0
  30. package/docs/roadmap/v1.0-choice-union-mode.md +90 -0
  31. package/docs/roadmap/v1.0-contract-audit.md +74 -0
  32. package/docs/roadmap/v1.0-json-array-streaming.md +99 -0
  33. package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +97 -0
  34. package/docs/roadmap/v1.0-release-candidate-gates.md +77 -0
  35. package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +89 -0
  36. package/docs/supported-patterns.md +2 -1
  37. package/package.json +4 -4
@@ -0,0 +1,89 @@
1
+ # Version 1.0 Roadmap Plan
2
+
3
+ Detailed plan for moving `@techspokes/typescript-wsdl-client` from `0.26.x` to a stable `1.0.0` release.
4
+
5
+ See the root [README.md](../../README.md) for project overview and the root [ROADMAP.md](../../ROADMAP.md) for the public roadmap summary.
6
+
7
+ ## Purpose
8
+
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
+
11
+ The plan is optimized for preserving quality. Contract mismatches are resolved before new capability work, compatibility research constrains schema changes, and WSDL coverage work turns unsupported behavior into explicit diagnostics.
12
+
13
+ ## Route Summary
14
+
15
+ | Slice | Document | Outcome |
16
+ |-------|----------|---------|
17
+ | Contract audit | [Contract Audit](v1.0-contract-audit.md) | Public surfaces match behavior |
18
+ | OpenAPI compatibility | [OpenAPI Fastify Compatibility](v1.0-openapi-fastify-compatibility.md) | Schema strategy is proven |
19
+ | Choice union mode | [Choice Union Mode](v1.0-choice-union-mode.md) | Implemented in `0.26.0` |
20
+ | JSON array streaming | [JSON Array Streaming](v1.0-json-array-streaming.md) | `format: "json-array"` works |
21
+ | WSDL coverage matrix | [WSDL Coverage Matrix](v1.0-wsdl-coverage-matrix.md) | Feature support is test-backed |
22
+ | Release candidate | [Release Candidate Gates](v1.0-release-candidate-gates.md) | 1.0 release is repeatable |
23
+
24
+ ## Execution Order
25
+
26
+ ### Slice 1: Contract Audit
27
+
28
+ Start with contract audit because it defines the exact public promises that later slices must satisfy. This slice updates docs, identifies mismatched flags and options, and creates failing tests for the behavior that must become true.
29
+
30
+ ### Slice 2: OpenAPI Fastify Compatibility
31
+
32
+ Run compatibility research before changing union schemas or streaming JSON schemas. This keeps schema design constrained by Fastify validation, Fastify serialization, and generated gateway behavior.
33
+
34
+ ### Slice 3: Choice Union Mode
35
+
36
+ Choice union mode is complete in `0.26.0`. The default `all-optional` mode remains unchanged for backwards compatibility.
37
+
38
+ ### Slice 4: JSON Array Streaming
39
+
40
+ Implement streaming JSON array output after stream error behavior is researched. This is the next implementation slice after `0.26.0`, and the result must stream records incrementally without buffering the full SOAP response.
41
+
42
+ ### Slice 5: WSDL Coverage Matrix
43
+
44
+ Build the automated WSDL feature matrix once the two existing public contract gaps are handled. The matrix should then drive the remaining WSDL support and diagnostic decisions.
45
+
46
+ ### Slice 6: Release Candidate Gates
47
+
48
+ 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
+
50
+ ## Quality Principles
51
+
52
+ - Keep default generated output stable unless a slice explicitly changes it.
53
+ - Add failing tests before generator changes.
54
+ - Prefer fixture-driven WSDL behavior over ad hoc string assertions.
55
+ - Keep OpenAPI output compatible with generated Fastify gateways.
56
+ - Preserve deterministic output ordering in catalogs, generated TypeScript, schemas, and route files.
57
+ - Keep unsupported behavior explicit in diagnostics and documentation.
58
+
59
+ ## 1.0 Gates
60
+
61
+ ### Contract Gate
62
+
63
+ - `--client-choice-mode union` is implemented and documented in `0.26.0`.
64
+ - `format: "json-array"` is implemented and documented.
65
+ - CLI docs, API docs, configuration docs, and generated behavior agree.
66
+
67
+ ### Compatibility Gate
68
+
69
+ - Choice union schemas are validated against Fastify request handling.
70
+ - Gateway response schemas stay inside Fastify serialization limits.
71
+ - JSON array streams have documented terminal-error behavior.
72
+
73
+ ### Coverage Gate
74
+
75
+ - A WSDL feature matrix runs under test automation.
76
+ - Each matrix entry has a fixture and expected behavior.
77
+ - Unsupported features fail loudly or are documented as deliberately unsupported.
78
+
79
+ ### Release Gate
80
+
81
+ - `npm run docs:validate` passes.
82
+ - `npm test` passes.
83
+ - `npm run smoke:pipeline` passes.
84
+ - `npm run ci` passes.
85
+ - `npm run release:preflight -- v1.0.0` passes during release preparation.
86
+
87
+ ## Changelog Strategy
88
+
89
+ Each implementation slice should add one concise `CHANGELOG.md` entry under `## [Unreleased]`. Release-only changes move those entries into the release section during normal release preparation.
@@ -0,0 +1,90 @@
1
+ # Version 1.0 Choice Union Mode
2
+
3
+ Status: implemented for `0.26.0`.
4
+
5
+ This page records the completed `xs:choice` union support behind `--client-choice-mode union`.
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
+ `0.26.0` completes opt-in `--client-choice-mode union` for TypeScript, OpenAPI, generated gateway schemas, generated mocks, and generated test artifacts. The existing `all-optional` mode remains the default and keeps its current generated output unless a bug is explicitly fixed.
12
+
13
+ ## Completed Scope
14
+
15
+ - Preserved choice-group metadata during schema compilation.
16
+ - Emitted TypeScript union types for choice groups in union mode.
17
+ - Kept default all-optional TypeScript output stable.
18
+ - Emitted Fastify-compatible OpenAPI schemas that reflect choice exclusivity.
19
+ - Generated mock data that selects a valid choice branch.
20
+ - Generated gateway tests that reject invalid branch combinations.
21
+ - Generated gateway tests that reject missing required choice branches.
22
+ - Updated README, CLI reference, concepts, supported patterns, generated code docs, and production docs.
23
+
24
+ ## Out Of Scope
25
+
26
+ - Do not make union mode the default before 1.0.
27
+ - Do not change XML runtime mapping for non-choice elements.
28
+ - Do not solve abstract substitution groups in this slice unless required by choice fixtures.
29
+
30
+ ## Implementation Units
31
+
32
+ ### Catalog Metadata
33
+
34
+ The compiler preserves catalog metadata for choice groups with stable names, branch element names, branch type names, occurrence constraints, nillable flags, and source order. This lets downstream emitters render deterministic output in both `all-optional` and `union` mode.
35
+
36
+ ### TypeScript Emitter
37
+
38
+ In `all-optional` mode, the emitter keeps the existing interface shape. In `union` mode, it emits a base object for non-choice fields and combines it with a generated branch union.
39
+
40
+ The generated union uses peer `?: never` properties so TypeScript rejects payloads containing more than one branch. Optional choice groups include an empty branch where the WSDL permits omitting all choice members.
41
+
42
+ ### OpenAPI Emitter
43
+
44
+ The schema strategy is the one proven by [OpenAPI Fastify Compatibility](v1.0-openapi-fastify-compatibility.md). The generated request-body schema uses `oneOf` over containing-object branches with peer `not` constraints.
45
+
46
+ Choice member properties remain on the containing object, required non-choice properties stay top-level, and optional choice groups get an empty branch constraint. Closed `oneOf` branches alone were avoided because AJV can remove additional properties before evaluating branch results under Fastify defaults.
47
+
48
+ ### Gateway And Test Emitters
49
+
50
+ Generated gateway route schemas consume the new OpenAPI shape without hand edits. Generated mock clients select one choice branch in union mode.
51
+
52
+ Generated validation tests include invalid multi-branch request cases and missing required-branch request cases for top-level request choice groups. Fastify rejection is covered in generated suites.
53
+
54
+ ## Testing Coverage
55
+
56
+ ### Compiler Tests
57
+
58
+ Coverage asserts catalog metadata for simple, optional, required, nested, attribute-mixed, and sequence-mixed choice groups.
59
+
60
+ ### TypeScript Tests
61
+
62
+ Coverage checks generated `types.ts` in both `all-optional` and `union` mode. Compile-only tests prove invalid multi-branch payloads fail when union mode is selected.
63
+
64
+ ### OpenAPI Tests
65
+
66
+ Coverage checks generated schema branches and validates generated specs with the existing OpenAPI validation path.
67
+
68
+ ### Gateway Tests
69
+
70
+ Coverage checks valid choice request bodies, invalid multi-branch request bodies, and missing required choice request bodies.
71
+
72
+ ### Regression Tests
73
+
74
+ Snapshot coverage protects default generated output from unintended drift.
75
+
76
+ ## Acceptance Criteria
77
+
78
+ Satisfied by `0.26.0`:
79
+
80
+ - `--client-choice-mode union` changes generated output in a test-backed way.
81
+ - `all-optional` mode remains default and stable.
82
+ - TypeScript rejects invalid multi-branch payloads in union mode where the object model can represent exclusivity.
83
+ - OpenAPI schemas validate with the project validator.
84
+ - Generated Fastify routes accept valid branch payloads.
85
+ - Generated Fastify routes reject invalid branch combinations through the selected schema strategy.
86
+ - Docs describe both modes and their tradeoffs accurately.
87
+
88
+ ## Release Implications
89
+
90
+ This slice shipped as the `0.26.0` user-facing feature release. It remains opt-in before 1.0, with no upgrade steps for users who keep the default mode.
@@ -0,0 +1,74 @@
1
+ # Version 1.0 Contract Audit
2
+
3
+ Plan for aligning public flags, programmatic options, docs, and generated behavior before implementing the remaining 1.0 features.
4
+
5
+ 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
+
7
+ ## Goal
8
+
9
+ 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
+
11
+ ## Why This Slice Comes First
12
+
13
+ This slice prevents later work from building on ambiguous behavior. It also gives contributors a reliable target when they implement choice union mode, JSON array streaming, and WSDL feature coverage.
14
+
15
+ ## Scope
16
+
17
+ - Audit CLI flags in `src/cli.ts` against `docs/cli-reference.md`.
18
+ - Audit programmatic options in exported types against `docs/api-reference.md`.
19
+ - Audit configuration file formats against `docs/configuration.md`.
20
+ - Audit generated output claims against snapshots and `examples/generated-output`.
21
+ - Refresh `ROADMAP.md` so shipped work is not listed as future work.
22
+ - Add failing tests for public behavior that must be implemented in later slices.
23
+
24
+ ## Out Of Scope
25
+
26
+ - Do not implement choice union mode in this slice.
27
+ - Do not implement JSON array streaming in this slice.
28
+ - Do not expand WSDL feature support in this slice.
29
+ - Do not change default generated output unless a contract is already wrong.
30
+
31
+ ## Required Findings
32
+
33
+ ### Choice Mode
34
+
35
+ `--client-choice-mode union` must stay public because 1.0 requires full union support. The audit should identify every code path and doc section that must change when union mode is implemented.
36
+
37
+ ### JSON Array Streaming
38
+
39
+ `format: "json-array"` must stay in the 1.0 roadmap because 1.0 requires the format. The audit should identify every parser, client, OpenAPI, gateway, runtime, and docs surface that currently assumes NDJSON.
40
+
41
+ ### Roadmap State
42
+
43
+ `ROADMAP.md` must reflect `0.25.x` as current. Release preflight and security hardening must be treated as shipped work.
44
+
45
+ ### Release Metadata
46
+
47
+ Tag gaps before `1.0.0` are not blockers by themselves. The audit should only confirm that release-preflight and release workflows catch missing metadata for the target 1.0 release.
48
+
49
+ ## Testing Approach
50
+
51
+ ### Documentation Validation
52
+
53
+ Run `npm run docs:validate` after documentation changes. This verifies Markdown links and TypeScript fenced snippets.
54
+
55
+ ### Contract Snapshot
56
+
57
+ Add or update focused tests that inspect CLI option availability and generated metadata defaults. These tests should fail only when public contract surfaces drift from documentation.
58
+
59
+ ### Negative Tests
60
+
61
+ Add tests that document the current failing behavior for union mode and JSON array streaming only if the next slice can consume them. These tests should be skipped or marked as expected failures only if the repository already has an accepted pattern for that.
62
+
63
+ ## Acceptance Criteria
64
+
65
+ - `ROADMAP.md` names `0.25.x` as current.
66
+ - `docs/roadmap/README.md` links every 1.0 slice.
67
+ - CLI, API, and configuration docs agree on required 1.0 behavior.
68
+ - Known contract gaps are linked to implementation slices.
69
+ - `CHANGELOG.md` has one `docs(roadmap):` entry for the audit docs.
70
+ - `npm run docs:validate` passes.
71
+
72
+ ## Release Implications
73
+
74
+ This slice can ship as a documentation-only minor release if no behavior changes are made. If tests are added that currently fail or are skipped, the release notes must explain that they are roadmap scaffolding rather than completed support.
@@ -0,0 +1,99 @@
1
+ # Version 1.0 JSON Array Streaming
2
+
3
+ Plan for implementing `format: "json-array"` streaming for SOAP operations that already use the stream configuration model.
4
+
5
+ This is the next planned feature slice after the `0.26.0` choice union mode release.
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
+ `format: "json-array"` must stream records incrementally as a valid JSON array without buffering the full SOAP response. The implementation must be compatible with generated clients, OpenAPI output, Fastify routes, generated tests, and production docs.
12
+
13
+ ## Design Direction
14
+
15
+ JSON array streaming should write an opening bracket, stream comma-separated JSON records, and write a closing bracket after the async iterable completes. The implementation must preserve backpressure by converting the async iterable into a Node `Readable` stream.
16
+
17
+ The key research question is error timing. If the route can observe an upstream error before sending the first byte, it should still return the normal error envelope. Once the JSON array response has started, a later error must truncate the response and clients must treat the JSON parse failure as a failed stream.
18
+
19
+ ## Scope
20
+
21
+ - Implement a runtime helper for JSON array streaming.
22
+ - Preserve existing NDJSON behavior.
23
+ - Emit JSON array route handlers when stream metadata says `format: "json-array"`.
24
+ - Emit `application/json` OpenAPI content with an array item schema.
25
+ - Generate stream-aware mock clients and tests for JSON array operations.
26
+ - Document terminal-error behavior for JSON array clients.
27
+
28
+ ## Out Of Scope
29
+
30
+ - Do not implement streaming request bodies in this slice.
31
+ - Do not change buffered SOAP operations.
32
+ - Do not make JSON array the default stream format.
33
+
34
+ ## Research Tasks
35
+
36
+ ### First-Byte Timing
37
+
38
+ Research whether generated routes should prefetch the first record before calling `reply.send`. Prefetching can preserve normal error envelopes for errors that happen before any record is available, but it may delay response headers for slow upstream services.
39
+
40
+ ### Empty Stream Handling
41
+
42
+ Confirm that an empty stream returns `[]` with `application/json`. The helper must emit a syntactically valid empty array without special route code where possible.
43
+
44
+ ### Backpressure Handling
45
+
46
+ Confirm that the helper does not pull from the async iterable faster than the HTTP stream can write. Use tests modeled after existing NDJSON backpressure tests.
47
+
48
+ ### Terminal Error Handling
49
+
50
+ Confirm how Fastify and Node surface stream errors after the JSON array has begun. Document the client-visible behavior in production docs and troubleshooting docs.
51
+
52
+ ## Implementation Units
53
+
54
+ ### Runtime Helper
55
+
56
+ Add `toJsonArray<T>(records: AsyncIterable<T>): Readable` beside `toNdjson`. The helper should serialize records with `JSON.stringify`, insert commas between records, and close the array when iteration completes.
57
+
58
+ ### Gateway Emitter
59
+
60
+ Generate stream route handlers that import `toJsonArray` for `json-array` operations and `toNdjson` for `ndjson` operations. The handler must set the media type from stream metadata.
61
+
62
+ ### OpenAPI Emitter
63
+
64
+ Emit `application/json` with `schema.type = "array"` and `items` pointing at the record schema. Keep `x-wsdl-tsc-stream` metadata so downstream tooling can still identify stream operations.
65
+
66
+ ### Client And Test Emitters
67
+
68
+ Keep the client method return shape as `StreamOperationResponse<RecordType>`. Generated tests should parse the HTTP response as a JSON array and assert record values.
69
+
70
+ ## Testing Approach
71
+
72
+ ### Unit Tests
73
+
74
+ Test `toJsonArray` with empty records, one record, multiple records, string escaping, source errors, and backpressure. Mirror the existing `toNdjson` tests where possible.
75
+
76
+ ### OpenAPI Tests
77
+
78
+ Test that JSON array operations advertise `application/json`, array schema items, and stream extension metadata.
79
+
80
+ ### Gateway Integration Tests
81
+
82
+ Test Fastify route output for a JSON array stream operation. Assert content type, parseable JSON, and record order.
83
+
84
+ ### Error Tests
85
+
86
+ Test errors before the first emitted record separately from errors after at least one emitted byte. The expected post-start behavior is a failed or truncated response, not a JSON error envelope.
87
+
88
+ ## Acceptance Criteria
89
+
90
+ - `format: "json-array"` generates working client, OpenAPI, gateway, and tests.
91
+ - JSON array output is parseable when the source completes normally.
92
+ - Output is streamed incrementally and does not buffer the full response.
93
+ - NDJSON behavior remains unchanged.
94
+ - Terminal-error behavior is documented accurately.
95
+ - `npm test` and `npm run smoke:pipeline` pass.
96
+
97
+ ## Release Implications
98
+
99
+ This slice is a user-facing feature release. The release notes must state that `json-array` is no longer reserved and can be selected per operation with `stream-config`.
@@ -0,0 +1,97 @@
1
+ # Version 1.0 OpenAPI Fastify Compatibility
2
+
3
+ Plan for proving schema choices against Fastify before changing choice union output or JSON array streaming output.
4
+
5
+ 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
+
7
+ ## Goal
8
+
9
+ This slice confirms which OpenAPI 3.1 and JSON Schema constructs are safe for generated Fastify gateways. The result should constrain choice union mode, JSON array streaming, and any future schema complexity work.
10
+
11
+ ## Why This Slice Comes Before Implementation
12
+
13
+ Fastify compatibility is part of the generated gateway contract. A TypeScript type shape can be correct while the generated OpenAPI schema is unusable for Fastify request validation or response serialization.
14
+
15
+ ## Scope
16
+
17
+ - Test `oneOf`, `anyOf`, and `allOf` request schemas through Fastify validation.
18
+ - Test generated response schemas through Fastify serialization where applicable.
19
+ - Test route schemas that omit response serialization for streamed responses.
20
+ - Verify how schema complexity interacts with the existing response-depth safety limit.
21
+ - Document the allowed schema strategy for choice union mode.
22
+ - Document the allowed schema strategy for JSON array streaming.
23
+
24
+ ## Out Of Scope
25
+
26
+ - Do not implement choice union mode in this slice.
27
+ - Do not implement JSON array streaming in this slice.
28
+ - Do not change public WSDL feature coverage in this slice.
29
+
30
+ ## Research Questions
31
+
32
+ ### Choice Request Validation
33
+
34
+ The research must determine whether `oneOf` with mutually exclusive object branches behaves correctly for request bodies. It must also determine whether additional branch exclusion properties are needed to reject payloads that send more than one choice branch.
35
+
36
+ ### Choice Response Serialization
37
+
38
+ The research must determine whether generated response schemas should use union constructs or stay envelope-based with permissive payload branches. If Fastify serialization becomes fragile, generated route response schemas must stay conservative.
39
+
40
+ ### JSON Array Streaming Schema
41
+
42
+ The research must determine how to advertise an incrementally streamed JSON array in OpenAPI while keeping generated Fastify route schemas valid. Stream routes already omit normal response serialization because the response is not a single buffered object.
43
+
44
+ ## Local Fastify Findings
45
+
46
+ The initial probes use the current project Fastify dependency and `fastify.inject` in `test/integration/fastify-schema-compatibility.test.ts`.
47
+
48
+ ### Choice Request Validation
49
+
50
+ Fastify's default AJV options remove additional properties when `additionalProperties: false` is present. Because of that, closed `oneOf` branch schemas are not enough for `xsd:choice`: a payload containing both choice fields can be mutated into one valid branch before the `oneOf` result is evaluated.
51
+
52
+ The allowed request strategy is:
53
+
54
+ - Put the choice member properties on the containing object schema.
55
+ - Use `oneOf` for exact branch selection.
56
+ - Add peer `not` constraints to each branch so a branch fails when another choice member is present.
57
+ - Keep `additionalProperties: false` at the containing object level when the generator already owns the full object shape.
58
+
59
+ Do not use bare `anyOf` for exclusive choices. The local probe confirms it accepts a payload containing more than one choice field when branches are open.
60
+
61
+ ### Choice Response Serialization
62
+
63
+ Keep generated gateway response schemas conservative for this slice. The local probe confirms current envelope-style responses with `anyOf` payload branches serialize under Fastify, so no generator response-schema expansion is required before the choice implementation slice.
64
+
65
+ ### JSON Array Streaming Schema
66
+
67
+ Keep streamed Fastify routes free of response serialization schemas. The local probe confirms a route can stream an `application/json` array body without registering a Fastify response schema. OpenAPI can advertise the array response, while generated route registration should omit the response schema for streamed handlers.
68
+
69
+ ### Response Schema Complexity
70
+
71
+ The existing response complexity guard walks `$ref` values inside `allOf`, `anyOf`, and `oneOf`. Unit coverage now locks that behavior so future union work does not bypass the depth safety limit.
72
+
73
+ ## Testing Approach
74
+
75
+ ### Local Fastify Probes
76
+
77
+ Create focused Vitest tests that instantiate Fastify, register minimal schemas, and call `fastify.inject`. These tests should use the project dependency versions rather than external assumptions.
78
+
79
+ ### Generator Contract Tests
80
+
81
+ Once a schema strategy is chosen, add tests that assert generated OpenAPI and gateway operation schemas use only approved constructs.
82
+
83
+ ### Compatibility Fixtures
84
+
85
+ Use small synthetic schemas for compatibility probes. Do not require WSDL fixtures until the generator implementation slices.
86
+
87
+ ## Acceptance Criteria
88
+
89
+ - A documented schema strategy exists for choice union request bodies.
90
+ - A documented schema strategy exists for choice union response schemas.
91
+ - A documented schema strategy exists for JSON array stream responses.
92
+ - Tests prove the selected strategy against local Fastify behavior.
93
+ - Existing gateway integration tests still pass.
94
+
95
+ ## Release Implications
96
+
97
+ This slice may ship without user-facing generator changes if it only adds tests and docs. If it changes schema generation defaults, it must be paired with snapshot updates and migration notes.
@@ -0,0 +1,77 @@
1
+ # Version 1.0 Release Candidate Gates
2
+
3
+ Plan for validating that `1.0.0` is repeatable, documented, test-backed, and ready to publish.
4
+
5
+ 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
+
7
+ ## Goal
8
+
9
+ The release candidate gates define what must be true before tagging `v1.0.0`. They turn release readiness into concrete checks rather than subjective confidence.
10
+
11
+ ## Scope
12
+
13
+ - Verify public docs match shipped behavior.
14
+ - Verify generated examples are current.
15
+ - Verify package contents and agent skill artifact.
16
+ - Verify supported Node.js coverage.
17
+ - Verify provenance publish workflow readiness.
18
+ - Verify release notes and changelog.
19
+
20
+ ## Out Of Scope
21
+
22
+ - Do not add new generator features in this slice.
23
+ - Do not accept known contract gaps as release notes caveats.
24
+ - Do not publish `1.0.0` until all gates pass.
25
+
26
+ ## Required Gates
27
+
28
+ ### Documentation Gate
29
+
30
+ Run `npm run docs:validate`. Confirm README, CLI reference, API reference, configuration docs, supported patterns, production docs, and roadmap agree on choice union mode and JSON array streaming.
31
+
32
+ ### Test Gate
33
+
34
+ Run `npm test`. Confirm unit, snapshot, and integration suites cover the 1.0 contract.
35
+
36
+ ### Smoke Gate
37
+
38
+ Run `npm run smoke:pipeline`. Confirm the canonical weather fixture still generates the full stack.
39
+
40
+ ### CI Gate
41
+
42
+ Run `npm run ci`. Confirm build, typecheck, docs validation, package validation, skill validation, tests, and smoke pipeline pass together.
43
+
44
+ ### Example Gate
45
+
46
+ Run the generated example freshness check through release preflight. Confirm committed examples match regenerated output.
47
+
48
+ ### Node Gate
49
+
50
+ Run the supported Node.js floor and the newest active Node.js line in CI before the release candidate is accepted.
51
+
52
+ ### Release Gate
53
+
54
+ Run `npm run release:preflight -- v1.0.0` during release preparation. Confirm release notes, changelog, dependency pins, generated examples, CI, and skill packaging pass.
55
+
56
+ ## Documentation Checklist
57
+
58
+ - README names supported 1.0 capabilities accurately.
59
+ - CLI reference lists implemented flags only.
60
+ - API reference lists implemented options only.
61
+ - Configuration docs describe both stream formats.
62
+ - Supported patterns reflects the WSDL matrix.
63
+ - Production docs describe terminal-error behavior for both stream formats.
64
+ - Migration docs explain any behavior changes since `0.x`.
65
+
66
+ ## Acceptance Criteria
67
+
68
+ - All required gates pass without skipped 1.0 blockers.
69
+ - `docs/releases/v1.0.0.md` exists and follows the release note structure.
70
+ - `CHANGELOG.md` has a dated `1.0.0` section during release preparation.
71
+ - The package dry-run contents include required runtime templates and docs.
72
+ - The agent skill artifact validates and packages deterministically.
73
+ - The release workflow can publish with provenance.
74
+
75
+ ## Release Implications
76
+
77
+ This slice is the final release preparation work. It should produce the `1.0.0` release commit only after all feature slices have shipped or merged into the release branch.
@@ -0,0 +1,89 @@
1
+ # Version 1.0 WSDL Coverage Matrix
2
+
3
+ Plan for turning WSDL and XSD support claims into automated, fixture-backed evidence before 1.0.
4
+
5
+ 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
+
7
+ ## Goal
8
+
9
+ The project should have an automated feature matrix that proves which WSDL and XSD patterns are supported, partially supported, or rejected with diagnostics. The matrix should feed `docs/supported-patterns.md` and protect 1.0 from silent miscompilation.
10
+
11
+ ## Design Direction
12
+
13
+ Each matrix row should have a minimal fixture, an expected support status, and a test that proves the status. A supported feature must compile and generate aligned client, OpenAPI, and gateway artifacts where applicable. An unsupported feature must fail with a clear diagnostic or be documented as intentionally out of scope.
14
+
15
+ ## Scope
16
+
17
+ - Add a fixture directory for WSDL feature coverage.
18
+ - Add a manifest that lists features, status, expected commands, and expected diagnostics.
19
+ - Add Vitest coverage that reads the manifest and runs the relevant generation steps.
20
+ - Update `docs/supported-patterns.md` from the matrix findings.
21
+ - Include priority gaps from the roadmap.
22
+
23
+ ## Out Of Scope
24
+
25
+ - Do not implement every unsupported WSDL feature in this slice.
26
+ - Do not replace the existing weather fixture for smoke tests.
27
+ - Do not make docs generated from the manifest unless that is a deliberate later decision.
28
+
29
+ ## Priority Feature Rows
30
+
31
+ | Feature | Expected 1.0 Status | Notes |
32
+ |---------|---------------------|-------|
33
+ | `xs:choice` union mode | supported | Implemented in `0.26.0` |
34
+ | `xs:union` | supported or diagnostic | Decide after fixture work |
35
+ | Abstract types | diagnostic | Avoid silent concrete treatment |
36
+ | Substitution groups | diagnostic | Avoid silent omission |
37
+ | Multi-binding WSDLs | documented behavior | First binding or explicit selection |
38
+ | External `PolicyReference` | partial or diagnostic | Inline policy already exists |
39
+ | Deep composition | supported | Prove current recursion behavior |
40
+ | `xs:anyAttribute` | diagnostic | Current support is not full |
41
+ | MTOM/XOP attachments | unsupported diagnostic | Keep out of 1.0 scope unless required |
42
+
43
+ ## Manifest Shape
44
+
45
+ The manifest should be small and reviewable. A JSON or TypeScript manifest is acceptable if tests can import it deterministically.
46
+
47
+ ```json
48
+ {
49
+ "features": [
50
+ {
51
+ "id": "choice-union-simple",
52
+ "fixture": "choice-union-simple.wsdl",
53
+ "status": "supported",
54
+ "commands": ["compile", "client", "openapi", "gateway"]
55
+ }
56
+ ]
57
+ }
58
+ ```
59
+
60
+ ## Testing Approach
61
+
62
+ ### Matrix Runner
63
+
64
+ Create a Vitest suite that reads the manifest and executes the requested commands through programmatic APIs where possible. CLI smoke behavior should remain covered by existing smoke scripts.
65
+
66
+ ### Supported Feature Tests
67
+
68
+ For supported rows, assert successful compilation, generated TypeScript type-checking, OpenAPI validation, and gateway schema generation when applicable.
69
+
70
+ ### Diagnostic Feature Tests
71
+
72
+ For diagnostic rows, assert the exact error class or user-facing message shape. Avoid brittle full-message assertions unless the message is part of the public contract.
73
+
74
+ ### Documentation Tests
75
+
76
+ Ensure every documented unsupported or partial feature has a corresponding matrix row. This can be a lightweight consistency test that compares feature IDs with anchors or explicit markers in `docs/supported-patterns.md`.
77
+
78
+ ## Acceptance Criteria
79
+
80
+ - The matrix includes every roadmap priority feature.
81
+ - Supported rows have passing fixtures.
82
+ - Unsupported rows fail with clear diagnostics.
83
+ - `docs/supported-patterns.md` reflects the matrix.
84
+ - No known feature silently miscompiles in matrix coverage.
85
+ - The matrix can run in CI or release preflight without network access.
86
+
87
+ ## Release Implications
88
+
89
+ This slice may reveal features that should be implemented before 1.0. It may also justify explicit post-1.0 deferrals if diagnostics and documentation are strong enough.
@@ -12,7 +12,8 @@ These patterns are handled end-to-end: WSDL parsing, TypeScript type generation,
12
12
  - Type inheritance through `<xs:extension>` and `<xs:restriction>` on both simple and complex content
13
13
  - Nested XSD imports across multiple schema files with relative and absolute URI resolution
14
14
  - Multiple namespaces with deterministic collision resolution via PascalCase uniqueness
15
- - `<xs:choice>` elements modeled as parallel optional alternatives
15
+ - `<xs:choice>` elements modeled as parallel optional alternatives by default
16
+ - Opt-in `<xs:choice>` union mode with exclusive TypeScript branch unions and OpenAPI request constraints
16
17
  - Optional and nillable fields using `minOccurs`, `maxOccurs`, and `nillable` attributes
17
18
  - `ArrayOf*` wrapper types with automatic unwrapping in OpenAPI and runtime bridging in gateway code
18
19
  - WSDL/XSD documentation annotations propagated into TypeScript JSDoc comments and OpenAPI descriptions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techspokes/typescript-wsdl-client",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Turn legacy WSDL/SOAP services into typed TypeScript clients, OpenAPI 3.1 specs, and production-ready Fastify REST gateways. Built for enterprise SOAP modernization.",
5
5
  "keywords": [
6
6
  "wsdl",
@@ -95,14 +95,14 @@
95
95
  "fastify": "^5.8.5",
96
96
  "fastify-plugin": "^5.1.0",
97
97
  "rimraf": "^6.1.3",
98
- "tsx": "^4.22.3",
98
+ "tsx": "^4.22.4",
99
99
  "typescript": "^6.0.3",
100
- "vitest": "^4.1.7"
100
+ "vitest": "^4.1.8"
101
101
  },
102
102
  "dependencies": {
103
103
  "@apidevtools/swagger-parser": "^12.1.0",
104
104
  "fast-xml-parser": "^5.8.0",
105
- "js-yaml": "^4.1.1",
105
+ "js-yaml": "^4.2.0",
106
106
  "saxes": "^6.0.0",
107
107
  "soap": "^1.9.3",
108
108
  "yargs": "^18.0.0"