tsoap-cli 0.0.1 → 0.0.3

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 CHANGED
@@ -1,4 +1,54 @@
1
1
  #!/usr/bin/env node
2
- console.log("tsoap CLI WSDL-to-TypeScript code generator (not yet implemented)");
3
- export {};
2
+ import { resolve, basename, join } from "node:path";
3
+ import { readFileSync } from "node:fs";
4
+ import { fileURLToPath } from "node:url";
5
+ import { dirname } from "node:path";
6
+ import { Command } from "commander";
7
+ import { parseWsdl } from "./parser/wsdl-parser.js";
8
+ import { generateTypeScript } from "./generator/codegen.js";
9
+ import { writeGeneratedFile } from "./generator/writer.js";
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
13
+ const program = new Command();
14
+ program
15
+ .name("tsoap")
16
+ .description("Generate type-safe TypeScript clients from WSDL files")
17
+ .version(pkg.version);
18
+ program
19
+ .command("generate")
20
+ .description("Parse a WSDL and generate a typed TypeScript client")
21
+ .requiredOption("-i, --input <path>", "Path or URL to the WSDL file")
22
+ .requiredOption("-o, --output <dir>", "Output directory for generated files")
23
+ .action(async (opts) => {
24
+ try {
25
+ const inputPath = opts.input;
26
+ const outputDir = resolve(opts.output);
27
+ const isUrl = inputPath.startsWith("http://") || inputPath.startsWith("https://");
28
+ const resolvedInput = isUrl ? inputPath : resolve(inputPath);
29
+ const outputFileName = basename(inputPath, ".wsdl") + ".ts";
30
+ const outputPath = join(outputDir, outputFileName);
31
+ console.log(`Parsing WSDL: ${resolvedInput}`);
32
+ const parsed = await parseWsdl(resolvedInput);
33
+ const totalOps = parsed.services.reduce((sum, svc) => sum + svc.ports.reduce((s, p) => s + p.operations.length, 0), 0);
34
+ if (parsed.services.length === 0) {
35
+ console.warn("Warning: WSDL contains no services. Generated file will be empty.");
36
+ }
37
+ else if (totalOps === 0) {
38
+ console.warn("Warning: WSDL services contain no operations. Generated file will have no callable methods.");
39
+ }
40
+ console.log(`Found ${parsed.services.length} service(s), ` +
41
+ `${parsed.types.length} type(s), ` +
42
+ `${parsed.enums.length} enum(s)`);
43
+ const source = generateTypeScript(parsed, basename(inputPath));
44
+ await writeGeneratedFile(outputPath, source);
45
+ console.log(`Generated: ${outputPath}`);
46
+ }
47
+ catch (err) {
48
+ const message = err instanceof Error ? err.message : String(err);
49
+ console.error(`Error: ${message}`);
50
+ process.exit(1);
51
+ }
52
+ });
53
+ program.parse();
4
54
  //# 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,qEAAqE,CAAC,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,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,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,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAA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E,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAC9D,CAAC,CACF,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAC;QACpF,CAAC;aAAM,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,6FAA6F,CAAC,CAAC;QAC9G,CAAC;QAED,OAAO,CAAC,GAAG,CACT,SAAS,MAAM,CAAC,QAAQ,CAAC,MAAM,eAAe;YAC5C,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,YAAY;YAClC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,UAAU,CACnC,CAAC;QAEF,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QAC/D,MAAM,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAE7C,OAAO,CAAC,GAAG,CAAC,cAAc,UAAU,EAAE,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,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;AAmGlC;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAiCjF"}
