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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wajunworks/swagger-client

v20241002.0.1

Published

TS Swagger client generator

Downloads

140

Readme

Contributors Forks Stargazers Issues MIT License LinkedIn

About The Project

In modern software development, integrating and maintaining consistent communication between backend services and frontend/mobile applications is crucial. To streamline this process, our project introduces an innovative solution: an automated SDK generator designed specifically for backend teams. This tool leverages the power of Swagger (OpenAPI) specifications to generate NPM packages that serve as SDKs. These SDKs facilitate seamless integration for frontend and mobile teams, promoting efficiency and reducing manual coding efforts.

Key Features

Automated SDK Generation:

The core functionality of our project is to automatically generate a Node.js SDK during the CI/CD pipeline. By utilizing Swagger JSON specifications, the generator creates clean, lightweight, and maintainable code.

CI/CD Integration:

The generator integrates seamlessly with CI/CD pipelines, ensuring that SDKs are up-to-date with the latest API changes. This automation reduces the need for manual intervention and ensures consistency across development environments.

Multi-Platform Support:

The generated SDK is designed to be versatile, supporting usage in both frontend and mobile development environments. It is compatible with any project that uses Node.js, making it a robust solution for various development teams.

Clean and Lightweight Code:

The SDK generator emphasizes producing clean, readable, and efficient code. This focus ensures that the SDK is easy to integrate, extend, and maintain.

Built With

This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

  • Next
  • React
  • Vue
  • Angular
  • Svelte
  • Laravel
  • Bootstrap
  • JQuery

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    npm install npm@latest -g

Installation

Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services.

  1. create a swagger.ts
 const generater = new SwaggerGenerator();
  await generater
    .setOpenApiSpecificationUrl(
      "https://xxx.json"
    )
    .setName("MobileApi")
    .buildAsync();
  1. run the swagger file
npx ts-node -O '{\"module\":\"commonjs\"}' test/Startup.ts
  1. then the client will locale in the project direcotry (/api)

Usage

the client will generate like

export class MobileApiClient {

	get axios(): AxiosInstance;

	get aIDiagnostic(): IAIDiagnosticClient;
	
}

you can use the client in your code like below, you should init the client instance in your framework recommand. like init the client as provider in react.js

const client = new MobileApiClient().

const data = await client.heallthrecord.bloodpressure.listAsync({});

For more examples, please refer to the Documentation

Roadmap

  • [x] Generate Response Result
  • [x] Support Request Path Parameter
  • [x] Support Request Query Parameter
  • [ ] Support Request Body Parameter

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Jack Wong - @j113203 - [email protected]

Project Link: https://github.com/j113203/swagger-client-generator

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

openapi3-ts