tsoap-cli 0.0.1 → 0.0.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/dist/cli.js +32 -2
- package/dist/cli.js.map +1 -1
- package/dist/generator/codegen.d.ts +6 -0
- package/dist/generator/codegen.d.ts.map +1 -0
- package/dist/generator/codegen.js +92 -0
- package/dist/generator/codegen.js.map +1 -0
- package/dist/generator/writer.d.ts +6 -0
- package/dist/generator/writer.d.ts.map +1 -0
- package/dist/generator/writer.js +11 -0
- package/dist/generator/writer.js.map +1 -0
- package/dist/generator/xsd-types.d.ts +27 -0
- package/dist/generator/xsd-types.d.ts.map +1 -0
- package/dist/generator/xsd-types.js +91 -0
- package/dist/generator/xsd-types.js.map +1 -0
- package/dist/parser/wsdl-parser.d.ts +41 -0
- package/dist/parser/wsdl-parser.d.ts.map +1 -0
- package/dist/parser/wsdl-parser.js +242 -0
- package/dist/parser/wsdl-parser.js.map +1 -0
- package/package.json +7 -6
- package/src/cli.ts +43 -1
- package/src/generator/codegen.ts +135 -0
- package/src/generator/writer.ts +14 -0
- package/src/generator/xsd-types.ts +102 -0
- package/src/parser/wsdl-parser.ts +402 -0
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { resolve, basename, join } from "node:path";
|
|
3
|
+
import { Command } from "commander";
|
|
4
|
+
import { parseWsdl } from "./parser/wsdl-parser.js";
|
|
5
|
+
import { generateTypeScript } from "./generator/codegen.js";
|
|
6
|
+
import { writeGeneratedFile } from "./generator/writer.js";
|
|
7
|
+
const program = new Command();
|
|
8
|
+
program
|
|
9
|
+
.name("tsoap")
|
|
10
|
+
.description("Generate type-safe TypeScript clients from WSDL files")
|
|
11
|
+
.version("0.0.1");
|
|
12
|
+
program
|
|
13
|
+
.command("generate")
|
|
14
|
+
.description("Parse a WSDL and generate a typed TypeScript client")
|
|
15
|
+
.requiredOption("-i, --input <path>", "Path or URL to the WSDL file")
|
|
16
|
+
.requiredOption("-o, --output <dir>", "Output directory for generated files")
|
|
17
|
+
.action(async (opts) => {
|
|
18
|
+
const inputPath = opts.input;
|
|
19
|
+
const outputDir = resolve(opts.output);
|
|
20
|
+
const isUrl = inputPath.startsWith("http://") || inputPath.startsWith("https://");
|
|
21
|
+
const resolvedInput = isUrl ? inputPath : resolve(inputPath);
|
|
22
|
+
const outputFileName = basename(inputPath, ".wsdl") + ".ts";
|
|
23
|
+
const outputPath = join(outputDir, outputFileName);
|
|
24
|
+
console.log(`Parsing WSDL: ${resolvedInput}`);
|
|
25
|
+
const parsed = await parseWsdl(resolvedInput);
|
|
26
|
+
console.log(`Found ${parsed.services.length} service(s), ` +
|
|
27
|
+
`${parsed.types.length} type(s), ` +
|
|
28
|
+
`${parsed.enums.length} enum(s)`);
|
|
29
|
+
const source = generateTypeScript(parsed, basename(inputPath));
|
|
30
|
+
await writeGeneratedFile(outputPath, source);
|
|
31
|
+
console.log(`Generated: ${outputPath}`);
|
|
32
|
+
});
|
|
33
|
+
program.parse();
|
|
4
34
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,OA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AC;IAC/D,MAAM,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAE7C,OAAO,CAAC,GAAG,CAAC,cAAc,UAAU,EAAE,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ParsedWsdl } from "../parser/wsdl-parser.js";
|
|
2
|
+
/**
|
|
3
|
+
* Generates a complete TypeScript source file from a parsed WSDL.
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateTypeScript(parsed: ParsedWsdl, sourceWsdl: string): string;
|
|
6
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/generator/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,0BAA0B,CAAC;AA6FlC;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAiCjF"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
function indent(level) {
|
|
2
|
+
return " ".repeat(level);
|
|
3
|
+
}
|
|
4
|
+
function fieldToString(field, indentLevel) {
|
|
5
|
+
const lines = [];
|
|
6
|
+
if (field.precisionRisk) {
|
|
7
|
+
lines.push(`${indent(indentLevel)}/** WARNING: values > Number.MAX_SAFE_INTEGER lose precision */`);
|
|
8
|
+
}
|
|
9
|
+
const optional = field.isOptional ? "?" : "";
|
|
10
|
+
const arraySuffix = field.isArray ? "[]" : "";
|
|
11
|
+
lines.push(`${indent(indentLevel)}${field.name}${optional}: ${field.tsType}${arraySuffix};`);
|
|
12
|
+
return lines.join("\n");
|
|
13
|
+
}
|
|
14
|
+
function emitInterface(type) {
|
|
15
|
+
const lines = [];
|
|
16
|
+
lines.push(`export interface ${type.name} {`);
|
|
17
|
+
for (const field of type.fields) {
|
|
18
|
+
lines.push(fieldToString(field, 1));
|
|
19
|
+
}
|
|
20
|
+
lines.push("}");
|
|
21
|
+
return lines.join("\n");
|
|
22
|
+
}
|
|
23
|
+
function emitEnum(enumType) {
|
|
24
|
+
const values = enumType.values.map((v) => `"${v}"`).join(" | ");
|
|
25
|
+
return `export type ${enumType.name} = ${values};`;
|
|
26
|
+
}
|
|
27
|
+
function emitServiceDefinition(parsed) {
|
|
28
|
+
const lines = [];
|
|
29
|
+
const defName = parsed.services.length === 1
|
|
30
|
+
? `${parsed.services[0].name}Definition`
|
|
31
|
+
: "GeneratedServiceDefinition";
|
|
32
|
+
lines.push(`export interface ${defName} extends ServiceDefinition {`);
|
|
33
|
+
for (const service of parsed.services) {
|
|
34
|
+
lines.push(`${indent(1)}${service.name}: {`);
|
|
35
|
+
for (const port of service.ports) {
|
|
36
|
+
lines.push(`${indent(2)}${port.name}: {`);
|
|
37
|
+
for (const op of port.operations) {
|
|
38
|
+
lines.push(`${indent(3)}${op.name}: {`);
|
|
39
|
+
lines.push(`${indent(4)}input: ${op.input.name};`);
|
|
40
|
+
lines.push(`${indent(4)}output: ${op.output.name};`);
|
|
41
|
+
lines.push(`${indent(3)}};`);
|
|
42
|
+
}
|
|
43
|
+
lines.push(`${indent(2)}};`);
|
|
44
|
+
}
|
|
45
|
+
lines.push(`${indent(1)}};`);
|
|
46
|
+
}
|
|
47
|
+
lines.push("}");
|
|
48
|
+
return lines.join("\n");
|
|
49
|
+
}
|
|
50
|
+
function emitFactoryFunction(parsed) {
|
|
51
|
+
const defName = parsed.services.length === 1
|
|
52
|
+
? `${parsed.services[0].name}Definition`
|
|
53
|
+
: "GeneratedServiceDefinition";
|
|
54
|
+
const clientType = parsed.services.length === 1
|
|
55
|
+
? `${parsed.services[0].name}Client`
|
|
56
|
+
: "GeneratedClient";
|
|
57
|
+
const factoryName = parsed.services.length === 1
|
|
58
|
+
? `create${parsed.services[0].name}Client`
|
|
59
|
+
: "createGeneratedClient";
|
|
60
|
+
const lines = [];
|
|
61
|
+
lines.push(`export type ${clientType} = InferClient<${defName}>;`);
|
|
62
|
+
lines.push("");
|
|
63
|
+
lines.push(`export async function ${factoryName}(wsdlUrl: string, options?: SoapClientOptions): Promise<${clientType}> {`);
|
|
64
|
+
lines.push(`${indent(1)}return createSoapClient<${defName}>(wsdlUrl, options);`);
|
|
65
|
+
lines.push("}");
|
|
66
|
+
return lines.join("\n");
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Generates a complete TypeScript source file from a parsed WSDL.
|
|
70
|
+
*/
|
|
71
|
+
export function generateTypeScript(parsed, sourceWsdl) {
|
|
72
|
+
const emittedTypes = new Set();
|
|
73
|
+
const sections = [];
|
|
74
|
+
sections.push(`// Auto-generated by tsoap-cli — do not edit`, `// Source: ${sourceWsdl}`, `// Generated: ${new Date().toISOString()}`, "", `import { createSoapClient } from "typed-soap";`, `import type { ServiceDefinition, InferClient, SoapClientOptions } from "typed-soap";`, "");
|
|
75
|
+
for (const enumType of parsed.enums) {
|
|
76
|
+
sections.push(emitEnum(enumType));
|
|
77
|
+
sections.push("");
|
|
78
|
+
}
|
|
79
|
+
for (const type of parsed.types) {
|
|
80
|
+
if (!emittedTypes.has(type.name)) {
|
|
81
|
+
sections.push(emitInterface(type));
|
|
82
|
+
sections.push("");
|
|
83
|
+
emittedTypes.add(type.name);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
sections.push(emitServiceDefinition(parsed));
|
|
87
|
+
sections.push("");
|
|
88
|
+
sections.push(emitFactoryFunction(parsed));
|
|
89
|
+
sections.push("");
|
|
90
|
+
return sections.join("\n");
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/generator/codegen.ts"],"names":[],"mappings":"AAOA,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,IAAI,CAAC,MAAM,CA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AAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/generator/writer.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Writes generated TypeScript source to a file, creating
|
|
5
|
+
* parent directories as needed.
|
|
6
|
+
*/
|
|
7
|
+
export async function writeGeneratedFile(filePath, content) {
|
|
8
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
9
|
+
await writeFile(filePath, content, "utf-8");
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../src/generator/writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAgB,EAChB,OAAe;IAEf,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps XSD primitive type local names (without namespace prefix) to
|
|
3
|
+
* their TypeScript type representation as a source string.
|
|
4
|
+
*
|
|
5
|
+
* The soap package natively deserializes: int, integer, short, long,
|
|
6
|
+
* float, double, decimal (to number), boolean (to boolean), dateTime
|
|
7
|
+
* and date (to Date). Our runtime's customDeserializer fills in the
|
|
8
|
+
* gaps for byte, unsigned*, and named integer types so they also
|
|
9
|
+
* arrive as numbers at runtime.
|
|
10
|
+
*/
|
|
11
|
+
export interface XsdTypeInfo {
|
|
12
|
+
tsType: string;
|
|
13
|
+
/** If true, emitted with a JSDoc precision warning. */
|
|
14
|
+
precisionRisk: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Strips namespace prefix from an XSD type string.
|
|
18
|
+
* `"xsd:string"` -> `"string"`, `"tns:MyType"` -> `"MyType"`
|
|
19
|
+
*/
|
|
20
|
+
export declare function stripNamespace(xsdType: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves an XSD primitive type to its TypeScript representation.
|
|
23
|
+
* Returns `null` if the type is not a known primitive (i.e. it's a
|
|
24
|
+
* complex or user-defined type that needs to be looked up elsewhere).
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveXsdPrimitive(localName: string): XsdTypeInfo | null;
|
|
27
|
+
//# sourceMappingURL=xsd-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xsd-types.d.ts","sourceRoot":"","sources":["../../src/generator/xsd-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoDH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAoBzE"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps XSD primitive type local names (without namespace prefix) to
|
|
3
|
+
* their TypeScript type representation as a source string.
|
|
4
|
+
*
|
|
5
|
+
* The soap package natively deserializes: int, integer, short, long,
|
|
6
|
+
* float, double, decimal (to number), boolean (to boolean), dateTime
|
|
7
|
+
* and date (to Date). Our runtime's customDeserializer fills in the
|
|
8
|
+
* gaps for byte, unsigned*, and named integer types so they also
|
|
9
|
+
* arrive as numbers at runtime.
|
|
10
|
+
*/
|
|
11
|
+
const SAFE_NUMBER_TYPES = new Set([
|
|
12
|
+
"int",
|
|
13
|
+
"short",
|
|
14
|
+
"byte",
|
|
15
|
+
"unsignedInt",
|
|
16
|
+
"unsignedShort",
|
|
17
|
+
"unsignedByte",
|
|
18
|
+
"float",
|
|
19
|
+
"double",
|
|
20
|
+
]);
|
|
21
|
+
/** WARNING: values > Number.MAX_SAFE_INTEGER lose precision */
|
|
22
|
+
const PRECISION_RISK_NUMBER_TYPES = new Set([
|
|
23
|
+
"long",
|
|
24
|
+
"unsignedLong",
|
|
25
|
+
"integer",
|
|
26
|
+
"decimal",
|
|
27
|
+
"negativeInteger",
|
|
28
|
+
"nonNegativeInteger",
|
|
29
|
+
"positiveInteger",
|
|
30
|
+
"nonPositiveInteger",
|
|
31
|
+
]);
|
|
32
|
+
const DATE_TYPES = new Set(["dateTime", "date"]);
|
|
33
|
+
const STRING_TYPES = new Set([
|
|
34
|
+
"string",
|
|
35
|
+
"normalizedString",
|
|
36
|
+
"token",
|
|
37
|
+
"language",
|
|
38
|
+
"Name",
|
|
39
|
+
"NCName",
|
|
40
|
+
"NMTOKEN",
|
|
41
|
+
"ID",
|
|
42
|
+
"IDREF",
|
|
43
|
+
"ENTITY",
|
|
44
|
+
"anyURI",
|
|
45
|
+
"QName",
|
|
46
|
+
"NOTATION",
|
|
47
|
+
"time",
|
|
48
|
+
"duration",
|
|
49
|
+
"gYear",
|
|
50
|
+
"gYearMonth",
|
|
51
|
+
"gMonth",
|
|
52
|
+
"gMonthDay",
|
|
53
|
+
"gDay",
|
|
54
|
+
"base64Binary",
|
|
55
|
+
"hexBinary",
|
|
56
|
+
]);
|
|
57
|
+
/**
|
|
58
|
+
* Strips namespace prefix from an XSD type string.
|
|
59
|
+
* `"xsd:string"` -> `"string"`, `"tns:MyType"` -> `"MyType"`
|
|
60
|
+
*/
|
|
61
|
+
export function stripNamespace(xsdType) {
|
|
62
|
+
const idx = xsdType.indexOf(":");
|
|
63
|
+
return idx >= 0 ? xsdType.slice(idx + 1) : xsdType;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Resolves an XSD primitive type to its TypeScript representation.
|
|
67
|
+
* Returns `null` if the type is not a known primitive (i.e. it's a
|
|
68
|
+
* complex or user-defined type that needs to be looked up elsewhere).
|
|
69
|
+
*/
|
|
70
|
+
export function resolveXsdPrimitive(localName) {
|
|
71
|
+
if (localName === "boolean") {
|
|
72
|
+
return { tsType: "boolean", precisionRisk: false };
|
|
73
|
+
}
|
|
74
|
+
if (SAFE_NUMBER_TYPES.has(localName)) {
|
|
75
|
+
return { tsType: "number", precisionRisk: false };
|
|
76
|
+
}
|
|
77
|
+
if (PRECISION_RISK_NUMBER_TYPES.has(localName)) {
|
|
78
|
+
return { tsType: "number", precisionRisk: true };
|
|
79
|
+
}
|
|
80
|
+
if (DATE_TYPES.has(localName)) {
|
|
81
|
+
return { tsType: "Date", precisionRisk: false };
|
|
82
|
+
}
|
|
83
|
+
if (STRING_TYPES.has(localName)) {
|
|
84
|
+
return { tsType: "string", precisionRisk: false };
|
|
85
|
+
}
|
|
86
|
+
if (localName === "anyType") {
|
|
87
|
+
return { tsType: "unknown", precisionRisk: false };
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=xsd-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xsd-types.js","sourceRoot":"","sources":["../../src/generator/xsd-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,KAAK;IACL,OAA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C;IACpD,CAAC;IACD,IAAI,2BAA2B,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAClD,CAAC;IACD,IAAI,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IACpD,CAAC;IACD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IACrD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface ParsedField {
|
|
2
|
+
name: string;
|
|
3
|
+
/** TypeScript type as a source string (e.g. "string", "number", "MyInterface") */
|
|
4
|
+
tsType: string;
|
|
5
|
+
isArray: boolean;
|
|
6
|
+
isOptional: boolean;
|
|
7
|
+
/** If true, the generated type should include a JSDoc precision warning */
|
|
8
|
+
precisionRisk: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ParsedType {
|
|
11
|
+
name: string;
|
|
12
|
+
fields: ParsedField[];
|
|
13
|
+
}
|
|
14
|
+
export interface ParsedEnum {
|
|
15
|
+
name: string;
|
|
16
|
+
values: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface ParsedOperation {
|
|
19
|
+
name: string;
|
|
20
|
+
input: ParsedType;
|
|
21
|
+
output: ParsedType;
|
|
22
|
+
}
|
|
23
|
+
export interface ParsedPort {
|
|
24
|
+
name: string;
|
|
25
|
+
operations: ParsedOperation[];
|
|
26
|
+
}
|
|
27
|
+
export interface ParsedService {
|
|
28
|
+
name: string;
|
|
29
|
+
ports: ParsedPort[];
|
|
30
|
+
}
|
|
31
|
+
export interface ParsedWsdl {
|
|
32
|
+
services: ParsedService[];
|
|
33
|
+
enums: ParsedEnum[];
|
|
34
|
+
types: ParsedType[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Loads a WSDL file (local path or URL) and returns a normalized IR
|
|
38
|
+
* representing all services, ports, operations, and types.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseWsdl(wsdlPath: string): Promise<ParsedWsdl>;
|
|
41
|
+
//# sourceMappingURL=wsdl-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wsdl-parser.d.ts","sourceRoot":"","sources":["../../src/parser/wsdl-parser.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,2EAA2E;IAC3E,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AA+QD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAmFrE"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import * as soap from "soap";
|
|
2
|
+
import { stripNamespace, resolveXsdPrimitive } from "../generator/xsd-types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Walks `client.wsdl.definitions.schemas` to build a lookup map
|
|
5
|
+
* of element/complexType names to their field metadata (type ref,
|
|
6
|
+
* minOccurs, maxOccurs). This gives us data that `describe()` loses.
|
|
7
|
+
*/
|
|
8
|
+
function buildSchemaMap(client) {
|
|
9
|
+
const map = new Map();
|
|
10
|
+
const wsdl = client.wsdl;
|
|
11
|
+
const definitions = wsdl.definitions;
|
|
12
|
+
const schemas = definitions?.schemas;
|
|
13
|
+
if (!schemas)
|
|
14
|
+
return map;
|
|
15
|
+
for (const schema of Object.values(schemas)) {
|
|
16
|
+
extractFromSchemaSection(schema.complexTypes, map);
|
|
17
|
+
extractFromSchemaSection(schema.elements, map);
|
|
18
|
+
}
|
|
19
|
+
return map;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the actual WSDL element names for an operation's input/output
|
|
23
|
+
* by reading from the port's resolved binding. This avoids guessing
|
|
24
|
+
* based on naming conventions (e.g. `${opName}Request`).
|
|
25
|
+
*
|
|
26
|
+
* The soap library attaches the full binding object (with resolved
|
|
27
|
+
* portType methods) directly to each port at
|
|
28
|
+
* `definitions.services[svc].ports[port].binding.methods[op]`.
|
|
29
|
+
*/
|
|
30
|
+
function resolveElementNames(client, serviceName, portName, opName) {
|
|
31
|
+
try {
|
|
32
|
+
const wsdl = client.wsdl;
|
|
33
|
+
const definitions = wsdl.definitions;
|
|
34
|
+
const services = definitions.services;
|
|
35
|
+
const svc = services[serviceName];
|
|
36
|
+
const ports = svc?.ports;
|
|
37
|
+
const port = ports?.[portName];
|
|
38
|
+
const binding = port?.binding;
|
|
39
|
+
const methods = binding?.methods;
|
|
40
|
+
const method = methods?.[opName];
|
|
41
|
+
const inputEl = method?.input;
|
|
42
|
+
const outputEl = method?.output;
|
|
43
|
+
const inputName = inputEl?.$name;
|
|
44
|
+
const outputName = outputEl?.$name;
|
|
45
|
+
if (inputName && outputName) {
|
|
46
|
+
return { input: inputName, output: outputName };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// fall through
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
function extractFromSchemaSection(section, map) {
|
|
55
|
+
if (!section || typeof section !== "object")
|
|
56
|
+
return;
|
|
57
|
+
for (const [name, def] of Object.entries(section)) {
|
|
58
|
+
const fields = extractFields(def);
|
|
59
|
+
if (fields.length > 0) {
|
|
60
|
+
map.set(name, { fields });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function extractFields(node) {
|
|
65
|
+
if (!node || typeof node !== "object")
|
|
66
|
+
return [];
|
|
67
|
+
const obj = node;
|
|
68
|
+
const children = obj.children;
|
|
69
|
+
if (!children)
|
|
70
|
+
return [];
|
|
71
|
+
const fields = [];
|
|
72
|
+
for (const child of children) {
|
|
73
|
+
const childObj = child;
|
|
74
|
+
if (childObj.$name && childObj.$type) {
|
|
75
|
+
fields.push({
|
|
76
|
+
name: childObj.$name,
|
|
77
|
+
type: childObj.$type,
|
|
78
|
+
minOccurs: childObj.$minOccurs,
|
|
79
|
+
maxOccurs: childObj.$maxOccurs,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const nested = extractFields(child);
|
|
83
|
+
fields.push(...nested);
|
|
84
|
+
}
|
|
85
|
+
return fields;
|
|
86
|
+
}
|
|
87
|
+
function pascalCase(str) {
|
|
88
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Parses an element descriptor from `client.describe()`,
|
|
92
|
+
* cross-referencing with the schema map for type names and optionality.
|
|
93
|
+
*/
|
|
94
|
+
function parseFieldDescriptor(fieldName, descriptor, collectedTypes, collectedEnums, schemaMap, parentSchemaInfo) {
|
|
95
|
+
const isArray = fieldName.endsWith("[]");
|
|
96
|
+
const cleanName = isArray ? fieldName.slice(0, -2) : fieldName;
|
|
97
|
+
const schemaField = parentSchemaInfo?.fields.find((f) => f.name === cleanName);
|
|
98
|
+
const isOptional = schemaField?.minOccurs === "0";
|
|
99
|
+
if (typeof descriptor === "string") {
|
|
100
|
+
const enumMatch = descriptor.match(/^(\w+)\|[^|]+\|(.+)$/);
|
|
101
|
+
if (enumMatch) {
|
|
102
|
+
const enumName = enumMatch[1];
|
|
103
|
+
const values = enumMatch[2].split(",");
|
|
104
|
+
if (!collectedEnums.has(enumName)) {
|
|
105
|
+
collectedEnums.set(enumName, { name: enumName, values });
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
name: cleanName,
|
|
109
|
+
tsType: enumName,
|
|
110
|
+
isArray,
|
|
111
|
+
isOptional,
|
|
112
|
+
precisionRisk: false,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const localName = stripNamespace(descriptor);
|
|
116
|
+
const primitive = resolveXsdPrimitive(localName);
|
|
117
|
+
if (primitive) {
|
|
118
|
+
return {
|
|
119
|
+
name: cleanName,
|
|
120
|
+
tsType: primitive.tsType,
|
|
121
|
+
isArray,
|
|
122
|
+
isOptional,
|
|
123
|
+
precisionRisk: primitive.precisionRisk,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
name: cleanName,
|
|
128
|
+
tsType: localName,
|
|
129
|
+
isArray,
|
|
130
|
+
isOptional,
|
|
131
|
+
precisionRisk: false,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (typeof descriptor === "object" && descriptor !== null) {
|
|
135
|
+
let typeName;
|
|
136
|
+
if (schemaField?.type) {
|
|
137
|
+
const localTypeName = stripNamespace(schemaField.type);
|
|
138
|
+
typeName = pascalCase(localTypeName);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
typeName = pascalCase(cleanName);
|
|
142
|
+
}
|
|
143
|
+
if (!collectedTypes.has(typeName)) {
|
|
144
|
+
// BUG 1 FIX: insert placeholder BEFORE recursing to prevent
|
|
145
|
+
// infinite recursion on self-referencing types (e.g. TreeNode)
|
|
146
|
+
const placeholder = { name: typeName, fields: [] };
|
|
147
|
+
collectedTypes.set(typeName, placeholder);
|
|
148
|
+
const nestedSchemaInfo = schemaMap.get(typeName) ?? schemaMap.get(cleanName);
|
|
149
|
+
const fields = parseObjectDescriptor(descriptor, collectedTypes, collectedEnums, schemaMap, nestedSchemaInfo);
|
|
150
|
+
placeholder.fields = fields;
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
name: cleanName,
|
|
154
|
+
tsType: typeName,
|
|
155
|
+
isArray,
|
|
156
|
+
isOptional,
|
|
157
|
+
precisionRisk: false,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
name: cleanName,
|
|
162
|
+
tsType: "unknown",
|
|
163
|
+
isArray,
|
|
164
|
+
isOptional,
|
|
165
|
+
precisionRisk: false,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function parseObjectDescriptor(obj, collectedTypes, collectedEnums, schemaMap, parentSchemaInfo) {
|
|
169
|
+
const fields = [];
|
|
170
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
171
|
+
if (key.startsWith("$") || key === "targetNSAlias" || key === "targetNamespace") {
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
fields.push(parseFieldDescriptor(key, value, collectedTypes, collectedEnums, schemaMap, parentSchemaInfo));
|
|
175
|
+
}
|
|
176
|
+
return fields;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Picks a unique type name for an operation's input/output.
|
|
180
|
+
* If the base name already exists in collectedTypes, prefixes
|
|
181
|
+
* with the port name to disambiguate (BUG 2 FIX).
|
|
182
|
+
*/
|
|
183
|
+
function uniqueTypeName(baseName, portName, collectedTypes) {
|
|
184
|
+
if (!collectedTypes.has(baseName)) {
|
|
185
|
+
return baseName;
|
|
186
|
+
}
|
|
187
|
+
return `${portName}${baseName}`;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Loads a WSDL file (local path or URL) and returns a normalized IR
|
|
191
|
+
* representing all services, ports, operations, and types.
|
|
192
|
+
*/
|
|
193
|
+
export async function parseWsdl(wsdlPath) {
|
|
194
|
+
const client = await soap.createClientAsync(wsdlPath);
|
|
195
|
+
const description = client.describe();
|
|
196
|
+
const schemaMap = buildSchemaMap(client);
|
|
197
|
+
const collectedTypes = new Map();
|
|
198
|
+
const collectedEnums = new Map();
|
|
199
|
+
const services = [];
|
|
200
|
+
for (const [serviceName, serviceDesc] of Object.entries(description)) {
|
|
201
|
+
const ports = [];
|
|
202
|
+
for (const [portName, portDesc] of Object.entries(serviceDesc)) {
|
|
203
|
+
const operations = [];
|
|
204
|
+
for (const [opName, opDesc] of Object.entries(portDesc)) {
|
|
205
|
+
const opObj = opDesc;
|
|
206
|
+
const inputDesc = opObj.input ?? {};
|
|
207
|
+
const outputDesc = opObj.output ?? {};
|
|
208
|
+
// BUG 3 FIX: resolve actual element names from the port's binding
|
|
209
|
+
// instead of guessing based on naming conventions.
|
|
210
|
+
const elementNames = resolveElementNames(client, serviceName, portName, opName);
|
|
211
|
+
const inputElementName = elementNames?.input ?? `${opName}Request`;
|
|
212
|
+
const outputElementName = elementNames?.output ?? `${opName}Response`;
|
|
213
|
+
// BUG 2 FIX: if the type name already exists (e.g. same op name
|
|
214
|
+
// in a different port), prefix with the port name.
|
|
215
|
+
const inputTypeName = uniqueTypeName(pascalCase(inputElementName), portName, collectedTypes);
|
|
216
|
+
const outputTypeName = uniqueTypeName(pascalCase(outputElementName), portName, collectedTypes);
|
|
217
|
+
// BUG 3 FIX: look up schema info by the actual element name
|
|
218
|
+
const inputSchemaInfo = schemaMap.get(inputElementName) ?? schemaMap.get(inputTypeName);
|
|
219
|
+
const outputSchemaInfo = schemaMap.get(outputElementName) ?? schemaMap.get(outputTypeName);
|
|
220
|
+
const inputFields = parseObjectDescriptor(inputDesc, collectedTypes, collectedEnums, schemaMap, inputSchemaInfo);
|
|
221
|
+
const outputFields = parseObjectDescriptor(outputDesc, collectedTypes, collectedEnums, schemaMap, outputSchemaInfo);
|
|
222
|
+
const inputType = { name: inputTypeName, fields: inputFields };
|
|
223
|
+
const outputType = { name: outputTypeName, fields: outputFields };
|
|
224
|
+
collectedTypes.set(inputTypeName, inputType);
|
|
225
|
+
collectedTypes.set(outputTypeName, outputType);
|
|
226
|
+
operations.push({
|
|
227
|
+
name: opName,
|
|
228
|
+
input: inputType,
|
|
229
|
+
output: outputType,
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
ports.push({ name: portName, operations });
|
|
233
|
+
}
|
|
234
|
+
services.push({ name: serviceName, ports });
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
services,
|
|
238
|
+
enums: Array.from(collectedEnums.values()),
|
|
239
|
+
types: Array.from(collectedTypes.values()),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=wsdl-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wsdl-parser.js","sourceRoot":"","sources":["../../src/parser/wsdl-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AA8DhF;;;;GAIG;AACH,SAAS,cAAc,CAAC,MAAmB;IACzC,MAAM,GAAG,GAAc,IAAI,GAAG,EAAE,CAAC;IACjC,MAAM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,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;QAC7C,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO;QACL,QAAQ;QACR,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QAC1C,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsoap-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "End-to-end type-safe SOAP client for TypeScript. Generate typed RPC wrappers directly from WSDLs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"soap",
|
|
@@ -17,7 +17,12 @@
|
|
|
17
17
|
"bin": {
|
|
18
18
|
"tsoap": "./dist/cli.js"
|
|
19
19
|
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"dev": "tsc --watch"
|
|
23
|
+
},
|
|
20
24
|
"dependencies": {
|
|
25
|
+
"commander": "^13.1.0",
|
|
21
26
|
"soap": "^1.1.6",
|
|
22
27
|
"typescript": "^5.9.2"
|
|
23
28
|
},
|
|
@@ -32,9 +37,5 @@
|
|
|
32
37
|
},
|
|
33
38
|
"publishConfig": {
|
|
34
39
|
"registry": "https://registry.npmjs.org/"
|
|
35
|
-
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "tsc",
|
|
38
|
-
"dev": "tsc --watch"
|
|
39
40
|
}
|
|
40
|
-
}
|
|
41
|
+
}
|