wsdl-to-ts
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -14,2 +14,3 @@ #!/usr/bin/env node | ||
if (args.version) { | ||
/* tslint:disable:no-var-requires */ | ||
const pack = require("../package.json"); | ||
@@ -34,2 +35,5 @@ console.log("%s %s", "wsdl-to-ts", pack.version); | ||
} | ||
if (args.outdir || args.outDir) { | ||
config.outdir = args.outdir || args.outDir; | ||
} | ||
if (args._) { | ||
@@ -36,0 +40,0 @@ config.files.push.apply(config.files, args._); |
@@ -235,13 +235,4 @@ "use strict"; | ||
const t = typeof a[k]; | ||
if (t === "object") { | ||
if (Array.isArray(a[k])) { | ||
b[k] = a[k].slice(); | ||
} | ||
else { | ||
b[k] = cloneObj(a[k]); | ||
} | ||
} | ||
else { | ||
b[k] = a[k]; | ||
} | ||
b[k] = t === "object" ? | ||
Array.isArray(a[k]) ? a[k].slice() : cloneObj(a[k]) : a[k]; | ||
} | ||
@@ -248,0 +239,0 @@ return b; |
{ | ||
"name": "wsdl-to-ts", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Build TypeScript typings for SOAP WSDL", | ||
"main": "lib/index.js", | ||
"main": "lib/wsdl-to-ts.js", | ||
"scripts": { | ||
@@ -13,3 +13,7 @@ "test": "node test/index.js", | ||
}, | ||
"author": "TimLuq", | ||
"keywords": ["soap", "typescript"], | ||
"author": { | ||
"name": "TimLuq", | ||
"url": "https://github.com/TimLuq" | ||
}, | ||
"license": "ISC", | ||
@@ -27,3 +31,10 @@ "devDependencies": { | ||
"soap": "^0.19.1" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/TimLuq/wsdl-to-ts/issues" | ||
}, | ||
"repository": { | ||
"type" : "git", | ||
"url" : "https://github.com/TimLuq/wsdl-to-ts.git" | ||
} | ||
} |
# wsdl-to-ts | ||
A CLI tool and library for nodejs to generate TypeScript typings from a WSDL service. | ||
A CLI tool and library for nodejs to generate TypeScript typings from a WSDL service. | ||
## Installation | ||
Installation is done through [npm](https://npmjs.com). | ||
### Installation for Command Line usage | ||
To install CLI tool globally run the following command as root or sudo: | ||
```sh | ||
$ npm install -g wsdl-to-ts | ||
``` | ||
To install CLI tool for the current user this command may be used (which places working directory at users `$HOME`): | ||
```sh | ||
$ cd && npm install wsdl-to-ts | ||
``` | ||
### Installation for Library usage | ||
To install a library as a dependency to your current npm project you enter your project directory as the current directory and run the following commands: | ||
```sh | ||
$ npm install --save wsdl-to-ts | ||
``` | ||
## Usage | ||
If any more documentation is needed for library usage, other than the IDE completions; feel free to open an [issue](https://github.com/TimLuq/wsdl-to-ts/issues). | ||
### Usage for Command Line | ||
Check version: | ||
```sh | ||
$ wsdl-to-ts --version | ||
``` | ||
Generate typings for a WSDL located on an URI at the default output directory (multiple may be done at the same time by listing more on the command line): | ||
```sh | ||
$ cd /tmp | ||
$ wsdl-to-ts "https://www.w3schools.com/xml/tempconvert.asmx?WSDL" | ||
$ ls wsdl/**/* | ||
wsdl/TempConvert/TempConvertSoap12.ts wsdl/TempConvert/TempConvertSoap.ts | ||
``` | ||
The output directory may be changed to any directory using the `--outdir` flag. | ||
```sh | ||
$ wsdl-to-ts --outdir="./some/other/dir" "https://www.w3schools.com/xml/tempconvert.asmx?WSDL" | ||
``` | ||
#### CLI flags | ||
* `--version` - Display which version you are currently executing. | ||
* `--outdir=SOME/DIR/PATH` - Sets the path which will contain the type definitions. | ||
* `--tslint=RULE0,RULE1,RULE2` - Enable specified rules in all generated files. | ||
* `--tslint=false` - Disables tslint in all generated files. | ||
* `--tslint-disable=RULE0,RULE1,RULE2` - Disable specified rules in all generated files. |
#!/usr/bin/env node | ||
/* tslint:disable:no-var-requires */ | ||
import { rename, writeFile } from "fs"; | ||
@@ -26,2 +24,3 @@ import * as minimist from "minimist"; | ||
if (args.version) { | ||
/* tslint:disable:no-var-requires */ | ||
const pack = require("../package.json"); | ||
@@ -47,2 +46,6 @@ console.log("%s %s", "wsdl-to-ts", pack.version); | ||
if (args.outdir || args.outDir) { | ||
config.outdir = args.outdir || args.outDir; | ||
} | ||
if (args._) { | ||
@@ -49,0 +52,0 @@ config.files.push.apply(config.files, args._); |
@@ -257,11 +257,4 @@ import * as soap from "soap"; | ||
const t = typeof a[k]; | ||
if (t === "object") { | ||
if (Array.isArray(a[k])) { | ||
b[k] = a[k].slice(); | ||
} else { | ||
b[k] = cloneObj(a[k]); | ||
} | ||
} else { | ||
b[k] = a[k]; | ||
} | ||
b[k] = t === "object" ? | ||
Array.isArray(a[k]) ? a[k].slice() : cloneObj(a[k]) : a[k]; | ||
} | ||
@@ -268,0 +261,0 @@ return b; |
{ | ||
"defaultSeverity": "error", | ||
"extends": [ | ||
"tslint:latest" | ||
"tslint:recommended" | ||
], | ||
@@ -6,0 +6,0 @@ "jsRules": {}, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
60589
1
1
56
1
919