@techspokes/typescript-wsdl-client 1.1.0 → 1.1.2

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 CHANGED
@@ -228,6 +228,8 @@ See [CLI Reference](docs/cli-reference.md) for all flags and examples.
228
228
  | [Production Guide](docs/production.md) | CI/CD, validation, logging |
229
229
  | [Troubleshooting](docs/troubleshooting.md) | Common issues and debugging |
230
230
  | [Release Notes](docs/releases/README.md) | Per-version GitHub release notes used by the draft release workflow |
231
+ | [v1.1.2 Release Notes](docs/releases/v1.1.2.md) | Sequence occurrence bounds and singleton SOAP response normalization |
232
+ | [v1.1.1 Release Notes](docs/releases/v1.1.1.md) | Wrapping sequence occurrence bounds and generated array contracts |
231
233
  | [v1.1.0 Release Notes](docs/releases/v1.1.0.md) | Automatic generated TypeScript preambles and consumer lint guidance |
232
234
 
233
235
  ### Extend
@@ -529,7 +529,7 @@ function generatePackageJson(appDir, force) {
529
529
  fastify: "^5.12.5",
530
530
  "fastify-plugin": "^6.0.0",
531
531
  saxes: "^6.0.0",
532
- soap: "^1.13.0",
532
+ soap: "^1.13.1",
533
533
  },
