@techspokes/typescript-wsdl-client 0.6.3 → 0.7.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 +242 -166
- package/dist/cli.js +223 -1
- package/dist/compiler/schemaCompiler.d.ts +54 -0
- package/dist/compiler/schemaCompiler.d.ts.map +1 -1
- package/dist/compiler/schemaCompiler.js +74 -7
- package/dist/config.d.ts +23 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/emit/catalogEmitter.d.ts +18 -0
- package/dist/emit/catalogEmitter.d.ts.map +1 -1
- package/dist/emit/catalogEmitter.js +31 -0
- package/dist/emit/clientEmitter.d.ts +17 -0
- package/dist/emit/clientEmitter.d.ts.map +1 -1
- package/dist/emit/clientEmitter.js +33 -3
- package/dist/emit/typesEmitter.d.ts +16 -5
- package/dist/emit/typesEmitter.d.ts.map +1 -1
- package/dist/emit/typesEmitter.js +30 -5
- package/dist/emit/utilsEmitter.d.ts +18 -0
- package/dist/emit/utilsEmitter.d.ts.map +1 -1
- package/dist/emit/utilsEmitter.js +30 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -1
- package/dist/loader/fetch.d.ts +31 -0
- package/dist/loader/fetch.d.ts.map +1 -1
- package/dist/loader/fetch.js +31 -0
- package/dist/loader/wsdlLoader.d.ts +32 -0
- package/dist/loader/wsdlLoader.d.ts.map +1 -1
- package/dist/loader/wsdlLoader.js +80 -9
- package/dist/openapi/buildPaths.d.ts +74 -0
- package/dist/openapi/buildPaths.d.ts.map +1 -0
- package/dist/openapi/buildPaths.js +66 -0
- package/dist/openapi/buildSchemas.d.ts +44 -0
- package/dist/openapi/buildSchemas.d.ts.map +1 -0
- package/dist/openapi/buildSchemas.js +207 -0
- package/dist/openapi/casing.d.ts +38 -0
- package/dist/openapi/casing.d.ts.map +1 -0
- package/dist/openapi/casing.js +49 -0
- package/dist/openapi/generateOpenAPI.d.ts +57 -0
- package/dist/openapi/generateOpenAPI.d.ts.map +1 -0
- package/dist/openapi/generateOpenAPI.js +174 -0
- package/dist/openapi/security.d.ts +82 -0
- package/dist/openapi/security.d.ts.map +1 -0
- package/dist/openapi/security.js +145 -0
- package/dist/pipeline.d.ts +37 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +72 -0
- package/dist/util/tools.d.ts +100 -7
- package/dist/util/tools.d.ts.map +1 -1
- package/dist/util/tools.js +85 -7
- package/dist/xsd/primitives.d.ts +33 -0
- package/dist/xsd/primitives.d.ts.map +1 -1
- package/dist/xsd/primitives.js +59 -7
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -7,223 +7,299 @@
|
|
|
7
7
|
[](https://github.com/techspokes/typescript-wsdl-client/stargazers)
|
|
8
8
|
[](https://github.com/techspokes/typescript-wsdl-client/network/members)
|
|
9
9
|
[](https://github.com/techspokes/typescript-wsdl-client/watchers)
|
|
10
|
-
|
|
11
10
|
[](https://github.com/techspokes)
|
|
12
|
-
[](https://github.com/sponsors/TechSpokes)
|
|
19
12
|
|
|
20
|
-
|
|
21
|
-
- End-to-end type safety: generated interfaces, aliases, and marshalling/unmarshalling logic.
|
|
22
|
-
- Deterministic JSON ⇄ SOAP metadata: clear attribute vs element ordering.
|
|
23
|
-
- Flexible primitive mapping: control decimals, dates, integers, and more via flags.
|
|
24
|
-
- Automatic flattening of `<complexContent>`/`<simpleContent>` inheritance.
|
|
25
|
-
- `<choice>` handling strategies and WS-Policy security hints baked in.
|
|
26
|
-
- Pluggable ESM/CJS imports: target your runtime with `--imports` alone.
|
|
27
|
-
|
|
28
|
-
Vendor: **[TechSpokes](https://www.techspokes.com)**
|
|
29
|
-
Maintainer: **Serge Liatko** ([@sergeliatko](https://github.com/sergeliatko))
|
|
13
|
+
> **Mission**: Turn complex WSDL/XSD definitions into ergonomic, stable, type‑safe TypeScript SOAP clients — with an optional OpenAPI 3.1 bridge — so you can integrate legacy enterprise services confidently.
|
|
30
14
|
|
|
31
15
|
---
|
|
16
|
+
## 1. Why This Project (What Sets It Apart)
|
|
17
|
+
Most generators stop at loosely typed stubs or leak XML complexity into your application layer. This tool focuses on **correct flattening and determinism**:
|
|
18
|
+
|
|
19
|
+
| Core Differentiator | What You Get |
|
|
20
|
+
|---------------------|--------------|
|
|
21
|
+
| Attribute + Element Flattening | Attributes and child elements appear as peer properties (no nested wrapper noise). |
|
|
22
|
+
| `$value` Text Content Convention | Simple & mixed content always represented as a `$value` property (collision-safe & documented). |
|
|
23
|
+
| Inheritance Resolution | `complexContent` and `simpleContent` extensions are merged or extended consistently. |
|
|
24
|
+
| Choice Strategy | Predictable `all-optional` modeling today (future advanced discriminators planned). |
|
|
25
|
+
| WS‑Policy Security Hints | Inline scan of policies surfaces required auth hints (e.g. `usernameToken`, `https`). |
|
|
26
|
+
| Deterministic Output | Sorted declarations and stable alias resolution for diff‑friendly regeneration. |
|
|
27
|
+
| Primitive Mapping Controls | Explicit flags for long / big integer / decimal / temporal families (string‑first safety). |
|
|
28
|
+
| Catalog Introspection | One JSON artifact (`catalog.json`) to drive further tooling (including OpenAPI). |
|
|
29
|
+
| OpenAPI 3.1 Bridge | Mirrors the exact TypeScript model — no divergence between runtime and spec. |
|
|
30
|
+
| Multi‑format Output | `--format json|yaml|both` with always‑on validation (unless disabled). |
|
|
31
|
+
| One‑Shot Pipeline | Single pass (parse → TS → OpenAPI) for CI & automation. |
|
|
32
|
+
|
|
33
|
+
**Vendor**: [TechSpokes](https://www.techspokes.com) · **Maintainer**: Serge Liatko ([@sergeliatko](https://github.com/sergeliatko))
|
|
32
34
|
|
|
33
|
-
## Installation
|
|
34
|
-
|
|
35
|
-
Install the generator as a development dependency:
|
|
36
35
|
|
|
36
|
+
---
|
|
37
|
+
## 2. Installation
|
|
37
38
|
```bash
|
|
38
39
|
npm i -D @techspokes/typescript-wsdl-client
|
|
39
|
-
#
|
|
40
|
-
npm i soap
|
|
40
|
+
npm i soap # runtime dependency for actual SOAP calls
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
---
|
|
44
|
+
## 3. Typical Repository Layout
|
|
45
|
+
You usually want generated SOAP clients under a namespaced integration folder. Examples:
|
|
46
|
+
```
|
|
47
|
+
src/
|
|
48
|
+
services/
|
|
49
|
+
third-party/
|
|
50
|
+
weather/
|
|
51
|
+
client.ts
|
|
52
|
+
types.ts
|
|
53
|
+
utils.ts
|
|
54
|
+
catalog.json
|
|
55
|
+
openapi.json
|
|
56
|
+
```
|
|
57
|
+
Pick a structure that communicates ownership and stability. Regenerate into the same folder for clean diffs.
|
|
44
58
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Run the following command to generate a client from your WSDL file:
|
|
59
|
+
---
|
|
60
|
+
## 4. Primary Usage: Generate a TypeScript SOAP Client
|
|
61
|
+
The **SOAP client generation** is the core of this project and the most common use case.
|
|
50
62
|
|
|
63
|
+
### 4.1 Quick Start
|
|
51
64
|
```bash
|
|
52
|
-
npx wsdl-tsc --wsdl ./
|
|
65
|
+
npx wsdl-tsc --wsdl ./wsdl/Weather.wsdl --out ./src/services/third-party/weather
|
|
53
66
|
```
|
|
54
67
|
|
|
55
|
-
|
|
68
|
+
**Try with included example:**
|
|
69
|
+
```bash
|
|
70
|
+
npx wsdl-tsc --wsdl examples/minimal/weather.wsdl --out ./tmp/weather
|
|
71
|
+
```
|
|
56
72
|
|
|
73
|
+
Imports afterward:
|
|
57
74
|
```ts
|
|
58
|
-
import
|
|
59
|
-
|
|
75
|
+
import { Weather } from "../services/third-party/weather/client.js";
|
|
76
|
+
```
|
|
60
77
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
### 4.2 What Gets Generated
|
|
79
|
+
| File | Purpose |
|
|
80
|
+
|------|---------|
|
|
81
|
+
| `client.ts` | Strongly typed wrapper with one method per operation. |
|
|
82
|
+
| `types.ts` | Flattened interfaces & literal/enum aliases. |
|
|
83
|
+
| `utils.ts` | Metadata (attribute vs element, occurrence, nillable). |
|
|
84
|
+
| `catalog.json` | (If `--catalog`) compiled representation for debugging / OpenAPI reuse. |
|
|
85
|
+
|
|
86
|
+
### 4.3 Key Modeling Rules Recap
|
|
87
|
+
- **Attributes & elements** → peer properties.
|
|
88
|
+
- **Text content** → `$value`.
|
|
89
|
+
- **Required attributes**: `use!=optional`; elements `min>=1`.
|
|
90
|
+
- **Multiplicity**: `max>1` or `unbounded` → arrays.
|
|
91
|
+
- **Nillable**: `nillable="true"` preserved (optionally modelled optional with `--nillable-as-optional`).
|
|
92
|
+
- **Inheritance**: extensions merged or emitted as extends; simpleContent base collapsed logically.
|
|
93
|
+
|
|
94
|
+
### 4.4 CLI Flags (SOAP Client)
|
|
95
|
+
| Flag | Default | Description |
|
|
96
|
+
|------|---------|-------------|
|
|
97
|
+
| `--wsdl` | (required) | Local path or URL to WSDL. |
|
|
98
|
+
| `--out` | (required) | Output directory. |
|
|
99
|
+
| `--imports` | `js` | Intra‑generated import style: `js`, `ts`, `bare`. |
|
|
100
|
+
| `--catalog` | `false` | Emit `catalog.json`. |
|
|
101
|
+
| `--client-name` | derived | Override exported class name. |
|
|
102
|
+
| `--attributes-key` | `$attributes` | Attribute bag key. |
|
|
103
|
+
| `--choice` | `all-optional` | Current choice strategy. |
|
|
104
|
+
| `--nillable-as-optional` | `false` | Treat nillable elements as optional props. |
|
|
105
|
+
| `--fail-on-unresolved` | `true` | Fail build on unresolved references. |
|
|
106
|
+
| `--int64-as` | `string` | Map 64‑bit integer types. |
|
|
107
|
+
| `--bigint-as` | `string` | Map arbitrary-size integer family. |
|
|
108
|
+
| `--decimal-as` | `string` | Map `xs:decimal`. |
|
|
109
|
+
| `--date-as` | `string` | Map date/time/duration primitives. |
|
|
110
|
+
|
|
111
|
+
### 4.5 Example With Safer Numeric Decisions
|
|
112
|
+
```bash
|
|
113
|
+
npx wsdl-tsc \
|
|
114
|
+
--wsdl https://example.com/Hotel.wsdl \
|
|
115
|
+
--out ./src/integrations/soap/hotel \
|
|
116
|
+
--int64-as number \
|
|
117
|
+
--decimal-as string \
|
|
118
|
+
--date-as string \
|
|
119
|
+
--catalog
|
|
120
|
+
```
|
|
65
121
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
},
|
|
122
|
+
### 4.6 Programmatic Generation (TypeScript Only)
|
|
123
|
+
```ts
|
|
124
|
+
import { compileWsdlToProject } from "@techspokes/typescript-wsdl-client";
|
|
125
|
+
await compileWsdlToProject({
|
|
126
|
+
wsdl: "./wsdl/Hotel.wsdl",
|
|
127
|
+
outDir: "./src/integrations/soap/hotel"
|
|
73
128
|
});
|
|
74
|
-
|
|
75
|
-
console.log(response);
|
|
76
129
|
```
|
|
77
130
|
|
|
78
131
|
---
|
|
132
|
+
## 5. Generating an OpenAPI 3.1 Definition (as a standalone run)
|
|
133
|
+
If you already have generated your SOAP client and just want an HTTP-friendly spec for proxies / gateways / docs:
|
|
134
|
+
```bash
|
|
135
|
+
npx wsdl-tsc openapi --wsdl ./wsdl/Hotel.wsdl --out ./openapi/hotel --format both
|
|
136
|
+
```
|
|
137
|
+
Or reuse a previously generated catalog:
|
|
138
|
+
```bash
|
|
139
|
+
npx wsdl-tsc openapi --catalog ./src/integrations/soap/hotel/catalog.json --out ./openapi/hotel
|
|
140
|
+
```
|
|
79
141
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
142
|
+
### 5.1 Formats & Validation
|
|
143
|
+
| Flag | Purpose |
|
|
144
|
+
|------|---------|
|
|
145
|
+
| `--format json|yaml|both` | Output format (default json). |
|
|
146
|
+
| `--yaml` | (Deprecated) alias for `--format yaml` when format absent. |
|
|
147
|
+
| `--validate/--no-validate` | Validation on by default. |
|
|
148
|
+
| `--out` | Base path or explicit file (extension optional). |
|
|
149
|
+
|
|
150
|
+
### 5.2 Core Schema Parity
|
|
151
|
+
The OpenAPI schemas reproduce the **exact** flattening & naming used in `types.ts` — crucial for avoiding drift between SOAP and REST surfaces.
|
|
152
|
+
|
|
153
|
+
### 5.3 Additional Flags (Selected)
|
|
154
|
+
| Flag | Description |
|
|
155
|
+
|------|-------------|
|
|
156
|
+
| `--basePath` | Prefix for REST path segments (e.g. `/v1/booking`). |
|
|
157
|
+
| `--pathStyle kebab|asis|lower` | Control operation name → path transformation. |
|
|
158
|
+
| `--method` | Default HTTP method (per‑op override via `--ops`). |
|
|
159
|
+
| `--tag-style` | Tag inference: `default`, `service`, `first`. |
|
|
160
|
+
| `--security` | Path to `security.json` (schemes + headers + overrides). |
|
|
161
|
+
| `--tags` | Path to `tags.json` (explicit operation → tag map). |
|
|
162
|
+
| `--ops` | Path to `ops.json` (method/summary/description/deprecated). |
|
|
163
|
+
| `--closedSchemas` | Apply `additionalProperties:false` globally. |
|
|
164
|
+
| `--pruneUnusedSchemas` | Emit only reachable schemas. |
|
|
165
|
+
|
|
166
|
+
### 5.4 Programmatic OpenAPI Generation
|
|
167
|
+
```ts
|
|
168
|
+
import { generateOpenAPI } from "@techspokes/typescript-wsdl-client";
|
|
169
|
+
const { jsonPath, yamlPath } = await generateOpenAPI({
|
|
170
|
+
wsdl: "./wsdl/Hotel.wsdl",
|
|
171
|
+
outFile: "./openapi/hotel",
|
|
172
|
+
format: "both"
|
|
173
|
+
});
|
|
174
|
+
```
|
|
93
175
|
|
|
94
176
|
---
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
177
|
+
## 6. One‑Shot Pipeline (SOAP Client + OpenAPI Together)
|
|
178
|
+
Ideal for CI: single WSDL parse → TS artifacts + catalog + OpenAPI (validated).
|
|
98
179
|
```bash
|
|
99
|
-
wsdl-tsc --wsdl
|
|
180
|
+
npx wsdl-tsc pipeline --wsdl ./wsdl/Hotel.wsdl --out ./src/integrations/soap/hotel --format both
|
|
100
181
|
```
|
|
101
182
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
183
|
+
| Pipeline Flag | Default | Notes |
|
|
184
|
+
|---------------|---------|-------|
|
|
185
|
+
| All SOAP flags | — | Same semantics as base generation. |
|
|
186
|
+
| All OpenAPI flags | — | Same semantics as standalone openapi. |
|
|
187
|
+
| `--openapi-out` | derived | Override OpenAPI base file. |
|
|
188
|
+
| `--format` | json | Multi-format control. |
|
|
189
|
+
| `--validate/--no-validate` | validate | Spec validation toggle. |
|
|
190
|
+
| `--tag-style` | default | Tag inference. |
|
|
105
191
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
| `--bigint-as` | string | string, number | string | How to map xs:integer family (positive/nonNegative/etc.) |
|
|
116
|
-
| `--decimal-as` | string | string, number | string | How to map xs:decimal (money/precision) |
|
|
117
|
-
| `--date-as` | string | string, Date | string | How to map date/time/duration types |
|
|
118
|
-
| `--choice` | string | all-optional, union | all-optional | Representation of `<choice>` elements |
|
|
119
|
-
| `--fail-on-unresolved` | boolean | true, false | true | Fail if any type references cannot be resolved |
|
|
120
|
-
| `--nillable-as-optional` | boolean | true, false | false | Treat nillable elements as optional properties in types |
|
|
192
|
+
Programmatic single pass:
|
|
193
|
+
```ts
|
|
194
|
+
import { runGenerationPipeline } from "@techspokes/typescript-wsdl-client";
|
|
195
|
+
await runGenerationPipeline({
|
|
196
|
+
wsdl: "./wsdl/Hotel.wsdl",
|
|
197
|
+
outDir: "./src/integrations/soap/hotel",
|
|
198
|
+
openapi: { format: "both", tagStyle: "service" }
|
|
199
|
+
});
|
|
200
|
+
```
|
|
121
201
|
|
|
122
202
|
---
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
203
|
+
## 7. Security Configuration (OpenAPI)
|
|
204
|
+
`security.json` example:
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"global": {
|
|
208
|
+
"scheme": "bearer",
|
|
209
|
+
"bearer": { "bearerFormat": "JWT" },
|
|
210
|
+
"headers": [ { "name": "X-Correlation-Id", "required": false, "schema": { "type": "string" } } ]
|
|
211
|
+
},
|
|
212
|
+
"overrides": {
|
|
213
|
+
"CancelBooking": { "scheme": "apiKey" }
|
|
214
|
+
}
|
|
215
|
+
}
|
|
134
216
|
```
|
|
217
|
+
Supported `scheme`: `none|basic|bearer|apiKey|oauth2`.
|
|
135
218
|
|
|
136
219
|
---
|
|
220
|
+
## 8. Tag Inference Strategies
|
|
221
|
+
| Strategy | Behavior |
|
|
222
|
+
|----------|----------|
|
|
223
|
+
| `default` | Single tag = service name (fallback `SOAP`). |
|
|
224
|
+
| `service` | Always service name (even if operation prefix differs). |
|
|
225
|
+
| `first` | First lexical segment of CamelCase operation (e.g. `GetCityWeatherByZIP` → `Get`). |
|
|
137
226
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
### Programmatic API
|
|
141
|
-
|
|
142
|
-
You can use the generator programmatically:
|
|
227
|
+
Provide `tags.json` for explicit mapping when heuristics are insufficient.
|
|
143
228
|
|
|
229
|
+
---
|
|
230
|
+
## 9. Working With the Generated Client
|
|
231
|
+
### 9.1 SOAP Client Construction
|
|
144
232
|
```ts
|
|
145
|
-
import
|
|
233
|
+
import soap from "soap";
|
|
234
|
+
import { Hotel } from "./src/integrations/soap/hotel/client.js";
|
|
146
235
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
int64As: "string",
|
|
155
|
-
bigIntegerAs: "string",
|
|
156
|
-
decimalAs: "string",
|
|
157
|
-
dateAs: "string",
|
|
158
|
-
},
|
|
159
|
-
choice: "all-optional",
|
|
160
|
-
failOnUnresolved: true,
|
|
161
|
-
attributesKey: "$attributes",
|
|
162
|
-
clientName: "MyServiceClient",
|
|
163
|
-
nillableAsOptional: false,
|
|
164
|
-
},
|
|
236
|
+
const hotel = new Hotel({
|
|
237
|
+
source: "https://example.com/HotelService?wsdl",
|
|
238
|
+
security: new soap.WSSecurity("user", "pass")
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
const res = await hotel.GetReservation({
|
|
242
|
+
GetReservationRQ: { ReservationId: "ABC123" }
|
|
165
243
|
});
|
|
166
244
|
```
|
|
245
|
+
### 9.2 Attributes & Text Values
|
|
246
|
+
If an element has text content and attributes, you pass both:
|
|
247
|
+
```ts
|
|
248
|
+
const Price = {
|
|
249
|
+
currencyCode: "USD",
|
|
250
|
+
$value: "123.45"
|
|
251
|
+
};
|
|
252
|
+
```
|
|
167
253
|
|
|
168
254
|
---
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
-
|
|
176
|
-
|
|
177
|
-
- TypeScript type issues
|
|
178
|
-
• "Cannot find module './client'" → run `npm run typecheck`, confirm your `outDir` matches import paths, and include generated `.d.ts`.
|
|
179
|
-
- Runtime SOAP errors
|
|
180
|
-
• Enable raw SOAP logging:
|
|
181
|
-
```bash
|
|
182
|
-
NODE_DEBUG=soap node your-app.js
|
|
183
|
-
```
|
|
184
|
-
• "wsdl is not valid" → update `soap` to latest (`npm i soap@latest`).
|
|
185
|
-
- Security warnings
|
|
186
|
-
• Missing or invalid headers → pass a valid `soap.ISecurity` instance:
|
|
187
|
-
```ts
|
|
188
|
-
new soap.WSSecurity("user","pass",{passwordType:"PasswordText"});
|
|
189
|
-
```
|
|
190
|
-
- XML attribute/content issues
|
|
191
|
-
• Wrong key in requests → override with `--attributes-key inKey[:outKey]` (e.g., `--attributes-key $attributes:attributes`).
|
|
255
|
+
## 10. Advanced Topics
|
|
256
|
+
| Topic | Notes |
|
|
257
|
+
|-------|-------|
|
|
258
|
+
| Primitive mapping philosophy | Defaults prefer string to avoid precision loss. |
|
|
259
|
+
| Choice flattening | Represented as optional union of fields – simpler consumption. |
|
|
260
|
+
| Array wrappers | Single repeated child w/out attributes collapses to an array schema in OpenAPI. |
|
|
261
|
+
| Validation | Uses `@apidevtools/swagger-parser`; disable with `--no-validate`. |
|
|
262
|
+
| Future | Discriminated unions for choices, richer policy extraction, snapshot OpenAPI tests. |
|
|
192
263
|
|
|
193
264
|
---
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
265
|
+
## 11. Troubleshooting
|
|
266
|
+
| Symptom | Resolution |
|
|
267
|
+
|---------|------------|
|
|
268
|
+
| WSDL fetch fails | Curl the URL, check TLS/proxy, retry with local copy. |
|
|
269
|
+
| Unresolved types | Re-run with `--fail-on-unresolved=false` to inspect partial graph. |
|
|
270
|
+
| Missing schema in OpenAPI | Ensure the global element exists (catalog shows compiled symbols). |
|
|
271
|
+
| Wrong array modeling | Check `maxOccurs` in WSDL; tool only arrays when `max>1` or `unbounded`. |
|
|
272
|
+
| Auth errors at runtime | Provide a proper `soap.ISecurity` instance (`WSSecurity`, etc.). |
|
|
273
|
+
| Date/time confusion | Use `--date-as Date` for runtime Date objects. |
|
|
274
|
+
|
|
275
|
+
Enable SOAP wire logging:
|
|
276
|
+
```bash
|
|
277
|
+
NODE_DEBUG=soap node app.js
|
|
278
|
+
```
|
|
198
279
|
|
|
199
280
|
---
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
- [SECURITY.md](SECURITY.md): Reporting vulnerabilities.
|
|
281
|
+
## 12. Programmatic Reference (Summary)
|
|
282
|
+
| Function | Purpose |
|
|
283
|
+
|----------|---------|
|
|
284
|
+
| `compileWsdlToProject` | WSDL → TS artifacts. |
|
|
285
|
+
| `generateOpenAPI` | WSDL or catalog → OpenAPI (json / yaml / both). |
|
|
286
|
+
| `runGenerationPipeline` | One pass: compile + TS emit + OpenAPI. |
|
|
207
287
|
|
|
208
288
|
---
|
|
289
|
+
## 13. Contributing
|
|
290
|
+
1. Fork & branch.
|
|
291
|
+
2. `npm i && npm run build`.
|
|
292
|
+
3. Use `npm run smoke:gen`, `npm run smoke:pipeline`, `npm run smoke:openapi:validate`.
|
|
293
|
+
- Note: These smoke tests use `examples/minimal/weather.wsdl` for quick validation.
|
|
294
|
+
4. Add a bullet under **Unreleased** in `CHANGELOG.md`.
|
|
209
295
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
MIT © TechSpokes.
|
|
213
|
-
*The tool is MIT-licensed. Generated artifacts are owned by you; the tool imposes no license on generated files.*
|
|
296
|
+
See also: `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`.
|
|
214
297
|
|
|
215
298
|
---
|
|
299
|
+
## 14. License
|
|
300
|
+
MIT © TechSpokes — Generated artifacts are fully yours.
|
|
216
301
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
**Gold Sponsors**
|
|
223
|
-
- [Your Name or Company (with a link) Here!](https://your-link-here.com)
|
|
224
|
-
|
|
225
|
-
**Platinum Sponsors**
|
|
226
|
-
- [Your Name or Company (with a link) Here!](https://your-link-here.com)
|
|
227
|
-
- **AND** 30-min one-to-one video meeting on AI, business automations, vacation rentals industry, development, tools, or a subject of your choice.
|
|
228
|
-
|
|
229
|
-
Want to see your name or company here? [Become a sponsor!](https://github.com/sponsors/TechSpokes)
|
|
302
|
+
---
|
|
303
|
+
## 15. Sponsors
|
|
304
|
+
Support ongoing maintenance: https://github.com/sponsors/TechSpokes
|
|
305
|
+
*Your brand could be featured here.*
|