@@ -0,0 +1,97 @@
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 escapeStringLiteral(value) {
24
+ return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
25
+ }
26
+ function emitEnum(enumType) {
27
+ const values = enumType.values
28
+ .map((v) => `"${escapeStringLiteral(v)}"`)
29
+ .join(" | ");
30
+ return `export type ${enumType.name} = ${values};`;
31
+ }
32
+ function emitServiceDefinition(parsed) {
33
+ const lines = [];
34
+ const defName = parsed.services.length === 1
35
+ ? `${parsed.services[0].name}Definition`
36
+ : "GeneratedServiceDefinition";
37
+ lines.push(`export interface ${defName} extends ServiceDefinition {`);
38
+ for (const service of parsed.services) {
39
+ lines.push(`${indent(1)}${service.name}: {`);
40
+ for (const port of service.ports) {
41
+ lines.push(`${indent(2)}${port.name}: {`);
42
+ for (const op of port.operations) {
43
+ lines.push(`${indent(3)}${op.name}: {`);
44
+ lines.push(`${indent(4)}input: ${op.input.name};`);
45
+ lines.push(`${indent(4)}output: ${op.output.name};`);
46
+ lines.push(`${indent(3)}};`);
47
+ }
48
+ lines.push(`${indent(2)}};`);
49
+ }
50
+ lines.push(`${indent(1)}};`);
51
+ }
52
+ lines.push("}");
53
+ return lines.join("\n");
54
+ }
55
+ function emitFactoryFunction(parsed) {
56
+ const defName = parsed.services.length === 1
57
+ ? `${parsed.services[0].name}Definition`
58
+ : "GeneratedServiceDefinition";
59
+ const clientType = parsed.services.length === 1
60
+ ? `${parsed.services[0].name}Client`
61
+ : "GeneratedClient";
62
+ const factoryName = parsed.services.length === 1
63
+ ? `create${parsed.services[0].name}Client`
64
+ : "createGeneratedClient";
65
+ const lines = [];
66
+ lines.push(`export type ${clientType} = InferClient<${defName}>;`);
67
+ lines.push("");
68
+ lines.push(`export async function ${factoryName}(wsdlUrl: string, options?: SoapClientOptions): Promise<${clientType}> {`);
69
+ lines.push(`${indent(1)}return createSoapClient<${defName}>(wsdlUrl, options);`);
70
+ lines.push("}");
71
+ return lines.join("\n");
72
+ }
73
+ /**
74
+ * Generates a complete TypeScript source file from a parsed WSDL.
75
+ */
76
+ export function generateTypeScript(parsed, sourceWsdl) {
77
+ const emittedTypes = new Set();
78
+ const sections = [];
79
+ 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";`, "");
80
+ for (const enumType of parsed.enums) {
81
+ sections.push(emitEnum(enumType));
82
+ sections.push("");
83
+ }
84
+ for (const type of parsed.types) {
85
+ if (!emittedTypes.has(type.name)) {
86
+ sections.push(emitInterface(type));
87
+ sections.push("");
88
+ emittedTypes.add(type.name);
89
+ }
90
+ }
91
+ sections.push(emitServiceDefinition(parsed));
92
+ sections.push("");
93
+ sections.push(emitFactoryFunction(parsed));
94
+ sections.push("");
95
+ return sections.join("\n");
96
+ }
97
+ //# 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,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,aAAa,CAAC,KAAkB,EAAE,WAAmB;IAC5D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CACR,GAAG,MAAM,CAAC,WAAW,CAAC,iEAAiE,CACxF,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7C,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9C,KAAK,CAAC,IAAI,CACR,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,QAAQ,KAAK,KAAK,CAAC,MAAM,GAAG,WAAW,GAAG,CACjF,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,aAAa,CAAC,IAAgB;IACrC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;IAC9C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,GAAG,CA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,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAElB,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Writes generated TypeScript source to a file, creating
3
+ * parent directories as needed.
4
+ */
5
+ export declare function writeGeneratedFile(filePath: string, content: string): Promise<void>;
6
+ //# sourceMappingURL=writer.d.ts.map
@@ -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,OAAO;IACP,MAAM;IACN,aAAa;IACb,eAAe;IACf,cAAc;IACd,OAAO;IACP,QAAQ;CACT,CAAC,CAAC;AAEH,+DAA+D;AAC/D,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC1C,MAAM;IACN,cAAc;IACd,SAAS;IACT,SAAS;IACT,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;IACjB,oBAAoB;CACrB,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAEjD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,QAAQ;IACR,kBAAkB;IAClB,OAAO;IACP,UAAU;IACV,M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;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,39 @@
1
+ export interface ParsedField {
2
+ name: string;
3
+ tsType: string;
4
+ isArray: boolean;
5
+ isOptional: boolean;
6
+ precisionRisk: boolean;
7
+ }
8
+ export interface ParsedType {
9
+ name: string;
10
+ fields: ParsedField[];
11
+ }
12
+ export interface ParsedEnum {
13
+ name: string;
14
+ values: string[];
15
+ }
16
+ export interface ParsedOperation {
17
+ name: string;
18
+ input: ParsedType;
19
+ output: ParsedType;
20
+ }
21
+ export interface ParsedPort {
22
+ name: string;
23
+ operations: ParsedOperation[];
24
+ }
25
+ export interface ParsedService {
26
+ name: string;
27
+ ports: ParsedPort[];
28
+ }
29
+ export interface ParsedWsdl {
30
+ services: ParsedService[];
31
+ enums: ParsedEnum[];
32
+ types: ParsedType[];
33
+ }
34
+ /**
35
+ * Loads a WSDL file (local path or URL) and returns a normalized IR
36
+ * representing all services, ports, operations, and types.
37
+ */
38
+ export declare function parseWsdl(wsdlPath: string): Promise<ParsedWsdl>;
39
+ //# 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,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,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;AA4UD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA4ErE"}
@@ -0,0 +1,294 @@
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 (err) {
50
+ if (err instanceof TypeError) {
51
+ return null;
52
+ }
53
+ throw err;
54
+ }
55
+ return null;
56
+ }
57
+ function extractFromSchemaSection(section, map) {
58
+ if (!section || typeof section !== "object")
59
+ return;
60
+ for (const [name, def] of Object.entries(section)) {
61
+ const fields = extractFields(def);
62
+ if (fields.length > 0) {
63
+ map.set(name, { fields });
64
+ }
65
+ }
66
+ }
67
+ function extractFields(node) {
68
+ if (!node || typeof node !== "object")
69
+ return [];
70
+ const obj = node;
71
+ const children = obj.children;
72
+ if (!children)
73
+ return [];
74
+ const fields = [];
75
+ for (const child of children) {
76
+ const childObj = child;
77
+ if (childObj.$name && childObj.$type) {
78
+ fields.push({
79
+ name: childObj.$name,
80
+ type: childObj.$type,
81
+ minOccurs: childObj.$minOccurs,
82
+ maxOccurs: childObj.$maxOccurs,
83
+ });
84
+ }
85
+ const nested = extractFields(child);
86
+ fields.push(...nested);
87
+ }
88
+ return fields;
89
+ }
90
+ const TS_RESERVED_WORDS = new Set([
91
+ "break", "case", "catch", "class", "const", "continue", "debugger",
92
+ "default", "delete", "do", "else", "enum", "export", "extends",
93
+ "false", "finally", "for", "function", "if", "import", "in",
94
+ "instanceof", "new", "null", "return", "super", "switch", "this",
95
+ "throw", "true", "try", "typeof", "var", "void", "while", "with",
96
+ "yield", "let", "static", "implements", "interface", "package",
97
+ "private", "protected", "public", "type",
98
+ ]);
99
+ const TS_GLOBAL_TYPES = new Set([
100
+ "Date", "Error", "Map", "Set", "Array", "Object", "Function",
101
+ "Number", "String", "Boolean", "Symbol", "Promise", "RegExp",
102
+ "Buffer", "Record", "Partial", "Required", "Readonly", "Pick",
103
+ "Omit", "Exclude", "Extract", "NonNullable", "ReturnType",
104
+ "InstanceType", "Parameters",
105
+ ]);
106
+ /**
107
+ * Converts a string to PascalCase, splitting on hyphens, dots,
108
+ * underscores, and whitespace.
109
+ */
110
+ function pascalCase(str) {
111
+ return str
112
+ .split(/[-._\s]+/)
113
+ .filter(Boolean)
114
+ .map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1))
115
+ .join("");
116
+ }
117
+ /**
118
+ * Ensures a string is a valid TypeScript identifier.
119
+ * Strips invalid characters, handles leading digits,
120
+ * and avoids TS reserved words (for type names).
121
+ */
122
+ function sanitizeTypeName(raw) {
123
+ let name = pascalCase(raw);
124
+ name = name.replace(/[^a-zA-Z0-9_$]/g, "");
125
+ if (!name || /^[0-9]/.test(name)) {
126
+ name = "_" + name;
127
+ }
128
+ if (TS_RESERVED_WORDS.has(name)) {
129
+ name = name + "Type";
130
+ }
131
+ if (TS_GLOBAL_TYPES.has(name)) {
132
+ name = name + "Type";
133
+ }
134
+ return name;
135
+ }
136
+ /**
137
+ * Sanitizes a field name for use in a TypeScript interface.
138
+ * TS allows reserved words as property names, so we only strip
139
+ * characters that are invalid in identifiers and handle leading digits.
140
+ */
141
+ function sanitizeFieldName(raw) {
142
+ let name = raw.replace(/[^a-zA-Z0-9_$]/g, "_");
143
+ if (!name || /^[0-9]/.test(name)) {
144
+ name = "_" + name;
145
+ }
146
+ return name;
147
+ }
148
+ /**
149
+ * Parses an element descriptor from `client.describe()`,
150
+ * cross-referencing with the schema map for type names and optionality.
151
+ */
152
+ function parseFieldDescriptor(fieldName, descriptor, collectedTypes, collectedEnums, schemaMap, parentSchemaInfo) {
153
+ const isArray = fieldName.endsWith("[]");
154
+ const cleanName = isArray ? fieldName.slice(0, -2) : fieldName;
155
+ const safeName = sanitizeFieldName(cleanName);
156
+ const schemaField = parentSchemaInfo?.fields.find((f) => f.name === cleanName);
157
+ const isOptional = schemaField?.minOccurs === "0";
158
+ if (typeof descriptor === "string") {
159
+ const enumMatch = descriptor.match(/^(\w+)\|[^|]+\|(.+)$/);
160
+ if (enumMatch) {
161
+ const enumName = sanitizeTypeName(enumMatch[1]);
162
+ const values = enumMatch[2].split(",");
163
+ if (!collectedEnums.has(enumName)) {
164
+ collectedEnums.set(enumName, { name: enumName, values });
165
+ }
166
+ return {
167
+ name: safeName,
168
+ tsType: enumName,
169
+ isArray,
170
+ isOptional,
171
+ precisionRisk: false,
172
+ };
173
+ }
174
+ const localName = stripNamespace(descriptor);
175
+ const primitive = resolveXsdPrimitive(localName);
176
+ if (primitive) {
177
+ return {
178
+ name: safeName,
179
+ tsType: primitive.tsType,
180
+ isArray,
181
+ isOptional,
182
+ precisionRisk: primitive.precisionRisk,
183
+ };
184
+ }
185
+ return {
186
+ name: safeName,
187
+ tsType: localName,
188
+ isArray,
189
+ isOptional,
190
+ precisionRisk: false,
191
+ };
192
+ }
193
+ if (typeof descriptor === "object" && descriptor !== null) {
194
+ let typeName;
195
+ if (schemaField?.type) {
196
+ const localTypeName = stripNamespace(schemaField.type);
197
+ typeName = sanitizeTypeName(localTypeName);
198
+ }
199
+ else {
200
+ typeName = sanitizeTypeName(cleanName);
201
+ }
202
+ if (!collectedTypes.has(typeName)) {
203
+ const placeholder = { name: typeName, fields: [] };
204
+ collectedTypes.set(typeName, placeholder);
205
+ const nestedSchemaInfo = schemaMap.get(typeName) ?? schemaMap.get(cleanName);
206
+ const fields = parseObjectDescriptor(descriptor, collectedTypes, collectedEnums, schemaMap, nestedSchemaInfo);
207
+ placeholder.fields = fields;
208
+ }
209
+ return {
210
+ name: safeName,
211
+ tsType: typeName,
212
+ isArray,
213
+ isOptional,
214
+ precisionRisk: false,
215
+ };
216
+ }
217
+ return {
218
+ name: safeName,
219
+ tsType: "unknown",
220
+ isArray,
221
+ isOptional,
222
+ precisionRisk: false,
223
+ };
224
+ }
225
+ function parseObjectDescriptor(obj, collectedTypes, collectedEnums, schemaMap, parentSchemaInfo) {
226
+ const fields = [];
227
+ for (const [key, value] of Object.entries(obj)) {
228
+ if (key.startsWith("$") || key === "targetNSAlias" || key === "targetNamespace") {
229
+ continue;
230
+ }
231
+ fields.push(parseFieldDescriptor(key, value, collectedTypes, collectedEnums, schemaMap, parentSchemaInfo));
232
+ }
233
+ return fields;
234
+ }
235
+ /**
236
+ * Picks a unique type name for an operation's input/output.
237
+ * If the base name already exists in collectedTypes, prefixes
238
+ * with the port name to disambiguate (BUG 2 FIX).
239
+ */
240
+ function uniqueTypeName(baseName, portName, collectedTypes) {
241
+ if (!collectedTypes.has(baseName)) {
242
+ return baseName;
243
+ }
244
+ return `${portName}${baseName}`;
245
+ }
246
+ /**
247
+ * Loads a WSDL file (local path or URL) and returns a normalized IR
248
+ * representing all services, ports, operations, and types.
249
+ */
250
+ export async function parseWsdl(wsdlPath) {
251
+ const client = await soap.createClientAsync(wsdlPath);
252
+ const description = client.describe();
253
+ const schemaMap = buildSchemaMap(client);
254
+ const collectedTypes = new Map();
255
+ const collectedEnums = new Map();
256
+ const services = [];
257
+ for (const [serviceName, serviceDesc] of Object.entries(description)) {
258
+ const ports = [];
259
+ for (const [portName, portDesc] of Object.entries(serviceDesc)) {
260
+ const operations = [];
261
+ for (const [opName, opDesc] of Object.entries(portDesc)) {
262
+ const opObj = opDesc;
263
+ const inputDesc = opObj.input ?? {};
264
+ const outputDesc = opObj.output ?? {};
265
+ const elementNames = resolveElementNames(client, serviceName, portName, opName);
266
+ const inputElementName = elementNames?.input ?? `${opName}Request`;
267
+ const outputElementName = elementNames?.output ?? `${opName}Response`;
268
+ const inputTypeName = uniqueTypeName(sanitizeTypeName(inputElementName), portName, collectedTypes);
269
+ const outputTypeName = uniqueTypeName(sanitizeTypeName(outputElementName), portName, collectedTypes);
270
+ const inputSchemaInfo = schemaMap.get(inputElementName) ?? schemaMap.get(inputTypeName);
271
+ const outputSchemaInfo = schemaMap.get(outputElementName) ?? schemaMap.get(outputTypeName);
272
+ const inputFields = parseObjectDescriptor(inputDesc, collectedTypes, collectedEnums, schemaMap, inputSchemaInfo);
273
+ const outputFields = parseObjectDescriptor(outputDesc, collectedTypes, collectedEnums, schemaMap, outputSchemaInfo);
274
+ const inputType = { name: inputTypeName, fields: inputFields };
275
+ const outputType = { name: outputTypeName, fields: outputFields };
276
+ collectedTypes.set(inputTypeName, inputType);
277
+ collectedTypes.set(outputTypeName, outputType);
278
+ operations.push({
279
+ name: opName,
280
+ input: inputType,
281
+ output: outputType,
282
+ });
283
+ }
284
+ ports.push({ name: portName, operations });
285
+ }
286
+ services.push({ name: serviceName, ports });
287
+ }
288
+ return {
289
+ services,
290
+ enums: Array.from(collectedEnums.values()),
291
+ types: Array.from(collectedTypes.values()),
292
+ };
293
+ }
294
+ //# 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;AA4DhF;;;;GAIG;AACH,SAAS,cAAc,CAAC,MAAmB;IACzC,MAAM,GAAG,GAAc,IAAI,GAAG,EAAE,CAAC;IACjC,MAAM,IAAI,GAAG,MAAM,CAAC,IAA0C,CAAC;IAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,WAAkD,CAAC;IAC5E,MAAM,OAAO,GAAG,WAAW,EAAE,OAEhB,CAAC;IAEd,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,CAAC;IAEzB,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5C,wBAAwB,CAAC,MAAM,CAAC,YAA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,eAAe,CAChB,CAAC;gBACF,MAAM,YAAY,GAAG,qBAAqB,CACxC,UAAU,EACV,cAAc,EACd,cAAc,EACd,SAAS,EACT,gBAAgB,CACjB,CAAC;gBAEF,MAAM,SAAS,GAAe,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;gBAC3E,MAAM,UAAU,GAAe,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;gBAE9E,cAAc,CAAC,GAAG,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;gBAC7C,cAAc,CAAC,GAAG,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;gBAE/C,UAAU,CAAC,IAAI,CAAC;oBACd,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,SAAS;oBAChB,MAAM,EAAE,UAAU;iBACnB,CAAC,CAAC;YACL,CAAC;YAED,KAAK,CAAC,IAAI,CAAC,EAAE,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.1",
3
+ "version": "0.0.3",
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",
@@ -14,17 +14,24 @@
14
14
  "generator"
15
15
  ],
16
16
  "type": "module",
17
+ "files": [
18
+ "dist"
19
+ ],
17
20
  "bin": {
18
21
  "tsoap": "./dist/cli.js"
19
22
  },
20
23
  "dependencies": {
21
- "soap": "^1.1.6",
22
- "typescript": "^5.9.2"
24
+ "commander": "^13.1.0",
25
+ "soap": "^1.1.6"
23
26
  },
24
27
  "devDependencies": {
25
- "@types/node": "^18.0.0"
28
+ "@types/node": "^18.0.0",
29
+ "typescript": "^5.9.2"
26
30
  },
27
31
  "license": "MIT",
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
28
35
  "repository": {
29
36
  "type": "git",
30
37
  "url": "https://github.com/Deodat-Lawson/tsoap.git",
package/src/cli.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- console.log("tsoap CLI — WSDL-to-TypeScript code generator (not yet implemented)");
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "outDir": "dist"
6
- },
7
- "include": ["src"]
8
- }