npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jointly/gen-ts-from-wsdl

v1.1.0

Published

A command-line tool to generate TypeScript interfaces from WSDL files for SOAP services

Downloads

64

Readme

@jointly/gen-ts-from-wsdl

npm version License: MIT

A powerful command-line tool and Node.js library to generate TypeScript interfaces and types from WSDL (Web Services Description Language) files for SOAP services.

Features

  • 🔄 WSDL Parsing: Parse WSDL files from local paths or URLs
  • 📝 TypeScript Generation: Generate clean, typed TypeScript interfaces
  • 🏗️ Complex Types Support: Handle complex XML Schema types and nested structures
  • 🎯 Simple Types Support: Convert XML Schema simple types with restrictions
  • 📨 Message Types: Generate types for SOAP messages
  • ⚙️ Operation Interfaces: Optional generation of service operation interfaces
  • 📦 Namespace Support: Organize generated types with custom namespaces
  • 🔧 CLI & Programmatic: Use as a command-line tool or Node.js library

Installation

Global Installation (CLI)

npm install -g @jointly/gen-ts-from-wsdl

Local Installation (Project Dependency)

npm install @jointly/gen-ts-from-wsdl
yarn add @jointly/gen-ts-from-wsdl

Usage

Command Line Interface

Using npx (No Installation Required)

You can run the tool directly without installing it globally using npx:

npx @jointly/gen-ts-from-wsdl <wsdl-file-or-url> [options]
npx Examples
# Generate types from a local WSDL file
npx @jointly/gen-ts-from-wsdl ./service.wsdl

# Generate types from a URL with custom output
npx @jointly/gen-ts-from-wsdl https://example.com/service.wsdl -o ./types/soap-api.ts

# Generate with namespace and operations
npx @jointly/gen-ts-from-wsdl ./service.wsdl -n ApiTypes --include-operations

# Generate with strict mode for optional properties
npx @jointly/gen-ts-from-wsdl ./service.wsdl --strict

Basic Usage (Global Installation)

gen-ts-from-wsdl <wsdl-file-or-url> [options]

Examples

# Generate types from a local WSDL file
gen-ts-from-wsdl ./service.wsdl

# Generate types from a URL
gen-ts-from-wsdl https://example.com/service.wsdl

# Specify custom output file
gen-ts-from-wsdl ./service.wsdl -o ./generated/soap-types.ts

# Add namespace and include operations
gen-ts-from-wsdl ./service.wsdl -n MyService --include-operations

# Enable strict mode for optional properties
gen-ts-from-wsdl ./service.wsdl --strict

# Disable code prettification
gen-ts-from-wsdl ./service.wsdl --no-prettify

CLI Options

| Option | Alias | Description | Default | |--------|-------|-------------|---------| | --output | -o | Output file path | ./types.ts | | --namespace | -n | Namespace for generated types | (none) | | --include-operations | | Include operation interfaces | false | | --strict | | Enable strict mode for optional properties | false | | --no-prettify | | Disable code prettification | false |

Programmatic Usage

import { WSDLParser, TypeScriptGenerator, GeneratorOptions } from '@jointly/gen-ts-from-wsdl';

async function generateTypes() {
  const parser = new WSDLParser();
  const generator = new TypeScriptGenerator();

  // Parse WSDL
  const parsedWSDL = await parser.parseWSDL('./service.wsdl');

  // Configure generation options
  const options: GeneratorOptions = {
    outputPath: './generated-types.ts',
    namespace: 'MyServiceTypes',
    includeOperations: true,
    prettify: true,
  };

  // Generate TypeScript types
  await generator.writeTypesToFile(parsedWSDL, './generated-types.ts', options);
}

generateTypes().catch(console.error);

Generated Output

The tool generates TypeScript interfaces based on the WSDL schema definitions:

Complex Types

export interface UserInfo {
  id: number;
  name: string;
  email?: string;
  roles: string[];
}

Simple Types with Restrictions

export type UserStatus = 'active' | 'inactive' | 'pending';

export type UserId = string; // Pattern: /^[A-Z]{2}\d{6}$/

Message Types

export interface GetUserRequest {
  userId: string;
}

export interface GetUserResponse {
  user: UserInfo;
  success: boolean;
}

Operation Interfaces (Optional)

export interface UserServiceOperations {
  GetUser(request: GetUserRequest): Promise<GetUserResponse>;
  UpdateUser(request: UpdateUserRequest): Promise<UpdateUserResponse>;
}

Configuration

Generator Options

interface GeneratorOptions {
  outputPath: string;           // Output file path
  namespace?: string;           // Optional namespace wrapper
  includeOperations?: boolean;  // Include operation interfaces
  strict?: boolean;            // Enable strict mode for optional properties
  prettify?: boolean;          // Format generated code
}

Development

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

# Clone the repository
git clone https://github.com/JointlyTech/gen-ts-from-wsdl.git
cd gen-ts-from-wsdl

# Install dependencies
npm install

# Build the project
npm run build

# Execute the CLI
npm run start

# Or build and start
npm run dev

Scripts

  • npm run build - Compile TypeScript to JavaScript

  • npm run start - Run the compiled CLI tool

  • npm run dev - Compile and run the CLI

  • npm run release:patch|minor|major - Release new version

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Contributors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Made with ❤️ by Jointly