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

swagger2teams

v0.2.7

Published

This is a CLI tool to convert swagger yaml file to Teams App command bot project with adaptive cards based on [TeamsFx](https://github.com/OfficeDev/TeamsFx).

Downloads

4

Readme

Introduction

This is a CLI tool to convert swagger yaml file to Teams App command bot project with adaptive cards based on TeamsFx.

Prerequisite

Quick Start

  • Install the CLI

    npm install swagger2teams@latest -g
  • Clone and download sample swagger yaml files

    git clone https://github.com/SLdragon/test-swagger-yaml-files
  • Go to test-swagger-yaml-files folder, and run the command below to convert test4.yml file to Teams App, it will generate teams project to generated-teams-app folder

    cd test-swagger-yaml-files
    swagger2teams test4.yml
  • You can specify which folder to generate teams project as below

    swagger2teams test4.yml -o my-custom-teams-app-folder
  • If you have other personal swagger yaml files, you can also use this CLI tool to covert them.

Run Generated Teams App

  • Open generated folder in VSCode, and make sure you have installed Teams Toolkit (4.x.x).

  • Click F5 in VSCode to run the Teams App to view the result (Below is the example of teams app converted by test4.yml file)

    • Send message GET /pets/1 to Bot, bot will send a response adaptive card:

    • Send message GET /pets to Bot, it will first send request a request adaptive card:

    • Input value in the request adaptive card, and then click GET button, it will send back response adaptive card:

    • Input url https://petstore.swagger.io/pets/1 inside message box, you can see the link unfurling:

Current Limitations

  • Adaptive card doesn't support file upload, so if api contains file upload, then it cannot be converted to adaptive card

  • For request card, there is no proper element to represent array type in adaptive card, so user need to input the array value manually

  • It will not generate backend api calls due to swagger may contains auth, which is not easy to handle. So we will only provide a mock function and user need to manually update the mock to call real backend api.

  • Some APIs may have conflict for the command trigger pattern. For example in test.yml file, GET /user/login and GET /user/{username} has conflict, the convert tool cannot easily to distinguish these two APIs.

  • Do not support keyword oneOf, anyOf, not because there is no better ways to represent it in adaptive cards, only support allOf keyword

  • Cannot remove link unfurling caches due to lack document about how to remove it, and there is an issue to track this: https://github.com/MicrosoftDocs/msteams-docs/issues/8108

  • Command intellisense can only contain max 10 items due to Teams limitation

References