534
534
  devDependencies: {
535
535
  "@types/node": "^26.6.2",
@@ -1 +1 @@
1
- {"version":3,"file":"generateClient.d.ts","sourceRoot":"","sources":["../../src/client/generateClient.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAKnE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,QA8ZxE"}
1
+ {"version":3,"file":"generateClient.d.ts","sourceRoot":"","sources":["../../src/client/generateClient.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAKnE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,QAkaxE"}
@@ -180,6 +180,7 @@ export type ${clientName}Response<ResponseType, HeadersType = Record<string, unk
180
180
  * @property dataTypes - Metadata for data types used in serialization/deserialization.
181
181
  * @property dataTypes.Attributes - Maps type names to lists of property names that should be treated as XML attributes.
182
182
  * @property dataTypes.ChildrenTypes - Maps type names to their child element types for recursive processing.
183
+ * @property dataTypes.RepeatedElements - Identifies child properties that must retain their array shape for singleton responses.
183
184
  *
184
185
  *
185
186
  * @note Have fun with the generated client! If TechSpokes made your day (or a week),
@@ -402,6 +403,7 @@ ${methodsBody}
402
403
 
403
404
  // Get child type mapping for recursive processing with correct types
404
405
  const childrenTypes: Readonly<Record<string, string>> = (typeName && this.dataTypes?.ChildrenTypes?.[typeName]) || {};
406
+ const repeatedElements: readonly string[] = (typeName && this.dataTypes?.RepeatedElements?.[typeName]) || [];
405
407
  const result: any = {};
406
408
 
407
409
  // Preserve text content for mixed XML elements
@@ -425,9 +427,11 @@ ${methodsBody}
425
427
  }
426
428
  // Recursively convert child elements with their specific type info
427
429
  const childType: string | undefined = childrenTypes[k];
428
- result[k] = Array.isArray(v)
429
- ? v.map(node => this.fromSoapResult(node, childType))
430
- : this.fromSoapResult(v, childType);
430
+ // node-soap can return a scalar when repetition is declared on a wrapping sequence (#141).
431
+ const value = v != null && !Array.isArray(v) && repeatedElements.includes(k) ? [v] : v;
432
+ result[k] = Array.isArray(value)
433
+ ? value.map(node => this.fromSoapResult(node, childType))
434
+ : this.fromSoapResult(value, childType);
431
435
  }
432
436
 
433
437
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"generateUtils.d.ts","sourceRoot":"","sources":["../../src/client/generateUtils.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAGnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,QA4BvE"}
1
+ {"version":3,"file":"generateUtils.d.ts","sourceRoot":"","sources":["../../src/client/generateUtils.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAGnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,QAuCvE"}
@@ -41,7 +41,14 @@ export function generateUtils(outFile, compiled) {
41
41
  if (typeof attrSpec !== "object" || typeof childType !== "object") {
42
42
  throw new Error("Invalid metadata structure. Expected objects for Attributes and ChildrenTypes.");
43
43
  }
44
- const metas = JSON.stringify({ Attributes: attrSpec, ChildrenTypes: childType }, null, 2);
44
+ const repeatedElements = Object.fromEntries(Object.entries(compiled.meta.propMeta ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([typeName, properties]) => [
45
+ typeName,
46
+ Object.keys(properties).filter(name => {
47
+ const max = properties[name]?.max;
48
+ return max === "unbounded" || (typeof max === "number" && max > 1);
49
+ }).sort(),
50
+ ]));
51
+ const metas = JSON.stringify({ Attributes: attrSpec, ChildrenTypes: childType, RepeatedElements: repeatedElements }, null, 2);
45
52
  const dataTypes = `/**
46
53
  * ${clientName} WSDL data types for proper serialization/deserialization.
47
54
  * Used to distinguish between XML attributes and elements during conversion.
@@ -51,6 +58,8 @@ export interface ${clientName}DataTypes {
51
58
  Attributes: Record<string, readonly string[]>;
52
59
  /** Maps type names to their child element types for recursive processing */
53
60
  ChildrenTypes: Record<string, Readonly<Record<string, string>>>;
61
+ /** Maps type names to repeated child properties; optional for custom metadata compatibility. */
62
+ RepeatedElements?: Record<string, readonly string[]>;
54
63
  }
55
64
 
56
65
  export const ${clientConstant}_DATA_TYPES: ${clientName}DataTypes = ${metas} as const;\n`;
@@ -1 +1 @@
1
- {"version":3,"file":"schemaCompiler.d.ts","sourceRoot":"","sources":["../../src/compiler/schemaCompiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAU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B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACjD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAClD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;KAC/C,CAAC;IACF,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC,CAAC;AAqPF;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,eAAe,EACxB,YAAY,CAAC,EAAE,YAAY,GAC1B,eAAe,CAyiCjB"}
@@ -596,18 +596,29 @@ export function compileCatalog(cat, options, streamConfig) {
596
596
  };
597
597
  const collectParticles = (ownerTypeName, node) => {
598
598
  const out = [];
599
- // process a compositor or element container recursively
600
- const recurse = (groupNode) => {
601
- // handle direct element children
599
+ const one = { min: 1, max: 1 };
600
+ const combine = (a, b) => ({
601
+ min: a.min * b.min,
602
+ max: a.max === "unbounded" || b.max === "unbounded" ? "unbounded" : a.max * b.max,
603
+ });
604
+ const recurse = (groupNode, inherited = one, inheritSequenceOccurs = true) => {
602
605
  for (const e of getChildrenWithLocalName(groupNode, "element")) {
603
606
  const particle = compileElementParticle(ownerTypeName, e);
604
- if (particle)
605
- out.push(particle);
607
+ if (!particle)
608
+ continue;
609
+ // @constraints Preserve disabled particles until the content model can represent their absence (#145).
610
+ out.push(particle.max === 0 ? particle : { ...particle, ...combine(inherited, particle) });
606
611
  }
607
- // recurse into nested compositor groups
608
612
  for (const comp of ["sequence", "all", "choice"]) {
609
613
  for (const sub of getChildrenWithLocalName(groupNode, comp)) {
610
- recurse(sub);
614
+ const own = readOccurrence(sub);
615
+ if (inheritSequenceOccurs && comp === "sequence" && own.max !== 0) {
616
+ recurse(sub, combine(inherited, own), true);
617
+ }
618
+ else {
619
+ // @constraints Choice, all, and disabled subtrees keep their previous flattened bounds (#145).
620
+ recurse(sub, one, false);
621
+ }
611
622
  }
612
623
  }
613
624
  };
@@ -59,11 +59,19 @@ When an abandoned major or minor candidate contains the complete launch narrativ
59
59
 
60
60
  The supported release path keeps final-form tags immutable:
61
61
 
62
- 1. Run release preflight on the final uncommitted tree.
63
- 2. Commit the exact validated tree and create `vX.Y.Z`.
64
- 3. Push the branch and tag so the draft workflow creates the release and skill asset.
65
- 4. Review and publish the unmarked draft through GitHub's Release page.
66
- 5. Let the guarded package workflow publish to npmjs with provenance.
62
+ 1. Prepare versions, changelog, release notes, and the documentation index before pushing the release PR.
63
+ 2. Run release preflight on the final uncommitted tree and commit that exact validated tree.
64
+ 3. Push the PR and require Node 24 and Node 26 checks on its final head before merging.
65
+ 4. Verify the merged main tree matches the validated tree and require CI on the merged commit.
66
+ 5. Tag the validated merged main commit and push the tag to start the draft workflow.
67
+ 6. Verify the draft, release notes, uploaded skill ZIP, checksum manifest, and artifact verification results.
68
+ 7. Clean up task-owned merged branches and temporary outputs, then hand the draft to the maintainer.
69
+ 8. The maintainer reviews the draft in their own browser and clicks Publish.
70
+ 9. The guarded package workflow publishes to npmjs with provenance.
71
+
72
+ The agent stops after draft verification and cleanup. Agents must never access GitHub through a browser, publish a release, or dispatch package publication. Use authenticated git and GitHub CLI commands for preparation and verification. Preserve unrelated work, contributor-owned branches, immutable release tags, and abandonment markers during cleanup.
73
+
74
+ If the merged tree differs from the preflight-validated tree, stop before tagging and prepare a newly validated candidate. Do not rerun preflight for an unchanged validated tree.
67
75
 
68
76
  Manual package dispatch is a recovery path after the GitHub Release is published. It enforces the same tag, marker, reachability, draft, and prerelease checks.
69
77
 
@@ -0,0 +1,44 @@
1
+ # TypeScript WSDL Client v1.1.1
2
+
3
+ ## Correct array types from wrapping sequences
4
+
5
+ This patch preserves occurrence bounds declared on wrapping `xs:sequence` nodes when generating element types. See the [project overview](../../README.md) for the generation pipeline.
6
+
7
+ ## What This Improves
8
+
9
+ A sequence with `maxOccurs="2"` around an address element now generates `address: AddressType[]` instead of a scalar address. Sequences with `minOccurs="0"` and repeated bounds generate optional arrays, including finite limits and `unbounded`.
10
+
11
+ The corrected catalog metadata flows into client types, OpenAPI schemas, and gateway responses. Consumer fixtures verify that both addresses survive the existing array-wrapper flattening behavior.
12
+
13
+ ## Highlights
14
+
15
+ - Preserve occurrence bounds through uninterrupted sequence ancestry, including nested sequences.
16
+ - Verify required and optional arrays in generated TypeScript and OpenAPI schemas.
17
+ - Preserve repeated response items through gateway wrapper flattening.
18
+ - Check the regression through the installed package CLI and consumer TypeScript compilation.
19
+ - Refresh the soap runtime and generated app floor to 1.13.1 and Vitest tooling to 5.0.2.
20
+
21
+ ## Upgrade Notes
22
+
23
+ Update the package and regenerate your clients, OpenAPI specifications, and gateways from their WSDL sources. Review the generated diff: affected scalar properties become arrays, and properties inside optional sequences can become optional. Adapt consuming code to these corrected types.
24
+
25
+ Corrected array metadata can activate existing OpenAPI wrapper flattening, changing an affected REST object wrapper into an array. Review REST payload schemas and consumers when regenerating gateways; existing wrapper-flattening options retain their meanings.
26
+
27
+ This patch preserves the previous behavior across `xs:choice`, `xs:all`, zero-maximum sequence subtrees, disabled elements, and wildcards. It adds no finite-array-length or sequence-order runtime enforcement, CLI options, or catalog fields. See [supported patterns](../supported-patterns.md#fully-supported) for the compatibility boundary.
28
+
29
+ ## Validation
30
+
31
+ - Focused occurrence and unchanged choice-mode regression tests passed.
32
+ - Full CI, generated-artifact conformance, and pipeline smoke validation passed.
33
+ - Installed package generation and consumer TypeScript checks passed, including rejection of scalar addresses.
34
+ - NPM package contents were validated.
35
+ - The agent skill artifact was validated and packaged with its checksum manifest.
36
+ - Release preflight passed against the target tag.
37
+
38
+ ## Notes
39
+
40
+ Release tag: `v1.1.1`.
41
+
42
+ This candidate was abandoned before publication. Singleton SOAP responses could remain scalar and fail gateway serialization despite generated array contracts. The immutable tag and abandonment marker retain its release identity.
43
+
44
+ Fixes [issue #141](https://github.com/TechSpokes/typescript-wsdl-client/issues/141) through [PR #145](https://github.com/TechSpokes/typescript-wsdl-client/pull/145). Thanks to [BCsabaEngine](https://github.com/BCsabaEngine) for the original diagnosis and contribution.
@@ -0,0 +1,42 @@
1
+ # TypeScript WSDL Client v1.1.2
2
+
3
+ ## Consistent arrays from wrapping sequences
4
+
5
+ This patch corrects generated array contracts and singleton SOAP response conversion for wrapping sequences. See the [project overview](../../README.md) for the generation pipeline.
6
+
7
+ ## What This Improves
8
+
9
+ An element inside a repeated `xs:sequence` now receives the sequence's occurrence bounds in the compiled catalog and generated types. A single returned address becomes a one-element array, and multiple addresses retain their order. Generated REST gateways can serialize both responses successfully.
10
+
11
+ The generated client uses existing catalog metadata to normalize repeated properties, so direct client consumers receive the same correction as gateways. Optional properties remain absent when omitted, and existing null handling is preserved.
12
+
13
+ ## Highlights
14
+
15
+ - Propagate occurrence bounds through uninterrupted sequences, including nested sequences.
16
+ - Normalize singleton primitive and complex responses to their declared array shape.
17
+ - Preserve inherited and aliased type metadata during response conversion.
18
+ - Verify real SOAP responses with REST wrapper flattening enabled and disabled.
19
+ - Exercise the correction through an installed package and its generated client.
20
+
21
+ ## Upgrade Notes
22
+
23
+ Update the package and regenerate clients, OpenAPI specifications, and gateways. Review affected scalar properties that become arrays and required properties that become optional. Corrected array metadata can also activate existing REST wrapper flattening, changing an object wrapper into an array.
24
+
25
+ This release retains previous sequence-boundary handling for `xs:choice`, `xs:all`, zero-maximum sequences, disabled elements, and wildcards. It adds no finite-array-length or sequence-order validation and no CLI options or catalog fields. The generated metadata interface adds an optional `RepeatedElements` map; custom metadata without that map retains its previous behavior.
26
+
27
+ Version 1.1.1 was abandoned before publication. This release includes its sequence compiler correction and dependency maintenance, together with the runtime correction discovered during final review.
28
+
29
+ ## Validation
30
+
31
+ - Real SOAP transport tests cover singleton and repeated responses and optional request omission.
32
+ - Generated client and gateway tests cover both REST wrapper representations.
33
+ - Full CI, conformance, and pipeline smoke validation passed.
34
+ - Installed package generation, TypeScript contracts, and SOAP response conversion passed.
35
+ - NPM package contents and the agent skill artifact were validated.
36
+ - Release preflight passed against the target tag.
37
+
38
+ ## Notes
39
+
40
+ Release tag: `v1.1.2`.
41
+
42
+ The sequence compiler correction originated in [PR #145](https://github.com/TechSpokes/typescript-wsdl-client/pull/145) for [issue #141](https://github.com/TechSpokes/typescript-wsdl-client/issues/141). Thanks to [BCsabaEngine](https://github.com/BCsabaEngine) for the original diagnosis and contribution.
@@ -9,6 +9,7 @@ The rows below are backed by committed conformance fixtures under `test/conforma
9
9
  <!-- support-matrix:start -->
10
10
  | Capability ID | Status | Public contract |
11
11
  |---|---|---|
12
+ | `sequence-occurrence-wrappers` | supported | Wrapping sequences with nonzero maxima propagate element bounds and optionality without crossing choice or all boundaries. |
12
13
  | `weather-document-literal-soap` | supported | The canonical weather WSDL compiles through client, OpenAPI, gateway, generated-test, and app artifacts with document-literal SOAP operations. |
13
14
  | `sequence-baseline-complex` | supported | Complex type sequences support nested complex references, repeated elements, optional fields, and all-optional request wrappers. |
14
15
  | `simple-restriction-list` | supported | Named simple type restrictions, enumerations, and `xs:list` declarations emit aligned TypeScript aliases and OpenAPI schemas. |
@@ -32,6 +33,10 @@ The rows below are backed by committed conformance fixtures under `test/conforma
32
33
 
33
34
  These patterns are handled end-to-end: WSDL parsing, TypeScript type generation, OpenAPI schema output, and gateway code generation.
34
35
 
36
+ Wrapping sequence bounds propagate through uninterrupted sequence ancestry to element array types and optionality. Traversal through `xs:choice`, `xs:all`, or a sequence with `maxOccurs="0"` retains the previous flattened behavior; wildcard and disabled-element handling are unchanged. This does not enforce sequence ordering or finite array lengths at runtime.
37
+
38
+ Generated clients normalize present, non-null singleton responses into arrays for repeated element properties. Real SOAP transport regressions cover singleton and multiple items, omitted optional request fields, and gateway serialization with wrapper flattening enabled and disabled. Regenerate clients to receive this runtime correction; omitted optional response properties remain absent.
39
+
35
40
  - Complex types with `<xs:sequence>`, `<xs:all>`, and `<xs:choice>` compositors, including recursive nesting
36
41
  - Simple content with attributes using the `$value` pattern to preserve text content alongside attribute properties
37
42
  - Named simple type restrictions and enumerations emitted as TypeScript aliases and OpenAPI scalar schemas
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techspokes/typescript-wsdl-client",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
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",
@@ -116,14 +116,14 @@
116
116
  "tsx": "^4.23.15",
117
117
  "typescript": "^6.0.3",
118
118
  "typescript-eslint": "^8.70.1",
119
- "vitest": "^5.0.1"
119
+ "vitest": "^5.0.2"
120
120
  },
121
121
  "dependencies": {
122
122
  "@apidevtools/swagger-parser": "^13.1.0",
123
123
  "fast-xml-parser": "^5.11.1",
124
124
  "js-yaml": "^5.4.2",
125
125
  "saxes": "^6.0.0",
126
- "soap": "^1.13.0",
126
+ "soap": "^1.13.1",
127
127
  "yargs": "^18.2.0"
128
128
  },
129
129
  "funding": {