
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.
@tbmini/api-transform
Advanced tools
S端可视化配置转化为通用api-tree,为转译代码做准备。
npm i -s @tbmini/api-transform
// or
yarn add @tbmini/api-transform
import { IApiConfig, Transpiler } from '@tbmini/api-transform'
const transpiler = new Transpiler({ controllerConfig, projectConfig, beforeAnalysis })
// 根据配置获取api-tree
const apiConfigs = transpiler.getApiConfigs()
// 判 断某模块是否有user定义
const isHasUser = transpiler.isModuleIncludeUser('task')
| Name | Type | Default | Description |
|---|---|---|---|
projectConfig | IProjectConfig | - | S端可视化运营配置 |
controllerConfig | IAllControllerConfig | - | S端可视化玩法配置 |
beforeAnalysis | IBeforeAnalysis | - | S端模板beforeModules静态解析结果(code-parse获取) |
| Name | Type | Description |
|---|---|---|
getApiConfigs | ()=>IApiConfig[] | 获取api-tree |
isModuleIncludeUser | (moduleName:string)=> Boolean | 判断模块是否包含user定义 |
login: {
path: 'login',
module: {
type: 'decorator',
name: 'user',
decoratorType: 'class',
deps: ['user', 'awards', 'task']
},
validate: {
key: 'Params',
params: [
{
key: 'activityId',
type: 'string',
validators: [
{
key: 'IsString',
message: '$必须是字符串'
},
{
key: 'IsNotEmpty',
message: '$必填'
}
]
},
{
key: 'isFollow',
type: 'boolean',
validators: [
{
key: 'IsBoolean'
}
]
}
]
},
decorators: [
{
type: 'decorator',
decoratorType: 'method',
key: 'Validate',
params: [
{
type: 'identifier',
value: 'Params'
}
]
},
{
type: 'decorator',
decoratorType: 'method',
key: 'Inject',
params: [
{
type: 'object',
value: [
{
key: 'noCheckUser',
value: 'true',
type: 'boolean'
},
{
key: 'middlewares',
value: [
{
type: 'string',
value: 'vipInfo'
}
],
type: 'array'
}
]
}
]
middlewares: {
type: 'builtIn', // common custom
key: 'vipInfo'
}
},
{
key: 'Init',
type: 'decorator',
decoratorType: 'method',
params: []
},
{
key: 'Before',
type: 'decorator',
decoratorType: 'method',
lifecyle: true,
params: [
{
key: 'updateOrderTask',
type: 'callExpression',
hasParams: true,
params: [
{
type: 'string',
value: 'orderGoods'
}
]
}
]
}
],
main: [
{
type: 'varStatement',
nodeFlag: 'const',
left: 'task',
right: ['this', 'sss', 'eee']
},
{
type: 'method',
isAsync: true,
module: 'user',
name: 'addUserRecord',
desc: '',
scope: 'public',
inputParams: [{ value: 'ctx', type: 'identifier' }],
outputParams: {
key: 'addUserResult',
type: 'Promise<{ openId, newUser, firstLoginToday }>',
struct: {
openId: 'string',
newUser: 'boolean',
firstLoginToday: 'boolean'
}
}
},
{
type: 'rewardCenter',
params: [],
method: {
name: 'send',
params: []
},
returnKey: 'rewardResult'
},
{
type: 'custom',
key: 'createStatData'
},
{
type: 'resultModel',
resultType: 'success',
params: [
{
values: [
{
value: 'addUserRecordResult',
type: 'identifier',
isSpread: true
}
],
type: 'object'
},
{
type: 'number',
value: '1'
},
{
type: 'string',
value: '3'
},
{
type: 'boolean',
value: 'true'
},
{
value: 'addd',
type: 'identifier',
isSpread: true
},
{
type: 'callExpression',
value: 'updateOrder',
params: []
},
{
type: 'array',
values: []
}
]
}
{
type: 'method',
isAsync: true,
module: 'user',
name: 'addUserRecord',
desc: '',
tbDeps: ['vipInfo'],
scope: 'public',
inputParams: [
{
key: 'ctx',
type: 'IContext<Login.Params>',
struct: {
env: 'string',
data: {
activityId: 'string',
userNick: 'string',
avatar: 'string',
isFollow: 'boolean',
'inviteId?': 'string'
}
}
}
],
outputParams: {
key: 'addResult',
type: 'Promise<{ openId, newUser, firstLoginToday }>',
struct: {
openId: 'string',
newUser: 'boolean',
firstLoginToday: 'boolean'
}
}
}
]
}
FAQs
We found that @tbmini/api-transform demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers 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.