{"_id":"@benasher44/wsdl-tsclient","name":"@benasher44/wsdl-tsclient","dist-tags":{"latest":"1.4.0"},"versions":{"1.4.0":{"name":"@benasher44/wsdl-tsclient","version":"1.4.0","description":"Generate typescript soap client with typescript definitons from WSDL file.","main":"dist/src/index.js","bin":{"wsdl-tsclient":"dist/src/cli.js"},"engines":{"node":">=10.0.0"},"scripts":{"pretest":"rm -rf ./test/generated","test":"npm run test:node-soap && npm run test:node-soap2 && npm run test:public","test:node-soap":"ts-node node_modules/tape/bin/tape ./test/node-soap/*.test.ts | tap-spec","test:node-soap2":"ts-node node_modules/tape/bin/tape ./test/node-soap/**/*.test.ts | tap-spec","test:public":"ts-node node_modules/tape/bin/tape ./test/resources-public/**/*.test.ts | tap-spec","preversion":"npm test && npm run build","prepublishOnly":"npm test && npm run dist","dev":"ts-node -T ./dev.ts","dist":"tsc","build":"tsc","lint":"eslint ./src","lint:fix":"eslint --fix ./src"},"repository":{"type":"git","url":"git+https://github.com/dderevjanik/wsdl-tsclient.git"},"keywords":["soap","soap-client","wsdl","wsdl-client","typescript"],"author":{"name":"Daniel Derevjanik","email":"daniel.derevjanik@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/dderevjanik/wsdl-tsclient/issues"},"homepage":"https://github.com/dderevjanik/wsdl-tsclient#readme","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.19.0","@typescript-eslint/parser":"^5.19.0","eslint":"^8.13.0","eslint-plugin-prettier":"^4.0.0","prettier":"^2.6.2","tap-spec":"^5.0.0","tape":"^5.5.3","ts-node":"^10.7.0","typescript":"^4.6.3"},"dependencies":{"@types/node":"^17.0.24","@types/supports-color":"^8.1.0","@types/tape":"^4.13.2","@types/yargs":"^16.0.1","camelcase":"^6.3.0","chalk":"^4.1.1","sanitize-filename":"^1.6.3","soap":"^1.0.0","supports-color":"^8.1.1","ts-morph":"^14.0.0","yargs":"^16.2.0"},"types":"./dist/src/index.d.ts","gitHead":"f287f9cb7ae1a9099dcc406bf27c3443efbe224c","_id":"@benasher44/wsdl-tsclient@1.4.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-A04ofY8Es2eEuDDWN5AWrR7IB8SBbS8SpbVoaNKrcHH9WNDsnPxHfMhgnYGNzIqLyvT13nrAB2lolpTgM/7IAw==","shasum":"1f573a82794853793c54f7f3b36f597853623060","tarball":"https://registry.npmjs.org/@benasher44/wsdl-tsclient/-/wsdl-tsclient-1.4.0.tgz","fileCount":54,"unpackedSize":209056,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGW/IPachnx+wZWZBrA7dG1esytryC3GOKMLKBEb34qAIhAMELGRPhJXcfpVcd8e8WkF1eyElyp2UeJqbx1Bz7lPSw"}]},"_npmUser":{"name":"benasher44","email":"hello@benasher.co"},"directories":{},"maintainers":[{"name":"benasher44","email":"hello@benasher.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wsdl-tsclient_1.4.0_1694726898384_0.8362794528333692"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-14T21:28:18.214Z","1.4.0":"2023-09-14T21:28:18.622Z","modified":"2023-09-14T21:28:18.975Z"},"maintainers":[{"name":"benasher44","email":"hello@benasher.co"}],"description":"Generate typescript soap client with typescript definitons from WSDL file.","homepage":"https://github.com/dderevjanik/wsdl-tsclient#readme","keywords":["soap","soap-client","wsdl","wsdl-client","typescript"],"repository":{"type":"git","url":"git+https://github.com/dderevjanik/wsdl-tsclient.git"},"author":{"name":"Daniel Derevjanik","email":"daniel.derevjanik@gmail.com"},"bugs":{"url":"https://github.com/dderevjanik/wsdl-tsclient/issues"},"license":"MIT","readme":"# WSDL TSClient\n\n[![travis-status](https://travis-ci.org/dderevjanik/wsdl-tsclient.svg?branch=master)](https://travis-ci.org/dderevjanik/wsdl-tsclient)\n![license](https://img.shields.io/npm/l/wsdl-tsclient)\n[![Known Vulnerabilities](https://snyk.io/test/github/dderevjanik/wsdl-tsclient/badge.svg)](https://snyk.io/test/github/dderevjanik/wsdl-tsclient)\n[![npm-version](https://img.shields.io/npm/v/wsdl-tsclient)](https://npmjs.com/package/wsdl-tsclient)\n\n**Example how to generate and use wsdl-tsclient:** [wsdl-tsclient-example](https://github.com/dderevjanik/wsdl-tsclient-example)\n\nGenerate a [soap client](https://www.npmjs.com/package/soap) with typescript definitions from a WSDL file.\n\nThis library uses [ts-morph](https://www.npmjs.com/package/ts-morph) to generate typescript code and [soap](https://github.com/vpulim/node-soap) for runtime. Inspired by Java [wsimport](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/wsimport.html) and [openapi-generator](https://github.com/OpenAPITools/openapi-generator).\n\n*NOTE:* Add [soap](https://www.npmjs.com/package/soap) to your npm runtime dependencies (`npm i soap`).\n\n## Install\n\n```sh\nnpm i wsdl-tsclient\n```\n\nor install it with `-g` to have CLI globally available.\n\n```sh\nnpm i -g wsdl-tsclient\n```\n\n## Usage\n\nYou can check example repository [wsdl-tsclient-example](https://github.com/dderevjanik/wsdl-tsclient-example)\n\n### Generate client using CLI\n\nEasiest way to generate client from is to use CLI. You need to provide only path to `.wsdl` file and\npath to output directory (`-o` param). If you want to generate **only typescript types** (no runtime code) for node-soap, you can pass `--emitDefinitionsOnly` param.\n\n`wsdl-tsclient ./soap.wsdl -o ./generated`\n\n`wsdl-tsclient ./resources/**/*.wsdl -o ./generated` - using glob\n\nyou can also use `npx`\n\n`npx wsdl-tsclient ./soap.wsdl -o ./generated`\n\n```bash\nwsdl-tsclient [options] [path]\n\nOptions:\n      --help                        Show help                          [boolean]\n  -v, --version                                                        [boolean]\n  -o                                Output directory         [string] [required]\n      --emitDefinitionsOnly         Generate only Definitions          [boolean]\n      --modelNamePreffix            Prefix for generated interface names[string]\n      --modelNameSuffix             Suffix for generated interface names[string]\n      --caseInsensitiveNames        Case-insensitive name while parsing\n                                    definition names                   [boolean]\n      --maxRecursiveDefinitionName  Maximum count of definition's with same name\n                                    but increased suffix. Will throw an error if\n                                    exceed                              [number]\n      --quiet                       Suppress all logs                  [boolean]\n      --verbose                     Print verbose logs                 [boolean]\n      --no-color                    Logs without colors                [boolean]\n\nExamples:\n    wsdl-tsclient file.wsdl -o ./generated/\n    wsdl-tsclient ./res/**/*.wsdl -o ./generated/\n```\n\n### Generate client programmatically\n\n```typescript\nimport { generateClient } from \"wsdl-tsclient\";\n\nparseAndGenerate(\"./path/to/MyWsdl.wsdl\", \"./generated/\");\n```\n\n### Using generated client in your project\n\n*Note:* Make sure you have [soap](https://www.npmjs.com/package/soap) package in your runtime dependencies (`npm i soap`)\n\n```typescript\nimport { createClientAsync } from \"./generated/MyWsdl\";\n\nconst client = await createClientAsync(\"./path/to/wsdl.wsdl\");\nclient.CallSoapMethodAsync();\n```\n\nSetting basic auth \n\n```typescript\nimport soap from \"soap\";\nimport { createClientAsync } from \"./generated/MyWsdl\";\n\nconst client = await createClientAsync(\"./path/to/wsdl.wsdl\");\n\nconst basicAuth = new soap.BasicAuthSecurity(auth.username, auth.password);\nclient.setSecurity(basicAuth);\n\nclient.CallSoapMethodAsync();\n```\n\nfor more information about the use of the client, read more about [soap](https://github.com/vpulim/node-soap)\n\n## How it works\n\n![overview](./docs/Overview.png)\n\n## License\n\nThe source code is licensed under the [MIT](./LICENSE) license\n\n## Contributors\n\n![Contributors](https://contrib.rocks/image?repo=dderevjanik/wsdl-tsclient)","readmeFilename":"README.md"}