
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
api-runtime
Advanced tools
@ali/api-loader 的运行时支持, 目前包含两种基础类型请求 ajax 和 jsonp 和一个 mock
/**
* @kind ajax
* @host https://example.alibaba-inc.com
* @basUrl /api/v1
*/
declare class ChargeDataApi {
/**
* 根据用户名称和年份查询用电分布
* @url /chart.json
* @method get
* @param user 查询的用户
* @param year 查询的年份
* @paramsSerializer indices
*/
getChargeData(user: string, year: number): Promise<{ chart: IChargeData[] }>;
}
/**
* 根据用户 id 查询信息, 函数参数会作为 path_param 嵌入到 url 中
* @url /{uid}/audiocards.json
* @param uid 用户工号
*/
getAudioCards(uid: string): Promise<TVideoCards>;
基于 @ali/shimmer
declare class ChargeDataApi {
/**
* 根据用户名称和年份查询用电分布
* @kind jsonp
* @url /chart.json
* @prefix __jp
* @timeout 60000
* @param user 查询的用户
* @param year 查询的年份
*/
getChargeData(user: string, year: number): Promise<{ chart: IChargeData[] }>;
}
window.__mock__ = 1 或 class/method 有注释 @mock true, 则该接口会根据声明的 typescript 返回类型信息生成随机内容.<script src="https://g.alicdn.com/code/lib/Mock.js/1.0.0/mock-min.js"></script> 则 string 类型支持注释项 @mockjs, 例如:export type User = {
/** @mockjs cname */
name: string,
/** @mockjs ctitle */
title: string,
/** @mockjs image */
icon: string,
/** @mockjs city */
home: string,
/** @mockjs email */
email: string
}[]
更多 mockjs 项如 dataimage 等请参考 mockjs方法
0.1.5 ✨enum 类型支持; mock 增强支持数组定义长度 0.1.2 ✨ajax spread 和 path_variable 支持混用 ✨mock fix any 类型 mock 出错 0.1.0 ✨ajax 增加 spread 配置项 https://yuque.antfin-inc.com/recore/docs/api-loader#ae4dcc0a ✨ajax 增加 didCatch 配置项 0.0.11 ✨注解返回类型自适应,避免注解 class 和 function 报错 void 不适用于 xxx 0.0.9 ✨支持 mockjs ✨支持 path variable 0.0.8 ✨支持类型组合/类型继承 ✨增加注解支持, 增加注解 d.ts 声明
FAQs
api-runtime for api-loader
We found that api-runtime demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.