@techspokes/typescript-wsdl-client 1.1.8 → 1.2.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 +17 -3
- package/dist/checkedPlanning.js +27 -4
- package/dist/cli.js +17 -1
- package/dist/client/generateClient.js +72 -16
- package/dist/client/generateOperations.js +30 -11
- package/dist/client/generateUtils.js +5 -1
- package/dist/compiler/canonicalGraph.d.ts +4 -15
- package/dist/compiler/canonicalGraph.js +1 -8
- package/dist/compiler/componentRecordProjection.d.ts +3 -0
- package/dist/compiler/componentRecordProjection.js +10 -0
- package/dist/compiler/declarationIdentity.d.ts +22 -0
- package/dist/compiler/declarationIdentity.js +9 -0
- package/dist/compiler/directCodec.d.ts +22 -2
- package/dist/compiler/directCodec.js +40 -7
- package/dist/compiler/directOperation.d.ts +26 -4
- package/dist/compiler/directOperation.js +59 -5
- package/dist/compiler/directSoap.js +24 -7
- package/dist/compiler/directSourceCapsule.js +59 -3
- package/dist/compiler/directStructure.js +6 -2
- package/dist/compiler/directStructurePlan.d.ts +10 -1
- package/dist/compiler/directStructurePlan.js +27 -7
- package/dist/compiler/directValues.d.ts +15 -3
- package/dist/compiler/directValues.js +20 -4
- package/dist/compiler/legacyDeclarations.d.ts +26 -0
- package/dist/compiler/legacyDeclarations.js +144 -0
- package/dist/compiler/projectionScalar.d.ts +18 -1
- package/dist/compiler/projectionScalar.js +47 -13
- package/dist/compiler/rpcStringValues.d.ts +30 -0
- package/dist/compiler/rpcStringValues.js +196 -0
- package/dist/compiler/rpcTypedValues.d.ts +48 -0
- package/dist/compiler/rpcTypedValues.js +190 -0
- package/dist/compiler/schemaCompiler.js +44 -109
- package/dist/compiler/semanticCatalog.d.ts +2 -2
- package/dist/gateway/generateComposedGateway.d.ts +16 -0
- package/dist/gateway/generateComposedGateway.js +65 -0
- package/dist/gateway/generateGateway.js +1 -0
- package/dist/gateway/generators.js +19 -4
- package/dist/gateway/helpers.d.ts +1 -0
- package/dist/gateway/helpers.js +15 -0
- package/dist/generation/componentShape.js +25 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/loader/orderedSyntax.d.ts +4 -0
- package/dist/loader/orderedSyntax.js +18 -4
- package/dist/multiServicePipeline.d.ts +41 -0
- package/dist/multiServicePipeline.js +287 -0
- package/dist/openapi/composeOpenAPI.d.ts +29 -0
- package/dist/openapi/composeOpenAPI.js +322 -0
- package/dist/pipeline.d.ts +1 -1
- package/dist/pipeline.js +2 -0
- package/docs/agent-skill.md +10 -1
- package/docs/api-reference.md +127 -9
- package/docs/checked-gateway.md +2 -0
- package/docs/checked-generation.md +11 -5
- package/docs/cli-reference.md +25 -5
- package/docs/concepts.md +4 -5
- package/docs/configuration.md +10 -3
- package/docs/corpus.md +1 -1
- package/docs/gateway-guide.md +104 -27
- package/docs/generated-code.md +12 -6
- package/docs/migration-playbook.md +4 -0
- package/docs/migration.md +124 -6
- package/docs/output-anatomy.md +20 -17
- package/docs/production.md +7 -5
- package/docs/start-here.md +12 -2
- package/docs/supported-patterns.md +17 -0
- package/docs/testing.md +2 -0
- package/docs/troubleshooting.md +3 -1
- package/llms.txt +9 -1
- package/package.json +2 -2
- package/src/runtime/clientStreamMethods.tpl.txt +156 -148
- package/src/runtime/operationsStreamHelper.tpl.txt +6 -6
- package/src/runtime/streamXml.ts +48 -20
package/dist/pipeline.js
CHANGED
|
@@ -21,6 +21,7 @@ import { resolveCompilerOptions } from "./config.js";
|
|
|
21
21
|
import { emitClientArtifacts, reportCompilationStats, reportOpenApiSuccess, success } from "./util/cli.js";
|
|
22
22
|
import { loadStreamConfigFile } from "./util/streamConfig.js";
|
|
23
23
|
import { applyShapeCatalogs } from "./compiler/shapeResolver.js";
|
|
24
|
+
import { deriveClientName } from "./util/tools.js";
|
|
24
25
|
/**
|
|
25
26
|
* Runs the complete generation pipeline from WSDL to TypeScript artifacts and optionally OpenAPI/Gateway/App
|
|
26
27
|
*
|
|
@@ -129,6 +130,7 @@ export async function runGenerationPipeline(opts) {
|
|
|
129
130
|
clientDir: opts.clientOutDir ? path.resolve(opts.clientOutDir) : undefined,
|
|
130
131
|
// Reuse the same imports mode as the TypeScript client/types/utils emitters
|
|
131
132
|
imports: finalCompiler.imports,
|
|
133
|
+
clientClassName: opts.gateway.clientClassName ?? deriveClientName(compiled),
|
|
132
134
|
// Pass catalog for runtime unwrap generation
|
|
133
135
|
catalogFile: path.resolve(opts.catalogOut),
|
|
134
136
|
// Thread flatten flag from OpenAPI options
|
package/docs/agent-skill.md
CHANGED
|
@@ -4,6 +4,12 @@ Standalone agent skill artifact for consumer projects using `@techspokes/typescr
|
|
|
4
4
|
|
|
5
5
|
## Purpose
|
|
6
6
|
|
|
7
|
+
The skill is a light router to canonical product documentation. Its manual instructions cover input discovery, document selection and generated-file ownership; generation profiles, constructors, mappings, compatibility and transport rules remain in the core guides.
|
|
8
|
+
|
|
9
|
+
Agents prefer the installed package's documentation, which matches the code they are using. The ZIP also includes generated extracts of canonical docs for its recorded release version, including [migration](migration.md#from-11x-to-120), composition, checked generation and streaming. Those extracts are versioned snapshots, not separately authored sources of product truth.
|
|
10
|
+
|
|
11
|
+
Use a matching repository tag when the installed guide is unavailable, and use target-version docs deliberately during upgrades. Live `main` may contain unreleased behavior; a skill for a newer release must not establish capabilities of an older installed package. `references/SOURCE-MAP.json` records the snapshot's version, tag and source sections.
|
|
12
|
+
|
|
7
13
|
Release assets include `typescript-wsdl-client-agent-skill-vX.Y.Z.zip` and `SHA256SUMS`. GitHub artifact provenance attests the ZIP, which contains an installable `typescript-wsdl-client/` skill folder for consumer projects.
|
|
8
14
|
|
|
9
15
|
The skill is for consumer-project agents. It tells agents how to choose `wsdl-tsc` commands, handle generated output boundaries, load reference material, and validate generated code without treating generated files as hand-maintained source.
|
|
@@ -18,8 +24,11 @@ typescript-wsdl-client/
|
|
|
18
24
|
references/
|
|
19
25
|
architecture.md
|
|
20
26
|
consumer-workflows.md
|
|
27
|
+
checked-generation.md
|
|
21
28
|
cli-reference.md
|
|
29
|
+
composition.md
|
|
22
30
|
generated-code.md
|
|
31
|
+
migration.md
|
|
23
32
|
testing.md
|
|
24
33
|
troubleshooting.md
|
|
25
34
|
streaming.md
|
|
@@ -28,7 +37,7 @@ typescript-wsdl-client/
|
|
|
28
37
|
|
|
29
38
|
## Evergreen Content
|
|
30
39
|
|
|
31
|
-
Evergreen content lives under `agent-skill/` and
|
|
40
|
+
Evergreen content lives under `agent-skill/` and supplies stable routing and ownership instructions. Update product contracts in the canonical docs and select their sections through the reference manifest; do not copy those details into hand-maintained skill summaries.
|
|
32
41
|
|
|
33
42
|
The evergreen files are `agent-skill/SKILL.md`, `agent-skill/install.mjs`, `agent-skill/evergreen/architecture.md`, and `agent-skill/evergreen/consumer-workflows.md`.
|
|
34
43
|
|
package/docs/api-reference.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# Programmatic API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This reference covers public generation, composition, stream and security APIs. Assessment and checked planning are separate diagnostic surfaces; see [checked generation](checked-generation.md#programmatic-planning-and-generation).
|
|
4
4
|
|
|
5
5
|
See the main [README](../README.md) for installation, CLI usage, and project overview.
|
|
6
6
|
|
|
7
|
-
All file-producing APIs automatically apply [TypeScript preambles](generated-code.md#generated-preambles-and-eslint).
|
|
7
|
+
All file-producing APIs automatically apply [TypeScript preambles](generated-code.md#generated-preambles-and-eslint). Adding a preamble does not change an API signature or option; existing scaffold skip/force behavior still applies. Resource and TypeScript file-write failures propagate to callers.
|
|
8
|
+
|
|
9
|
+
Generated-output compatibility is versioned separately from those preambles. Read the [1.1.x-to-1.2.0 migration guide](migration.md#from-11x-to-120) before regenerating existing clients or changing their selected profile.
|
|
8
10
|
|
|
9
11
|
## compileWsdlToProject
|
|
10
12
|
|
|
@@ -17,6 +19,8 @@ await compileWsdlToProject({
|
|
|
17
19
|
wsdl: "./wsdl/Hotel.wsdl",
|
|
18
20
|
outDir: "./src/services/hotel",
|
|
19
21
|
options: {
|
|
22
|
+
wsdl: "./wsdl/Hotel.wsdl",
|
|
23
|
+
out: "./src/services/hotel",
|
|
20
24
|
imports: "js",
|
|
21
25
|
catalog: true,
|
|
22
26
|
primitive: {
|
|
@@ -38,13 +42,13 @@ await compileWsdlToProject({
|
|
|
38
42
|
declare function compileWsdlToProject(input: {
|
|
39
43
|
wsdl: string;
|
|
40
44
|
outDir: string;
|
|
41
|
-
options?:
|
|
45
|
+
options?: CompilerOptions;
|
|
42
46
|
streamConfigFile?: string;
|
|
43
47
|
streamConfig?: StreamConfig;
|
|
44
48
|
}): Promise<void>;
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
`streamConfigFile` points at
|
|
51
|
+
`streamConfigFile` points at raw JSON parsed by `loadStreamConfigFile`; `streamConfig` accepts normalized metadata from `parseStreamConfig`. The file takes precedence when both are set. Omitting both retains buffered API selection, without a byte-for-byte output guarantee across upgrades. See [Stream Configuration](configuration.md#stream-configuration).
|
|
48
52
|
|
|
49
53
|
### CompilerOptions
|
|
50
54
|
|
|
@@ -120,6 +124,7 @@ interface GenerateOpenAPIOptions {
|
|
|
120
124
|
pathStyle?: "kebab" | "asis" | "lower";
|
|
121
125
|
defaultMethod?: string;
|
|
122
126
|
closedSchemas?: boolean;
|
|
127
|
+
flattenArrayWrappers?: boolean;
|
|
123
128
|
pruneUnusedSchemas?: boolean;
|
|
124
129
|
tagStyle?: "default" | "first" | "service";
|
|
125
130
|
tagsFile?: string;
|
|
@@ -169,10 +174,17 @@ interface GenerateGatewayOptions {
|
|
|
169
174
|
openapiDocument?: any;
|
|
170
175
|
outDir: string;
|
|
171
176
|
clientDir?: string;
|
|
172
|
-
versionSlug
|
|
173
|
-
serviceSlug
|
|
177
|
+
versionSlug: string;
|
|
178
|
+
serviceSlug: string;
|
|
174
179
|
defaultResponseStatusCodes?: number[];
|
|
175
180
|
imports?: "js" | "ts" | "bare";
|
|
181
|
+
clientClassName?: string;
|
|
182
|
+
clientDecoratorName?: string;
|
|
183
|
+
catalogFile?: string;
|
|
184
|
+
emitPlugin?: boolean;
|
|
185
|
+
emitRuntime?: boolean;
|
|
186
|
+
stubHandlers?: boolean;
|
|
187
|
+
flattenArrayWrappers?: boolean;
|
|
176
188
|
}
|
|
177
189
|
```
|
|
178
190
|
|
|
@@ -231,8 +243,10 @@ await runGenerationPipeline({
|
|
|
231
243
|
|
|
232
244
|
```typescript
|
|
233
245
|
declare function runGenerationPipeline(opts: PipelineOptions): Promise<{
|
|
234
|
-
compiled:
|
|
246
|
+
compiled: any;
|
|
235
247
|
openapiDoc?: any;
|
|
248
|
+
checked?: CheckedInventory;
|
|
249
|
+
planning?: CheckedComponentPlan;
|
|
236
250
|
}>;
|
|
237
251
|
```
|
|
238
252
|
|
|
@@ -240,8 +254,10 @@ declare function runGenerationPipeline(opts: PipelineOptions): Promise<{
|
|
|
240
254
|
|
|
241
255
|
```typescript
|
|
242
256
|
interface PipelineOptions {
|
|
257
|
+
model?: "legacy" | "checked-components-v1";
|
|
258
|
+
checkedComponents?: Partial<CheckedComponentOptions>;
|
|
243
259
|
wsdl: string;
|
|
244
|
-
catalogOut
|
|
260
|
+
catalogOut?: string;
|
|
245
261
|
clientOutDir?: string;
|
|
246
262
|
compiler?: Partial<CompilerOptions>;
|
|
247
263
|
openapi?: Omit<GenerateOpenAPIOptions, "wsdl" | "catalogFile" | "compiledCatalog"> & {
|
|
@@ -249,7 +265,19 @@ interface PipelineOptions {
|
|
|
249
265
|
};
|
|
250
266
|
gateway?: Omit<GenerateGatewayOptions, "openapiFile" | "openapiDocument"> & {
|
|
251
267
|
outDir?: string;
|
|
268
|
+
versionSlug: string;
|
|
269
|
+
serviceSlug: string;
|
|
270
|
+
};
|
|
271
|
+
app?: {
|
|
272
|
+
appDir: string;
|
|
273
|
+
openapiMode?: "copy" | "reference";
|
|
274
|
+
force?: boolean;
|
|
275
|
+
host?: string;
|
|
276
|
+
port?: number;
|
|
277
|
+
prefix?: string;
|
|
278
|
+
securityConfigFile?: string;
|
|
252
279
|
};
|
|
280
|
+
test?: {testDir: string; force?: boolean; flattenArrayWrappers?: boolean};
|
|
253
281
|
streamConfigFile?: string;
|
|
254
282
|
streamConfig?: StreamConfig;
|
|
255
283
|
}
|
|
@@ -257,6 +285,75 @@ interface PipelineOptions {
|
|
|
257
285
|
|
|
258
286
|
`streamConfigFile` and `streamConfig` are threaded through the compile step and into every downstream emitter via `catalog.json`. Relative paths in `shapeCatalogs` resolve against the stream-config file's directory when `streamConfigFile` is used, otherwise against the WSDL's directory.
|
|
259
287
|
|
|
288
|
+
Legacy calls require `catalogOut` at runtime. Checked component calls use `model: "checked-components-v1"` and optional `checkedComponents`; they return checked inventory/planning instead of a legacy catalog contract. See [the complete programmatic checked example](checked-generation.md#programmatic-planning-and-generation) for source policy and planning before generation. Checked RPC outputs remain opaque strings and buffered checked values; legacy stream configuration does not activate checked streaming.
|
|
289
|
+
|
|
290
|
+
## runMultiServicePipeline
|
|
291
|
+
|
|
292
|
+
Generate independent legacy clients and service routers, then publish one aggregate gateway plugin and combined OpenAPI JSON document. The [multi-service guide](gateway-guide.md#multi-service-setup) supplies a complete configuration with explicit, disjoint outputs:
|
|
293
|
+
|
|
294
|
+
```typescript
|
|
295
|
+
import {loadMultiServiceConfig, runMultiServicePipeline} from "@techspokes/typescript-wsdl-client";
|
|
296
|
+
|
|
297
|
+
const options = await loadMultiServiceConfig("./services.json");
|
|
298
|
+
const result = await runMultiServicePipeline(options);
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
interface MultiServiceEntry {
|
|
303
|
+
key: string;
|
|
304
|
+
generation: PipelineOptions;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
interface MultiServicePipelineOptions {
|
|
308
|
+
services: readonly MultiServiceEntry[];
|
|
309
|
+
openapi: OpenApiCompositionOptions & {outFile: string};
|
|
310
|
+
gateway: {
|
|
311
|
+
outDir: string;
|
|
312
|
+
imports?: "js" | "ts" | "bare";
|
|
313
|
+
openapiPath?: string | false;
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
interface MultiServicePipelineResult {
|
|
318
|
+
openapiDoc: ComposedOpenApiDocument;
|
|
319
|
+
services: Record<string, {compiled: CompiledCatalog; clientDir: string; gatewayDir: string}>;
|
|
320
|
+
pluginFile: string;
|
|
321
|
+
openapiFile: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
declare function runMultiServicePipeline(options: MultiServicePipelineOptions): Promise<MultiServicePipelineResult>;
|
|
325
|
+
declare function loadMultiServiceConfig(file: string): Promise<MultiServicePipelineOptions>;
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
`loadMultiServiceConfig` resolves filesystem paths against the JSON configuration file; direct API callers supply paths relative to their process working directory. Every service needs `wsdl`, `catalogOut`, `clientOutDir`, `openapi.outFile`, `openapi.basePath`, `gateway.outDir`, `gateway.serviceSlug` and `gateway.versionSlug`. Service keys use unique lowercase letters, digits and hyphens, starting with a letter; gateway service slugs and decorators must remain unique after normalization.
|
|
329
|
+
|
|
330
|
+
The API preserves each source's compiler and stream settings, generated client, catalog and SOAP dispatch. It refuses overlapping output ownership, duplicate final paths, lost operation routes, and unsupported app/test/checked settings. A failed later service can leave earlier service artifacts, while the previously published aggregate spec/plugin pair remains intact.
|
|
331
|
+
|
|
332
|
+
The generated aggregate plugin exports `createClients`, `MultiServiceClientOptions`, `MultiServiceClients` and `openapi`. `createClients` requires exactly the service keys, each with its generated client's constructor options, including an explicit runtime `source`; register the plugin with `{clients}`. Prefixes come from each service's `openapi.basePath`, and the aggregate refuses runtime Fastify prefixes.
|
|
333
|
+
|
|
334
|
+
## composeOpenApiDocuments
|
|
335
|
+
|
|
336
|
+
Compose existing OpenAPI 3.1 documents without generating clients or routers:
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
interface OpenApiCompositionEntry {key: string; document: unknown}
|
|
340
|
+
interface OpenApiCompositionOptions {
|
|
341
|
+
title?: string;
|
|
342
|
+
version?: string;
|
|
343
|
+
description?: string;
|
|
344
|
+
servers?: readonly string[];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
declare function composeOpenApiDocuments(
|
|
348
|
+
entries: readonly OpenApiCompositionEntry[],
|
|
349
|
+
options?: OpenApiCompositionOptions,
|
|
350
|
+
): ComposedOpenApiDocument;
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Components become `serviceKey__ComponentName`, while operation IDs and tags become `serviceKey.originalName`. The merger rewrites supported reference-bearing positions, link operation targets, discriminator targets and security scheme names, preserving service-local security and server semantics. It also qualifies the known `x-wsdl-tsc-stream.itemSchema` reference so clients can discover the stream record contract.
|
|
354
|
+
|
|
355
|
+
Literal examples and unrelated extension payloads remain data. Duplicate paths, unresolved local references, relative external references and unsupported schema resource/anchor contexts are refused.
|
|
356
|
+
|
|
260
357
|
## Stream Configuration Helpers
|
|
261
358
|
|
|
262
359
|
These exports back the `--stream-config` CLI flag and are also usable directly in programmatic flows.
|
|
@@ -415,4 +512,25 @@ const streamOp = compiled.operations.find((op) => op.stream);
|
|
|
415
512
|
console.log(streamOp?.stream?.mediaType); // "application/x-ndjson" by default
|
|
416
513
|
```
|
|
417
514
|
|
|
418
|
-
|
|
515
|
+
### Generated stream client contract
|
|
516
|
+
|
|
517
|
+
Generated `operations.ts` exports `StreamOperationResponse<RecordType>` and `StreamCallOptions`; `client.ts` also re-exports `StreamCallOptions`. Each stream-configured operation accepts `(args, options?)` and returns `Promise<StreamOperationResponse<RecordType>>` with `records: AsyncIterable<RecordType>`:
|
|
518
|
+
|
|
519
|
+
```typescript
|
|
520
|
+
interface StreamCallOptions {
|
|
521
|
+
signal?: AbortSignal;
|
|
522
|
+
timeoutMs?: number;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
interface StreamOperationResponse<RecordType, HeadersType = Record<string, unknown>> {
|
|
526
|
+
records: AsyncIterable<RecordType>;
|
|
527
|
+
headers: HeadersType;
|
|
528
|
+
requestRaw?: string;
|
|
529
|
+
}
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
Records use the public legacy DTO mapping: flattened attributes, projected scalar values, typed simple content, XML lists and declared repeated-element arrays. Each record is mapped after its closing XML tag; the low-level parser still returns lexical values and attribute bags. Gateway wrapper flattening applies per record when enabled, and checked value shapes are unchanged.
|
|
533
|
+
|
|
534
|
+
Only stream-enabled generated clients add constructor `streamRequestOptions?: IExOptions` from `soap`. These HTTP options are separate from WSDL loading and support a verified HTTPS agent, HTTP timeout and signal; `options.httpClient` must implement `requestStream`, or the standard node-soap HTTP client is used with `options.request`. Stream calls honor the current endpoint override, static headers and supported `ISecurity` hooks; see [transport support and refusals](gateway-guide.md#streaming-transport-settings).
|
|
535
|
+
|
|
536
|
+
Per-call `timeoutMs` is a positive integer deadline for the upstream HTTP exchange and record consumption, starting after metadata initialization. A per-call signal already aborted rejects before metadata initialization. Exhaust or return the iterator to release transport resources; generated gateways connect downstream disconnects to that signal before waiting for SOAP headers and throughout delivery. Dates retain the existing type-level mapping, and `bigint` has no additional JSON encoding convention.
|
package/docs/checked-gateway.md
CHANGED
|
@@ -6,6 +6,8 @@ Generation offers legacy, the default, and opt-in checked components. Start with
|
|
|
6
6
|
|
|
7
7
|
The additive `checked-components-v1` mode uses the same command family and native owners for qualified structured operations, imported schema snapshots, attributes, recursive records, simple content and ordered values. It preserves the shipped direct runtime and legacy defaults. Source, mapping, artifact and transport checks remain authoritative; unsupported schema or security features refuse rather than disappearing from a successful service claim. This is a qualified component fragment, not universal XSD, streaming or provider acceptance.
|
|
8
8
|
|
|
9
|
+
The [bounded SOAP 1.1 RPC/encoded profile](supported-patterns.md#checked-soap-11-rpc-string-profile) adds source-owned scalar and flat Boolean record parts without document element roots. Component responses additionally accept exact Latin1 with encoding agreement. See the [NOAA qualification](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/docs/noaa-ndfd-qualification.md) for native restrictions, opaque string/reference results and separate owned-server/live evidence limits.
|
|
10
|
+
|
|
9
11
|
For a supported local WSDL or HTTP(S) root URL with one service/port/binding candidate, omit `--checked-config`. The planner selects all operations of that binding and derives supported mappings through the existing native owners. Local sources default to their containing directory; remote sources authorize their same-origin declared dependency graph. Canonical containment, redirect permission checks and native qualification still apply.
|
|
10
12
|
|
|
11
13
|
```bash
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
# Try opt-in checked generation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The 1.2.0 candidate offers opt-in WSDL-to-checked-gateway generation for supported document/literal SOAP 1.1 contracts and the bounded RPC/encoded string profile. Choose `pipeline --model checked-components-v1`; omitting `--model` keeps legacy generation. See the root [README](../README.md).
|
|
4
4
|
|
|
5
5
|
This is a bounded preview, not general WSDL/XSD or production-provider qualification. It adds source-backed request, response, fault and artifact checks for the supported fragment. Generation exposes legacy and components only; the shipped v1.1.5 direct runtime remains a compatibility binding for existing clients. See the [checked gateway reference](checked-gateway.md).
|
|
6
6
|
|
|
7
7
|
## Install and try the bundled contract
|
|
8
8
|
|
|
9
|
+
Version 1.2.0 is a release candidate until published. During candidate verification, install the locally packed 1.2.0 tarball instead of requesting an unpublished registry version. Earlier published previews retain their historical contracts.
|
|
10
|
+
|
|
9
11
|
Use Node.js 24 or newer. Run these commands in a new trial directory:
|
|
10
12
|
|
|
11
13
|
```powershell
|
|
12
14
|
npm init -y
|
|
13
|
-
npm install --save-dev @techspokes/typescript-wsdl-client@1.
|
|
15
|
+
npm install --save-dev @techspokes/typescript-wsdl-client@1.2.0
|
|
14
16
|
npm install soap
|
|
15
17
|
npx wsdl-tsc pipeline --model checked-components-v1 --wsdl-source node_modules/@techspokes/typescript-wsdl-client/docs/examples/checked-forecast.wsdl --client-dir .generated/forecast/client --openapi-file .generated/forecast/openapi.json --gateway-dir .generated/forecast/gateway --gateway-version-prefix v1 --gateway-service-name forecast --init-app --app-dir .generated/forecast --test-dir .generated/forecast/test --checked-report .generated/forecast-plan.json
|
|
16
18
|
```
|
|
@@ -69,7 +71,7 @@ Read the planning report before editing anything. Unsupported source, mapping, b
|
|
|
69
71
|
|
|
70
72
|
Checked planning refusals show the construct or source location, the reason and the next action, then exit nonzero without generating artifacts or invoking SOAP. Save the unchanged structured report with `--checked-report`; set the `DEBUG` environment variable to `wsdl-tsc` when you need the raw error, stack and report details.
|
|
71
73
|
|
|
72
|
-
For a locationless import, `--checked-draft` can write `service-resolution.json` containing a `REQUIRED_SCHEMA_LOCATION` placeholder. Replace that value with the actual permitted schema location, then rerun with `--checked-config service-resolution.json`.
|
|
74
|
+
For a locationless import whose referenced components are unavailable, `--checked-draft` can write `service-resolution.json` containing a `REQUIRED_SCHEMA_LOCATION` placeholder. Replace that value with the actual permitted schema location, then rerun with `--checked-config service-resolution.json`. Unused locationless imports need no fabricated schema; native qualification and reference resolution remain mandatory.
|
|
73
75
|
|
|
74
76
|
Multiple service/port/binding candidates require an explicit choice. Partial configuration and operation subsets are supported; see [selection and recovery details](checked-gateway.md#planning-and-missing-schema-recovery). Reports and drafts are preserved by default; use `--force-checked-files` deliberately to replace them on a later run.
|
|
75
77
|
|
|
@@ -133,7 +135,9 @@ The older `assessSchemaSource` API and `assess` command retain the narrow `check
|
|
|
133
135
|
|
|
134
136
|
The qualified component fragment includes imported schemas, nested/repeated and inherited records, attributes, simple content, ordered values and supported scalar restrictions. [Keyed mixed/namespace/open values](checked-gateway.md#mixed-namespaced-and-open-values) additionally preserve source-permitted wildcard data with native strict/lax/skip checks. Escapia qualification retains 15 Main operations and two Content operations against owned services. Content uses explicit companion configuration with scoped validation and buffered delivery; it is not automatic companion discovery or checked streaming.
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
The [bounded SOAP 1.1 RPC/encoded profile](supported-patterns.md#checked-soap-11-rpc-string-profile) supports typed scalar parts, native restrictions, one flat required Boolean record and one opaque string result. [NOAA qualification](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/docs/noaa-ndfd-qualification.md) covers all 12 operations against an owned server; ten live operations succeeded and two GML operations returned non-SOAP failures. There is no parsed DWML/GML or geographic correctness claim.
|
|
139
|
+
|
|
140
|
+
General XSD, SOAP 1.2, general RPC encoding, broader authentication/security, arbitrary wildcard conversion and checked incremental streaming remain outside this preview. OpenAPI describes the JSON shape but does not express every native scalar/order/wildcard rule. Required declarations and strict wildcard failures cannot become successful unchecked replies.
|
|
137
141
|
|
|
138
142
|
[#409](https://github.com/TechSpokes/typescript-wsdl-client/issues/409) supplies the bounded mixed/namespace/open mapping and its schema/serialization slice of [#410](https://github.com/TechSpokes/typescript-wsdl-client/issues/410). Representative unrelated contract qualification remains under [#397](https://github.com/TechSpokes/typescript-wsdl-client/issues/397); broader HTTP translation, source, scalar, group/naming, security and streaming work retains its existing owners. Legacy defaults and full-profile activation remain unchanged. See the [roadmap](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/ROADMAP.md) for direction and [development checkpoint](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/research/docs/content-model-development-checkpoint.md) for detailed evidence.
|
|
139
143
|
|
|
@@ -158,4 +162,6 @@ With generated defaults, omitted restrictions retain the generated choices; expl
|
|
|
158
162
|
|
|
159
163
|
Consumer-owned server/config/test files are preserved unless their existing `--force-init` or `--force-test` option is selected. Review customizations before deliberately refreshing older host scaffolds. Existing v1.1.5-issued direct clients continue using `checkedDirectRuntimeV1` unchanged; new generation uses components.
|
|
160
164
|
|
|
161
|
-
Legacy users need no model change.
|
|
165
|
+
Legacy users need no model change. Follow the [1.1.x-to-1.2.0 migration guide](migration.md#from-11x-to-120) for affected generated names, stream values, buffered conversion fixes and rollback. The preview reached npm in 1.1.8; the earlier 1.1.6/1.1.7 candidates were unpublished.
|
|
166
|
+
|
|
167
|
+
Checked hosts import `@techspokes/typescript-wsdl-client` at runtime. Retain it in production dependencies as emitted by the checked app manifest; do not omit it from a deployment that installs only production dependencies. Refresh separately maintained consumer package/lockfiles deliberately, and preserve adopted app/test customizations when regenerating.
|
package/docs/cli-reference.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# CLI Reference
|
|
2
2
|
|
|
3
|
+
Commands and configuration for generation and assessment. See the root [README](../README.md).
|
|
4
|
+
|
|
3
5
|
Generation offers legacy, the default, and opt-in `pipeline --model checked-components-v1`. Start with [Try Opt-in Checked Generation](checked-generation.md); the [checked gateway reference](checked-gateway.md) covers exact configuration and v1.1.5 runtime compatibility. Checked generation emits source-backed contracts rather than a legacy catalog and refuses unsupported compiler/streaming controls.
|
|
4
6
|
|
|
5
7
|
The `wsdl-tsc` tool generates TypeScript SOAP clients, OpenAPI specifications, and Fastify gateways from WSDL files.
|
|
@@ -44,6 +46,18 @@ Checked modes require all three explicit outputs: `--client-dir`, `--openapi-fil
|
|
|
44
46
|
|
|
45
47
|
Run the complete generation pipeline in one pass: WSDL parsing, TypeScript client, OpenAPI spec, Fastify gateway, and optional app. This is the recommended command for most use cases.
|
|
46
48
|
|
|
49
|
+
### Multi-service configuration
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx wsdl-tsc pipeline --services-config ./services.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`--services-config` selects native legacy composition and is exclusive with the single-source pipeline flags below. The JSON file contains `services: [{key, generation}]`, aggregate `openapi: {outFile}` and aggregate `gateway: {outDir}` settings. Each `generation` uses the programmatic `PipelineOptions` field names, including explicit `wsdl`, `catalogOut`, `clientOutDir`, `openapi.outFile`, `openapi.basePath`, `gateway.outDir`, `gateway.serviceSlug` and `gateway.versionSlug`.
|
|
56
|
+
|
|
57
|
+
Paths resolve relative to the configuration file. Service keys, normalized gateway service slugs, route prefixes and generated ownership paths must remain distinct; source WSDLs must stay outside generated outputs. The aggregate OpenAPI file must be JSON, and its generated discovery route defaults to `/openapi.json`; set aggregate `gateway.openapiPath` to `false` to disable it.
|
|
58
|
+
|
|
59
|
+
Keep compiler options, `streamConfigFile` or parsed `streamConfig`, and OpenAPI/gateway options inside the owning service entry. Runtime credentials and client sources belong to the generated `createClients` options, separate from generation configuration. Aggregate app/test scaffolding and checked composition are not supported in this mode; see the [complete configuration and runtime example](gateway-guide.md#multi-service-setup).
|
|
60
|
+
|
|
47
61
|
### Usage
|
|
48
62
|
|
|
49
63
|
```bash
|
|
@@ -56,11 +70,11 @@ npx wsdl-tsc pipeline \
|
|
|
56
70
|
[options]
|
|
57
71
|
```
|
|
58
72
|
|
|
59
|
-
### Required Flags
|
|
73
|
+
### Required Single-Source Flags
|
|
60
74
|
|
|
61
75
|
| Flag | Description |
|
|
62
76
|
|------|-------------|
|
|
63
|
-
| `--wsdl-source` |
|
|
77
|
+
| `--wsdl-source` | Required WSDL path or URL; `--catalog-file` selects the catalog output |
|
|
64
78
|
|
|
65
79
|
At least one of `--client-dir`, `--openapi-file`, or `--gateway-dir` must be provided.
|
|
66
80
|
|
|
@@ -162,7 +176,9 @@ Legacy tests need consumer test/runtime dependencies and use their emitted Vites
|
|
|
162
176
|
|
|
163
177
|
| Flag | Default | Description |
|
|
164
178
|
|------|---------|-------------|
|
|
165
|
-
| `--stream-config` | (none) | Path to a JSON stream-configuration file
|
|
179
|
+
| `--stream-config` | (none) | Path to a JSON stream-configuration file; selects operations for mapped record streaming |
|
|
180
|
+
|
|
181
|
+
Configured client methods return records through `AsyncIterable<RecordType>`; gateway routes serve NDJSON or JSON-array items, and OpenAPI carries `x-wsdl-tsc-stream` record metadata. Unselected operations retain the buffered API, while generated mapper/metadata output can still change across versions. See [1.2.0 migration](migration.md#from-11x-to-120) before regenerating.
|
|
166
182
|
|
|
167
183
|
`--stream-config` is accepted on the `compile`, `client`, and `pipeline` commands. It is not accepted on `openapi`, `gateway`, or `app` because those consume a pre-compiled `catalog.json` that already carries the normalized stream metadata.
|
|
168
184
|
|
|
@@ -281,7 +297,7 @@ npx wsdl-tsc client --catalog-file <path> --client-dir <path> [options]
|
|
|
281
297
|
|
|
282
298
|
| Flag | Description |
|
|
283
299
|
|------|-------------|
|
|
284
|
-
| `--wsdl-source` |
|
|
300
|
+
| `--wsdl-source` or `--catalog-file` | WSDL source or precompiled catalog input |
|
|
285
301
|
| `--client-dir` | Output directory for generated files |
|
|
286
302
|
|
|
287
303
|
Provide either `--wsdl-source` (compile from WSDL) or `--catalog-file` (use pre-compiled catalog). When using `--wsdl-source`, the catalog is auto-generated in the client directory unless overridden with `--catalog-file`.
|
|
@@ -360,7 +376,7 @@ These flags are mutually exclusive.
|
|
|
360
376
|
|
|
361
377
|
### Response Envelope
|
|
362
378
|
|
|
363
|
-
|
|
379
|
+
Buffered legacy success responses use the standard envelope. Legacy streams emit NDJSON or a JSON array directly; checked component routes use checked values/faults. Errors after stream commitment truncate output.
|
|
364
380
|
|
|
365
381
|
Base structure:
|
|
366
382
|
|
|
@@ -467,6 +483,8 @@ Format: `urn:services:{serviceSlug}:{versionSlug}:schemas:{models|operations}:{s
|
|
|
467
483
|
|
|
468
484
|
### Contract Assumptions
|
|
469
485
|
|
|
486
|
+
These assumptions apply to buffered legacy gateway inputs. Stream response bodies and checked component schemas follow their separate contracts.
|
|
487
|
+
|
|
470
488
|
- All request/response bodies must use `$ref` to `components.schemas`
|
|
471
489
|
- Every operation must have a default response with `application/json`
|
|
472
490
|
- All referenced schemas must exist in `components.schemas`
|
|
@@ -587,6 +605,8 @@ npx wsdl-tsc compile --wsdl-source <file|url> --catalog-file <path> [options]
|
|
|
587
605
|
|
|
588
606
|
### Compiler Flags
|
|
589
607
|
|
|
608
|
+
The shared [client/compiler flag table](#client-flags) documents import extensions, naming, scalar policies, unresolved references and optionality. `compile --help` lists the complete current surface, including stream configuration.
|
|
609
|
+
|
|
590
610
|
| Flag | Default | Description |
|
|
591
611
|
|------|---------|-------------|
|
|
592
612
|
| `--client-choice-mode` | `all-optional` | Controls `xs:choice` modeling |
|
package/docs/concepts.md
CHANGED
|
@@ -312,8 +312,7 @@ OpenAPI uses operation docs for both `description` and default `summary` values.
|
|
|
312
312
|
|
|
313
313
|
## Response Envelope
|
|
314
314
|
|
|
315
|
-
|
|
316
|
-
always-on since v0.7.1.
|
|
315
|
+
Buffered legacy gateway responses use this envelope. Stream success bodies deliver records directly, and checked components use their separate value/fault contract.
|
|
317
316
|
|
|
318
317
|
### Success Response
|
|
319
318
|
|
|
@@ -367,7 +366,7 @@ details:
|
|
|
367
366
|
|
|
368
367
|
### Streaming Bypass
|
|
369
368
|
|
|
370
|
-
|
|
369
|
+
Legacy stream operations bypass the success envelope. OpenAPI declares the configured media type, and the gateway writes NDJSON lines or one JSON array. Errors handled before response commitment can use the normal error envelope; after commitment, failures truncate output. See [streaming handlers](gateway-guide.md#streaming-handlers).
|
|
371
370
|
|
|
372
371
|
### Envelope Naming
|
|
373
372
|
|
|
@@ -497,13 +496,13 @@ The generator produces two response execution models. Buffered is the default an
|
|
|
497
496
|
|
|
498
497
|
### Execution Model Contrast
|
|
499
498
|
|
|
500
|
-
Buffered operations call `node-soap`, wait for the full response to materialize, and return `{ response, headers, responseRaw, requestRaw }`. Streaming operations
|
|
499
|
+
Buffered operations call `node-soap`, wait for the full response to materialize, and return `{ response, headers, responseRaw, requestRaw }`. Streaming operations use node-soap's WSDL serializer and public HTTP `requestStream` transport, returning `StreamOperationResponse<RecordType>` with `records: AsyncIterable<RecordType>`. The SAX parser walks `recordPath`; each completed record passes through `fromSoapResult` to produce the generated DTO, including flat attributes and typed `$value` content.
|
|
501
500
|
|
|
502
501
|
The catalog is the source of truth for stream metadata. Each opted-in operation carries an `OperationStreamMetadata` entry, and downstream emitters (client, OpenAPI, gateway, tests) all read from the catalog. OpenAPI carries a derived view via the `x-wsdl-tsc-stream` extension.
|
|
503
502
|
|
|
504
503
|
### Terminal-Error Policy
|
|
505
504
|
|
|
506
|
-
|
|
505
|
+
Failures before response commitment can use the normal gateway error handler. After commitment, failures truncate output; an incomplete HTTP response or JSON document is a failed stream. See the [Production Guide](production.md#terminal-error-policy).
|
|
507
506
|
|
|
508
507
|
## Companion Catalogs and Shape Resolution
|
|
509
508
|
|
package/docs/configuration.md
CHANGED
|
@@ -102,8 +102,7 @@ Per-operation overrides for method, summary, description, and deprecation.
|
|
|
102
102
|
## Stream Configuration
|
|
103
103
|
|
|
104
104
|
The `--stream-config <file>` flag (available on `compile`, `client`, `pipeline`)
|
|
105
|
-
opts selected WSDL operations into streaming.
|
|
106
|
-
operations not listed in the file.
|
|
105
|
+
opts selected WSDL operations into streaming. Unlisted operations retain their buffered API selection; 1.2.0 can still change generated mapper and metadata output.
|
|
107
106
|
|
|
108
107
|
```json
|
|
109
108
|
{
|
|
@@ -140,7 +139,15 @@ operations not listed in the file.
|
|
|
140
139
|
See [ADR-002](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/docs/decisions/002-streamable-responses.md) for rationale and the
|
|
141
140
|
terminal-error policy.
|
|
142
141
|
|
|
143
|
-
##
|
|
142
|
+
## Multi-service configuration
|
|
143
|
+
|
|
144
|
+
Use `pipeline --services-config services.json` exclusively, without single-source CLI flags. Each `services[].generation` uses programmatic `PipelineOptions` names, not CLI flag names. The canonical schema/example and typed runtime registry are in [Multi-Service Setup](gateway-guide.md#multi-service-setup).
|
|
145
|
+
|
|
146
|
+
Paths in the services file resolve relative to that file; companion paths inside `streamConfigFile` resolve relative to the stream file. Programmatic `streamConfig` requires normalized metadata from `parseStreamConfig`, whereas raw JSON uses `recordType` and `shapeCatalog`. Do not interchange those shapes.
|
|
147
|
+
|
|
148
|
+
Use unique lowercase service keys, normalized service slugs, decorators and static base paths, with explicit disjoint output ownership. Aggregate output is JSON only; `gateway.openapiPath` selects discovery or disables it with `false`. Bind runtime WSDL sources and security separately for every client. Checked services and aggregate app/test scaffolding are refused.
|
|
149
|
+
|
|
150
|
+
## Example configuration files
|
|
144
151
|
|
|
145
152
|
Example configuration files are available in the `examples/config/` directory:
|
|
146
153
|
|
package/docs/corpus.md
CHANGED
|
@@ -8,7 +8,7 @@ This table is generated from `test/conformance/readiness-corpus.json`; its sourc
|
|
|
8
8
|
|
|
9
9
|
| Input | Provenance tier | Mode | Expected result | Evidence stages | Executable evidence |
|
|
10
10
|
|---|---|---|---|---|---|
|
|
11
|
-
| [noaa-ndfd](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/fixtures/wsdl/real-services/noaa-ndfd/ndfd-xml.wsdl) | real | checked |
|
|
11
|
+
| [noaa-ndfd](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/fixtures/wsdl/real-services/noaa-ndfd/ndfd-xml.wsdl) | real | checked | partial | original source decoding and 12-operation inventory, all 12 operations native planning and generation, installed build and every generated HTTP route, owned typed SOAP 1.1 RPC with native restrictions and 73-field Boolean record, exact Latin1 responses and offline provider replay; zero provider calls in tests | [noaa-ndfd-qualification.test.ts](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/integration/noaa-ndfd-qualification.test.ts), [checked-gateway-installed.test.ts](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/integration/checked-gateway-installed.test.ts) |
|
|
12
12
|
| [weather](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/examples/minimal/weather.wsdl) | synthetic | legacy | supported | generate, typecheck, OpenAPI, gateway mock, installed package | [gateway-routes.test.ts](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/integration/gateway-routes.test.ts); `npm run package:smoke` |
|
|
13
13
|
| [checked-forecast](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/conformance/fixtures/assessment/forecast.wsdl) | synthetic | checked | supported | generate, install, typecheck, HTTP/SOAP success and faults | [checked-gateway-installed.test.ts](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/integration/checked-gateway-installed.test.ts) |
|
|
14
14
|
| [application-groups](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/conformance/fixtures/assessment/application-groups.wsdl) | synthetic | checked | supported | generate, native SOAP, OpenAPI, installed HTTP/SOAP variant | [checked-application-groups.test.ts](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/integration/checked-application-groups.test.ts), [checked-gateway-installed.test.ts](https://github.com/TechSpokes/typescript-wsdl-client/blob/main/test/integration/checked-gateway-installed.test.ts) |
|