New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

auto-pi

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-pi

send http request easier by openApi

latest
Source
npmnpm
Version
0.1.7
Version published
Maintainers
1
Created
Source

AutoPi_0.1.2

安装

npm i auto-pi

使用

import {useAutoAxios} from "auto-pi"

const autoAxios = useAutoAxios(axiosInstance, API)

api文档

/**
 * 创建autoAxios实例
 * @param axiosInstance 通过axios.create创建的实列
 * @param openApiJsonDataList openApi配置文件v2链表
 * @return {AutoAxios}
 */
export function useAutoAxios(axiosInstance: axiosInstance, openApiJsonDataList: apiDocs[]): AutoAxios;

/**
 * 发送请求
 * @param url 请求路径
 * @param data 发送数据,不关心位置,自动分配
 * @param tempConfig 覆盖axios的属性,一般不传
 */
autoAxios.sendAxios(url: string, data: object|array, tempConfig: object): Promise<unknown>;

/**
 * 批量发送请求
 * @param {[{url,data,tempConfig}]} arr
 */
autoAxios.sendAll(arr: [{url;data;tempConfig;}]): Promise<any>;

/**
 * 以formData形式发送文件(不入队列)
 */
autoAxios.sendFile(url: string, data: object, tempConfig: object): Promise<any>;

Keywords

utils

FAQs

Package last updated on 06 Dec 2023

Related posts