From d3157095df18d98a83df7739ec1d4c748199353d Mon Sep 17 00:00:00 2001 From: Sander van Driel Date: Tue, 7 May 2024 16:49:44 +0200 Subject: [PATCH 1/4] refactor: extract getInputDefinition --- src/parser.ts | 98 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 40 deletions(-) diff --git a/src/parser.ts b/src/parser.ts index dadc95b..966d859 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -1,6 +1,6 @@ import * as path from "path"; import { ComplexTypeElement } from "soap/lib/wsdl/elements"; -import { open_wsdl } from "soap/lib/wsdl/index"; +import { WSDL, open_wsdl } from "soap/lib/wsdl/index"; import { Definition, Method, ParsedWsdl, Port, Service } from "./models/parsed-wsdl"; import { changeCase } from "./utils/change-case"; import { stripExtension } from "./utils/file"; @@ -287,54 +287,38 @@ export async function parseWsdl(wsdlPath: string, options: Partial Date: Tue, 7 May 2024 18:19:42 +0200 Subject: [PATCH 2/4] refactor: extract output definitions --- src/parser.ts | 96 +++++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 45 deletions(-) diff --git a/src/parser.ts b/src/parser.ts index 966d859..53280b7 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -1,5 +1,5 @@ import * as path from "path"; -import { ComplexTypeElement } from "soap/lib/wsdl/elements"; +import { ComplexTypeElement, OperationElement } from "soap/lib/wsdl/elements"; import { WSDL, open_wsdl } from "soap/lib/wsdl/index"; import { Definition, Method, ParsedWsdl, Port, Service } from "./models/parsed-wsdl"; import { changeCase } from "./utils/change-case"; @@ -285,16 +285,14 @@ export async function parseWsdl(wsdlPath: string, options: Partial Date: Tue, 7 May 2024 19:44:12 +0200 Subject: [PATCH 3/4] feat: better naming, use object parameters --- src/parser.ts | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/parser.ts b/src/parser.ts index 53280b7..5de96b1 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -290,17 +290,17 @@ export async function parseWsdl(wsdlPath: string, options: Partial Date: Tue, 7 May 2024 20:16:52 +0200 Subject: [PATCH 4/4] chore: remove nullability of output definition --- src/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.ts b/src/parser.ts index 5de96b1..eb0c8b2 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -401,7 +401,7 @@ function createMethodOutputDefinition(opts: { parsedWsdl: ParsedWsdl; mergedOptions: ParserOptions; visitedDefinitions: VisitedDefinition[]; -}): Definition | null { +}): Definition { const { methodOutputName, wsdl, parsedWsdl, mergedOptions, visitedDefinitions } = opts; const outputMessage = wsdl.definitions.messages[methodOutputName]; if (outputMessage.element) {