![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@xm-fe/create-api
Advanced tools
2022 鲜沐科技 前端通用逻辑包
npm i @xm-fe/create-api -g
运行capi
命令时,会读取当前项目根目下的的 capi.config.js
文件,该文件中的配置会覆盖默认配置文件。
capi.config.js 具体配置及解释看文末
capi http://127.0.0.1:4523/export/openapi/9?version=3.0 954456
capi apifox导出的URL projectId
capi
读取项目根目录配置文件 capi.config 中的 remotePath
# 安装依赖
npm i
# 发布流程
# 编译
npm run build
# 本项目
npm link
# 引用调试的项目
npm link 包名
# 取消关联
npm unlink 包名
# 查看
npm ls -g
module.exports = {
// 生成目录
targetPath: `/src/apx`,
truePath: `apis`,
// targetTypePath: `/src/api-typess`,
// 读本地文件生成
useLocal: false,
// 本地文件地址
localPath: `./test3.0.1.json`,
remotePath: `http://127.0.0.1:4523/export/openapi/6?projectId=2517920&version=3.0`,
// 暂时搞不定的接口
ignorePath: [
// 响应值多层数组??
// '/crm/detail/panic-buy/{pageIndex}/{pageSize}',
// // body参数没有key??
],
// 运行时会自动修改
appName: 'main',
// 从apifox生成的直接写死appName映射
appNameMap: {
'1164722': 'summerfarm-manage',
'1409074': 'tms',
'954456': 'cosfo',
'2517920': 'rs'
},
// 路径参数别名
paramsNumName: {
0: '',
1: 'Query',
2: 'Double',
3: 'Triple',
4: 'Quatra',
5: 'Penta'
},
listModel: {
type: 'object',
properties: {
code: {
type: 'string'
},
data: {
type: 'object',
properties: {
endRow: {
type: 'number'
},
firstPage: {
type: 'number'
},
hasNextPage: {
type: 'boolean'
},
hasPreviousPage: {
type: 'boolean'
},
isFirstPage: {
type: 'boolean'
},
isLastPage: {
type: 'boolean'
},
lastPage: {
type: 'number'
},
list: {
type: 'array',
items: {}
},
navigatePages: {
type: 'number'
},
navigatepageNums: {
type: 'array',
items: {
type: 'number'
}
},
nextPage: {
type: 'number'
},
pageNum: {
type: 'number'
},
pageSize: {
type: 'number'
},
pages: {
type: 'number'
},
prePage: {
type: 'number'
},
size: {
type: 'number'
},
startRow: {
type: 'number'
},
total: {
type: 'number'
}
}
},
msg: {
type: 'string'
}
}
},
// 插入的模板代码
getApiCodeTpl(api) {
const pathParams = api.pathParams
.map((param) => `${param.name}${param.required ? '' : '?'}: ${param._type},`)
.join('\r\n')
return `
import net from '@/utils/net'
import { NetConfig } from '@/interface/IAxiosConfig'
/**
* ${api.summary}
*/
export function ${api.name}(
${pathParams ? pathParams : ''}
${api.queryParams ? `params?: ${api.queryParams._name},` : ''}
${api.bodyParams ? `data?: ${api.bodyParams._name},` : ''}
config?: NetConfig
): Promise<${api.resType}> {
return net(
{
url: \`${api.url}\`,
method: '${api.method}',
${api.isDownload ? `_download: true,` : ''}
${api.queryParams ? `params,` : ''}
${api.bodyParams ? ` data,` : ''}
},
config
)
}
`
}
}
FAQs
API快速导入
The npm package @xm-fe/create-api receives a total of 3 weekly downloads. As such, @xm-fe/create-api popularity was classified as not popular.
We found that @xm-fe/create-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.