@techspokes/typescript-wsdl-client 1.1.3 → 1.1.4
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,7 @@ 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.4 Release Notes](docs/releases/v1.1.4.md) | Named SOAP imports and compiled-client coverage on Node 24 and 26 |
|
|
231
232
|
| [v1.1.3 Release Notes](docs/releases/v1.1.3.md) | Dependency security updates and Node 24 development alignment |
|
|
232
233
|
| [v1.1.2 Release Notes](docs/releases/v1.1.2.md) | Sequence occurrence bounds and singleton SOAP response normalization |
|
|
233
234
|
| [v1.1.1 Release Notes](docs/releases/v1.1.1.md) | Wrapping sequence occurrence bounds and generated array contracts |
|
|
@@ -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,
|
|
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,QA+axE"}
|
|
@@ -56,6 +56,16 @@ export function generateClient(outFile, compiled) {
|
|
|
56
56
|
// get the class name for the client
|
|
57
57
|
const clientName = deriveClientName(compiled);
|
|
58
58
|
const clientConstant = pascalToSnakeCase(clientName).toUpperCase();
|
|
59
|
+
// Explicit client-name overrides can match a SOAP export. Alias only that
|
|
60
|
+
// import so the generated class keeps its public name.
|
|
61
|
+
const soapImport = (name) => {
|
|
62
|
+
const local = name === clientName ? `Soap${pascal(name)}` : name;
|
|
63
|
+
return { local, specifier: local === name ? name : `${name} as ${local}` };
|
|
64
|
+
};
|
|
65
|
+
const soapClient = soapImport("Client");
|
|
66
|
+
const soapOptions = soapImport("IOptions");
|
|
67
|
+
const soapSecurity = soapImport("ISecurity");
|
|
68
|
+
const soapFactory = soapImport("createClientAsync");
|
|
59
69
|
// Track whether any operation opts into streaming, so we can emit the
|
|
60
70
|
// supporting runtime helpers only when they're actually used.
|
|
61
71
|
let anyStream = false;
|
|
@@ -133,7 +143,9 @@ export function generateClient(outFile, compiled) {
|
|
|
133
143
|
// *.tpl file so the IDE does not try to parse their content as code nested
|
|
134
144
|
// inside this template literal (which would flag `this`, `await`, `yield`
|
|
135
145
|
// outside-of-function false positives).
|
|
136
|
-
const streamMethodsBlock = anyStream
|
|
146
|
+
const streamMethodsBlock = anyStream
|
|
147
|
+
? "\n" + loadRuntimeSource("clientStreamMethods.tpl.txt").replace("__SOAP_CLIENT_TYPE__", soapClient.local)
|
|
148
|
+
: "";
|
|
137
149
|
// noinspection JSFileReferences,JSUnresolvedReference,CommaExpressionJS,JSDuplicatedDeclaration,ReservedWordAsName,JSCommentMatchesSignature,JSValidateTypes,JSIgnoredPromiseFromCall,BadExpressionStatementJS,ES6UnusedImports,JSUnnecessarySemicolon,UnreachableCodeJS,JSUnusedLocalSymbols
|
|
138
150
|
const classTemplate = `// noinspection JSAnnotator
|
|
139
151
|
|
|
@@ -141,7 +153,8 @@ export function generateClient(outFile, compiled) {
|
|
|
141
153
|
* Generated ${clientName} client class.
|
|
142
154
|
* This class wraps the node-soap client and provides strongly-typed methods for each operation.
|
|
143
155
|
*/
|
|
144
|
-
import
|
|
156
|
+
import {${soapFactory.specifier}} from "soap";
|
|
157
|
+
import type {${soapClient.specifier}, ${soapOptions.specifier}, ${soapSecurity.specifier}} from "soap";
|
|
145
158
|
import type * as T from "./types${suffix}";
|
|
146
159
|
import type {${clientName}DataTypes} from "./utils${suffix}";
|
|
147
160
|
import {${clientConstant}_DATA_TYPES} from "./utils${suffix}";${anyStream ? `
|
|
@@ -195,11 +208,11 @@ export type ${clientName}Response<ResponseType, HeadersType = Record<string, unk
|
|
|
195
208
|
*/
|
|
196
209
|
export class ${clientName} {
|
|
197
210
|
protected source: string;
|
|
198
|
-
protected options?:
|
|
199
|
-
protected security?:
|
|
211
|
+
protected options?: ${soapOptions.local};
|
|
212
|
+
protected security?: ${soapSecurity.local};
|
|
200
213
|
protected attributesKeyIn: string;
|
|
201
214
|
protected attributesKeyOut: string;
|
|
202
|
-
protected client?:
|
|
215
|
+
protected client?: ${soapClient.local};
|
|
203
216
|
protected dataTypes: ${clientName}DataTypes = ${clientConstant}_DATA_TYPES;
|
|
204
217
|
|
|
205
218
|
/**
|
|
@@ -214,8 +227,8 @@ export class ${clientName} {
|
|
|
214
227
|
*/
|
|
215
228
|
constructor(options: {
|
|
216
229
|
source: string,
|
|
217
|
-
options?:
|
|
218
|
-
security?:
|
|
230
|
+
options?: ${soapOptions.local},
|
|
231
|
+
security?: ${soapSecurity.local},
|
|
219
232
|
attributesKeyIn?: string,
|
|
220
233
|
attributesKeyOut?: string
|
|
221
234
|
}) {
|
|
@@ -237,7 +250,7 @@ export class ${clientName} {
|
|
|
237
250
|
* @returns The initialized SOAP client instance.
|
|
238
251
|
* @throws Error if the WSDL source is invalid or client creation fails.
|
|
239
252
|
*/
|
|
240
|
-
async soapClient(): Promise
|
|
253
|
+
async soapClient(): Promise<${soapClient.local}> {
|
|
241
254
|
// If client is not initialized or has no WSDL source, create a new one
|
|
242
255
|
if (!this.client || !this.client.wsdl) {
|
|
243
256
|
// Note: source can be a URL or a local WSDL file path
|
|
@@ -246,7 +259,7 @@ export class ${clientName} {
|
|
|
246
259
|
}
|
|
247
260
|
try {
|
|
248
261
|
// Create the SOAP client using the provided source and options
|
|
249
|
-
this.client = await
|
|
262
|
+
this.client = await ${soapFactory.local}(this.source, this.options || {});
|
|
250
263
|
if (this.security) {
|
|
251
264
|
this.client.setSecurity(this.security);
|
|
252
265
|
}
|
package/docs/generated-code.md
CHANGED
|
@@ -106,6 +106,10 @@ See ESLint's [ignore documentation](https://eslint.org/docs/latest/use/configure
|
|
|
106
106
|
|
|
107
107
|
## Client Construction
|
|
108
108
|
|
|
109
|
+
Generated clients import `createClientAsync` from `soap` at runtime and use type-only imports for `Client`,
|
|
110
|
+
`IOptions`, and `ISecurity`. Imports are aliased when a generated client class uses the same name.
|
|
111
|
+
Type-only imports are erased from JavaScript; install `soap` as a runtime dependency for the client factory.
|
|
112
|
+
|
|
109
113
|
```typescript
|
|
110
114
|
import soap from "soap";
|
|
111
115
|
import { Weather } from "./src/services/weather/client.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# TypeScript WSDL Client v1.1.4
|
|
2
|
+
|
|
3
|
+
## Explicit SOAP imports in generated clients
|
|
4
|
+
|
|
5
|
+
This patch replaces generated SOAP namespace imports with named runtime imports and explicit type-only imports. See the [project overview](../../README.md) for the generation pipeline.
|
|
6
|
+
|
|
7
|
+
## What This Improves
|
|
8
|
+
|
|
9
|
+
Generated clients compile with strict NodeNext and verbatim module syntax while importing only the SOAP runtime function they use. Custom client names that match SOAP exports receive local aliases, so client generation stays valid for names such as `Client`, `IOptions`, `ISecurity`, and `createClientAsync`.
|
|
10
|
+
|
|
11
|
+
Buffered and streamed clients retain their existing behavior. Integration tests now have a dedicated typecheck, and both Node 24 and Node 26 CI exercise compiled generated clients.
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- Generate a named `createClientAsync` import and type-only `Client`, `IOptions`, and `ISecurity` imports.
|
|
16
|
+
- Alias SOAP imports when a custom generated client name would collide with an imported identifier.
|
|
17
|
+
- Validate buffered and streamed clients against the actual SOAP declarations and Node runtime.
|
|
18
|
+
- Typecheck integration tests and run compiled-client coverage in Node 26 CI.
|
|
19
|
+
|
|
20
|
+
## Upgrade Notes
|
|
21
|
+
|
|
22
|
+
Update the package and regenerate clients to receive the new imports. No generated API or configuration migration is required.
|
|
23
|
+
|
|
24
|
+
Updates from v1.1.2 also include the dependency security maintenance prepared in v1.1.3. TypeScript remains on the maintained 6.x line, and Node 24 remains the minimum supported runtime.
|
|
25
|
+
|
|
26
|
+
## Validation
|
|
27
|
+
|
|
28
|
+
- Full CI passed with 662 unit, snapshot, integration, and conformance tests.
|
|
29
|
+
- Buffered and streamed generated clients compile and execute under Node 24 and Node 26 checks.
|
|
30
|
+
- Installed package checks validate 73 generated TypeScript artifacts and exercise local SOAP transport.
|
|
31
|
+
- Release preflight validates package contents, dependency alignment, generated examples, and workflow gates.
|
|
32
|
+
- The agent skill ZIP and checksum manifest are validated and packaged.
|
|
33
|
+
|
|
34
|
+
## Notes
|
|
35
|
+
|
|
36
|
+
Release tag: `v1.1.4`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techspokes/typescript-wsdl-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
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",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"clean:tmp": "rimraf tmp",
|
|
68
68
|
"build": "tsc -p tsconfig.json",
|
|
69
69
|
"typecheck": "tsc --noEmit",
|
|
70
|
+
"typecheck:integration": "tsc -p test/integration/tsconfig.json",
|
|
70
71
|
"test": "vitest run",
|
|
71
72
|
"test:unit": "vitest run test/unit",
|
|
72
73
|
"test:snap": "vitest run test/snapshot",
|
|
@@ -99,9 +100,9 @@
|
|
|
99
100
|
"package:smoke": "node scripts/smoke-npm-package.mjs",
|
|
100
101
|
"release:preflight": "node scripts/release-preflight.mjs",
|
|
101
102
|
"release:publish-check": "npm run clean && npm run build && npm run typecheck && npm run skill:validate && npm run package:validate",
|
|
102
|
-
"ci": "npm run clean && npm run build && npm run typecheck && npm run skill:validate && npm run package:validate && npm run docs:validate && vitest run && npm run smoke:pipeline && npm run package:smoke",
|
|
103
|
-
"ci:github": "npm run clean && npm run build && npm run typecheck && npm run skill:validate && npm run package:validate && npm run docs:validate && npm run test:github && npm run smoke:pipeline",
|
|
104
|
-
"ci:github:node26": "npm run clean && npm run build && npm run typecheck && npm run test:unit && npm run smoke:pipeline",
|
|
103
|
+
"ci": "npm run clean && npm run build && npm run typecheck && npm run typecheck:integration && npm run skill:validate && npm run package:validate && npm run docs:validate && vitest run && npm run smoke:pipeline && npm run package:smoke",
|
|
104
|
+
"ci:github": "npm run clean && npm run build && npm run typecheck && npm run typecheck:integration && npm run skill:validate && npm run package:validate && npm run docs:validate && npm run test:github && npm run smoke:pipeline",
|
|
105
|
+
"ci:github:node26": "npm run clean && npm run build && npm run typecheck && npm run typecheck:integration && npm run test:unit && vitest run test/integration/client-imports.test.ts && npm run smoke:pipeline",
|
|
105
106
|
"examples:regenerate": "tsx src/cli.ts pipeline --wsdl-source examples/minimal/weather.wsdl --client-dir examples/generated-output/client --openapi-file examples/generated-output/openapi.json --gateway-dir examples/generated-output/gateway --gateway-service-name weather --gateway-version-prefix v1 --openapi-format json"
|
|
106
107
|
},
|
|
107
108
|
"devDependencies": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
* SOAP address. Falls back to the \`source\` URL when the descriptor is
|
|
61
61
|
* unavailable (e.g., \`source\` was given as a direct endpoint URL).
|
|
62
62
|
*/
|
|
63
|
-
protected resolveStreamEndpoint(client:
|
|
63
|
+
protected resolveStreamEndpoint(client: __SOAP_CLIENT_TYPE__): string {
|
|
64
64
|
const services = (client as any)?.wsdl?.definitions?.services ?? {};
|
|
65
65
|
for (const svc of Object.values(services)) {
|
|
66
66
|
const ports = (svc as any)?.ports ?? {};
|