a vscode extension for http response data auto transform ts type.

Overview

Api2ts

这是一个自动将 http 的响应数据转化为 ts 的类型,使用 json-to-ts 做的。

Features

框选配置项后,使用快捷键 alt+Q :

useExample

请求参数配置文件

在根目录下创建 Api2ts.config.json 文件,配置项如下:

{
  "baseURL": "https://${host}.com", //后端请求接口域 必填
  "token": "xxxxxxxxx" // 请求headers携带的token 必填
}

请求示例的范本:

const request = {
  method: 'post', // 请求方式 必填
  headers: {
    'Content-Type': 'application/json', // headers头配置 默认是'application/json' 非必填
  },
  url: '/aaa/bbb', // 请求路径 必填
  data: {
    page: 1,
    limit: 20,
    ctParameterCategoryId: 88,
  }, // 请求参数 非必填
};

update 配置文件命令

如若 Api2ts.config.json 配置文件进行修改保存,调出命令面板 cmd + shift + p,敲上 api2ts update 命令,已再次获取 Api2ts.config.json 配置文件。

Enjoy!

You might also like...

A Node.js HTTP proxy that tracks managed PaaS account applications and auto-stop&start them

A Node.js HTTP proxy that tracks managed PaaS account applications and auto-stop&start them

paastis-engine Features Paastis engine is the heart of the Paastis project. Its goal is to monitor and manage (start & stop) PaaS applications based o

Nov 8, 2022

A plugin for Strapi that provides the ability to auto slugify a field for any content type

strapi-plugin-slugify A plugin for Strapi that provides the ability to auto slugify a field for any content type. It also provides a findOne by slug e

Nov 28, 2022

📡Usagi-http-interaction: A library for interacting with Http Interaction API

📡 - A library for interacting with Http Interaction API (API for receiving interactions.)

Oct 24, 2022

A tool to check for response status codes with ease

A tool to check for response status codes with ease

About Archer Archer is an cross-platform tool developed using Nodejs which focuses on the reconnaissance phase of a penetration test. Got a bunch of l

Oct 19, 2022

Ping.js is a small and simple Javascript library for the browser to "ping" response times to web servers in Javascript

Ping.js Ping.js is a small and simple Javascript library for the browser to "ping" response times to web servers in Javascript! This is useful for whe

Dec 27, 2022

Room impulse response measurement in the browser.

Room impulse response measurement - in the browser! Check it out on danielrudrich.github.io/Broom. Behind the scenes Broom uses the WebAudioAPI to pla

Sep 13, 2022

Create a html response with JSX.

Htm Create a text/html response with JSX, powered by Preact and UnoCSS. Usage To use Htm, create a server.tsx file like this: /** @jsx h */ import {

Dec 9, 2022

Uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about their availability, average response time, and total uptime/downtime.

Uptime Monitoring API Uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about thei

Jun 14, 2022

Pfapi plugin uses local and redis caches to achieve single digit milliseconds on average api response time.

Pfapi plugin uses local and redis caches to achieve single digit milliseconds on average api response time.

Strapi plugin pfapi Pfapi plugin provides configurable, secure and fast API services. APIs are configurable through the admin panel with components an

Sep 17, 2022
Comments
  • chore(deps): bump terser from 5.14.1 to 5.14.2

    chore(deps): bump terser from 5.14.1 to 5.14.2

    Bumps terser from 5.14.1 to 5.14.2.

    Changelog

    Sourced from terser's changelog.

    v5.14.2

    • Security fix for RegExps that should not be evaluated (regexp DDOS)
    • Source maps improvements (#1211)
    • Performance improvements in long property access evaluation (#1213)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
phy-lei
phy-lei
A plugin for Strapi Headless CMS that provides the ability to transform the API request or response.

strapi-plugin-transformer A plugin for Strapi that provides the ability to transform the API request and/or response. Requirements The installation re

daedalus 71 Jan 6, 2023
Transform and compose data for HTTP transactions.

Fragments Fragments is a platform to compose and manage custom data objects for HTTP transactions. Simply put, you can write simple jinja templates to

Artem Golub 15 Sep 6, 2022
An automated tool help you to transform backend json data to TypeScript type.

ohmyts An automated tool help you to transform backend json data to TypeScript type. Quick Start Vite install npm i @ohmyts/vite -D ?? playground play

snowingfox 9 Sep 23, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A vscode extension to quickly print variable, variable type, tensor shape etc by using shortcuts

Quick Python Print This repo is inspired by "Python Quick Print". "Python Quick Print" can quickly print out variables on the console by using shortcu

weida wang 5 Oct 28, 2022
VSCode Extension & utilities for exploring TypeScript type information

ts-type-explorer VSCode Extension & utilities to explore type information in TypeScript projects. Installation Check out the releases page to download

Max Stoumen 6 Nov 20, 2022
Modify Request & Response Headers Chrome Extension (Manifest V3)

Modify request & response headers (Chrome Extension Manifest V3) This Chrome extension will add request header and response header to few network requ

Requestly 6 Dec 9, 2022