repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/.eslintrc.js | .eslintrc.js | module.exports = {
env: {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
extends: ["eslint:recommended", "plugin:react/recommended"],
parser: "babel-eslint",
parserOptions: {
"ecmaFeatures": {
"jsx": true
},
"source... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/npm-publish.js | npm-publish.js | const shell = require ('shelljs');
const packageJson = require ('./package.json');
const version = "v" + packageJson.version;
if(!version){
console.error('version 不能为空')
process.exit(1)
}
shell.exec ('npm install --registry https://registry.npm.taobao.org');
shell.exec ('npm run build-client');
shell.exec ('npm ... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/.prettierrc.js | .prettierrc.js | module.exports = {
/**
* 设置prettier单行输出(不折行)的(最大)长度。
* 出于代码的可读性,我们不推荐(单行)超过80个字符的coding方式。
* 如果在格式markdown时,不想折行,请设置 prose wrap参数来禁止这一行为。
* default: 80
*/
printWidth: 100,
/**
* 设置工具每一个水平缩进的空格数
* default: 2
*/
// tabWidth: 4,
/**
* 使用tab(制表位)缩进而非空格;
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/ydoc.js | ydoc.js | module.exports = {
"title": "YApi 接口管理平台",
"keywords": "api管理,接口管理,接口文档,api文档",
"author": "ymfe",
"description": "YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理",
"plugins": ["search", "img-view"],
"dist": "static/doc",... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/static/prd/assets.js | static/prd/assets.js | window.WEBPACK_ASSETS = {"index.js":{"js":"index@40d464d7fa4bb1bea815.js","css":"index@40d464d7fa4bb1bea815.css"},"lib":{"js":"lib@aaed0f9bfcc4ff921c5a.js"},"lib2":{"js":"lib2@819909a89ca45b94d9bf.js"},"lib3":{"js":"lib3@93b22d7460620277a5da.js"},"manifest":{"js":"manifest@f2f4bd774d6c221b3d5f.js"}} | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/static/prd/lib@aaed0f9bfcc4ff921c5a.js | static/prd/lib@aaed0f9bfcc4ff921c5a.js | webpackJsonp([1,4],{0:function(e,t,n){n(89),n(151),n(651),n(1532),n(1096),n(472),n(94),n(1381),n(1398),n(1446),n(1460),e.exports=n(1465)},278:function(e,t,n){function r(e,t){return null!=e&&s(e,t,i)}var i=n(279),s=n(280);e.exports=r},279:function(e,t){function n(e,t){return null!=e&&i.call(e,t)}var r=Object.prototype,i... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/static/prd/index@40d464d7fa4bb1bea815.js | static/prd/index@40d464d7fa4bb1bea815.js | webpackJsonp([0,4],[function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=n(2),s=r(i);n(110),n(112),n(116);var o=n(89),u=r(o),a=n(151),f=r(a),l=n(1084),c=r(l),h=n(642),p=n(1531),d=r(p),v=n(1540),m=r(v),g=(0,d.default)();f.default.render(u.default.createE... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/static/prd/manifest@f2f4bd774d6c221b3d5f.js | static/prd/manifest@f2f4bd774d6c221b3d5f.js | !function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n=window.webpackJsonp;window.webpackJsonp=function(s,o){for(var u,f,l=0,c=[];l<s.length;l++)f=s[l],i[f]&&c.push.apply(c,i[f]),i[f]=0;for(u in o)e[u]=o[u];for(... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/static/prd/lib3@93b22d7460620277a5da.js | static/prd/lib3@93b22d7460620277a5da.js | webpackJsonp([3,4],[function(e,t,n){n(183),n(668),e.exports=n(873)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";e.exports=n(90)},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://f... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/static/prd/lib2@819909a89ca45b94d9bf.js | static/prd/lib2@819909a89ca45b94d9bf.js | webpackJsonp([2,4],{0:function(e,t,n){n(701),n(204),n(175),e.exports=n(446)},175:function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/test/mock-extra.test.js | test/mock-extra.test.js | import test from 'ava';
const mockExtra = require('../common/mock-extra.js');
test('mock-extra', t=>{
let data = '@string ${body.a}';
t.is(mockExtra(data), '@string ${body.a}');
let data2 = {
a:'@string',
b:{
t:'${body.a}'
}
}
t.deepEqual(mockExtra(data2,{
body: {
a: 3
}
})... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/test/lib.test.js | test/lib.test.js | import test from 'ava';
const rewire = require("rewire");
const lib = rewire('../common/lib.js');
const plugin = rewire('../common/plugin.js')
const initPlugins = plugin.initPlugins;
test('initPlugins', t=>{
plugin.__set__("getPluginConfig", function(){
return {
server: true,
client: true
}
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/test/common/common.test.js | test/common/common.test.js | import test from 'ava';
import {
handleParamsValue,
schemaValidator
} from '../../common/utils.js';
test('handleParamsValue', t => {
const json = JSON.stringify({
t: 1,
obj: {
name: "dd",
value: "vvvv"
}
})
t.is(handleParamsValue(" aaaa | length"), 'aaaa | length');... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/test/common/mergeJsonSchema.test.js | test/common/mergeJsonSchema.test.js | import test from 'ava';
import mergeJsonSchema from '../../common/mergeJsonSchema';
test('base', t=>{
let schema1 = {
type: 'string',
default: 'xxx'
}
let schema2 = {
type: 'string',
format: 'email'
}
let result = mergeJsonSchema(schema1, schema2)
t.deepEqual(result, {
type:'string',... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/test/server/commons.test.js | test/server/commons.test.js | import test from 'ava';
import {
ltrim,
rtrim,
trim,
handleParams,
verifyPath,
sandbox,
handleVarPath
} from '../../server/utils/commons.js';
test('trim', t => {
t.is(trim(" a b ksjdfk "), 'a b ksjdfk');
t.is(trim(1), '1')
});
test('ltrim', t => {
t.is(ltrim(" a b ksjdfk "), 'a... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/test/server/mockServer.test.js | test/server/mockServer.test.js | import test from 'ava';
const rewire = require("rewire");
const mockServer = rewire('../../server/middleware/mockServer.js');
const matchApi = mockServer.__get__('matchApi');
test('matchApi', t => {
const apiRule = '/user/:username';
t.truthy(matchApi('/user/tom', apiRule));
t.truthy(matchApi('/user/111$$%#$##$... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/plugin.js | common/plugin.js | const _ = require('underscore');
function getPluginConfig(name, type) {
let pluginConfig;
if (type === 'ext') {
pluginConfig = require('../exts/yapi-plugin-' + name);
} else {
pluginConfig = require('yapi-plugin-' + name);
}
if (!pluginConfig || typeof pluginConfig !== 'object') {
throw new Erro... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/markdown.js | common/markdown.js | const schema = require('./schema-transformTo-table.js');
const _ = require('underscore');
const json_parse = function(json) {
try {
return JSON.parse(json);
} catch (err) {
return {};
}
};
// 处理字符串换行
const handleWrap = str => {
return _.isString(str) ? str.replace(/\n/gi, '<br/>') : str;
};
const messa... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/mergeJsonSchema.js | common/mergeJsonSchema.js | function isPlainObject(obj) {
return obj ? typeof obj === 'object' && Object.getPrototypeOf(obj) === Object.prototype : false;
}
function handleProperties(sourceProperties, mergeProperties){
if(!isPlainObject(mergeProperties)){
return mergeProperties
}
if(! isPlainObject(sourceProperties)){
return merg... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/postmanLib.js | common/postmanLib.js | const { isJson5, json_parse, handleJson, joinPath, safeArray } = require('./utils');
const constants = require('../client/constants/variable.js');
const _ = require('underscore');
const URL = require('url');
const utils = require('./power-string.js').utils;
const HTTP_METHOD = constants.HTTP_METHOD;
const axios = requi... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/config.js | common/config.js | module.exports = {
exts: [{
name: 'import-postman'
},{
name: 'import-har'
},{
name: 'advanced-mock'
},{
name: 'import-swagger'
},{
name: 'statistics'
},{
name: 'export-data'
},{
name: 'gen-services'
},{
name: 'export-swagger2-data'
},{
name: 'import-yapi-json'
},{... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/diff-view.js | common/diff-view.js | // const json5_parse = require('../client/common.js').json5_parse;
const json5 = require('json5');
module.exports = function(jsondiffpatch, formattersHtml, curDiffData) {
const json5_parse = json => {
if (typeof json === 'object' && json) return json;
try {
return json5.parse(json);
} catch (err) ... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/createContext.js | common/createContext.js | module.exports = function (uid, projectId,interfaceId) {
if(!uid || !projectId || !interfaceId){
console.error('uid projectId interfaceId 不能为空', uid, projectId,interfaceId)
}
/**
* 统一转换为number
*/
return {
uid: +uid,
projectId: +projectId,
interfaceId: +interfaceId
}
} | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/formats.js | common/formats.js | const formats = [
{
name: 'url',
title: 'url'
},
{
name: 'domain',
title: '域名'
},
{
name: 'ip',
title: 'ipv4 地址'
},
{
name: 'id'
},
{
name: 'guid'
},
{
name: 'now'
},
{
name: 'timestamp'
},
{
name: 'date'
},
{
name: 'time'
},
{
na... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/mock-extra.js | common/mock-extra.js | /**
* @author suxiaoxin
* @info mockJs 功能增强脚本
*/
var strRegex = /\${([a-zA-Z]+)\.?([a-zA-Z0-9_\.]*)\}/i;
var varSplit = '.';
var mockSplit = '|';
var Mock = require('mockjs');
Mock.Random.extend({
timestamp: function(){
var time = new Date().getTime() + '';
return +time.substr(0, time.length - 3)
}
})
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/HandleImportData.js | common/HandleImportData.js | const _ = require('underscore');
const axios = require('axios');
const isNode = typeof global == 'object' && global.global === global;
async function handle(
res,
projectId,
selectCatid,
menuList,
basePath,
dataSync,
messageError,
messageSuccess,
callback,
token,
port
) {
const taskNotice = ... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/power-string.js | common/power-string.js | /**
* @author suxiaoxin
*/
const aUniqueVerticalStringNotFoundInData = '___UNIQUE_VERTICAL___';
const aUniqueCommaStringNotFoundInData = '___UNIQUE_COMMA___';
const segmentSeparateChar = '|';
const methodAndArgsSeparateChar = ':';
const argsSeparateChar = ',';
const md5 = require('md5');
const sha = require('sha.js... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/schema-transformTo-table.js | common/schema-transformTo-table.js | const _ = require('underscore');
let fieldNum = 1;
exports.schemaTransformToTable = schema => {
try {
schema = checkJsonSchema(schema);
let result = Schema(schema, 0);
result = _.isArray(result) ? result : [result];
return result;
} catch (err) {
console.log(err);
}
};
// 自动添加type
function... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/lib.js | common/lib.js | const _ = require('underscore');
function isObj(object) {
return (
object &&
typeof object == 'object' &&
Object.prototype.toString.call(object).toLowerCase() == '[object object]'
);
}
function isArray(object) {
return object && typeof object == 'object' && object.constructor == Array;
}
function g... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/utils.js | common/utils.js | const Mock = require('mockjs');
const filter = require('./power-string.js').filter;
const stringUtils = require('./power-string.js').utils;
const json5 = require('json5');
const Ajv = require('ajv');
/**
* 作用:解析规则串 key ,然后根据规则串的规则以及路径找到在 json 中对应的数据
* 规则串:$.{key}.{body||params}.{dataPath} 其中 body 为返回数据,params 为请求数据,d... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-Viewer-all.min.js | common/tui-editor/dist/tui-editor-Viewer-all.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-extScrollSync.min.js | common/tui-editor/dist/tui-editor-extScrollSync.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t(... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-extColorSyntax.min.js | common/tui-editor/dist/tui-editor-extColorSyntax.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t(... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-extTable.min.js | common/tui-editor/dist/tui-editor-extTable.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t(... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-extUML.min.js | common/tui-editor/dist/tui-editor-extUML.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t(... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-Editor-all.min.js | common/tui-editor/dist/tui-editor-Editor-all.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-Editor.min.js | common/tui-editor/dist/tui-editor-Editor.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-Viewer.min.js | common/tui-editor/dist/tui-editor-Viewer.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/common/tui-editor/dist/tui-editor-extChart.min.js | common/tui-editor/dist/tui-editor-extChart.min.js | /*!
* tui-editor
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t(... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/docs/index.jsx | docs/index.jsx | ---
banner:
name: 'YApi'
desc: '旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API'
btns:
- { name: '开始', href: './documents/index.html', primary: true }
- { name: 'Github >', href: 'https://github.com/ymfe/yapi' }
features:
- { name: '权限管理', desc: 'YApi 成熟的团队管理扁平化项目权限配置满足各类企业的需求' }
- { name: '可视化接口管理'... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/websocket.js | server/websocket.js | const koaRouter = require('koa-router');
const interfaceController = require('./controllers/interface.js');
const yapi = require('./yapi.js');
const router = koaRouter();
const { createAction } = require("./utils/commons.js")
let pluginsRouterPath = [];
function addPluginRouter(config) {
if (!config.path || !conf... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/router.js | server/router.js | const koaRouter = require('koa-router');
const interfaceController = require('./controllers/interface.js');
const groupController = require('./controllers/group.js');
const userController = require('./controllers/user.js');
const interfaceColController = require('./controllers/interfaceCol.js');
const testController = ... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/plugin.js | server/plugin.js | const yapi = require('./yapi.js');
const plugin_path = yapi.path.join(yapi.WEBROOT, 'node_modules');
const plugin_system_path = yapi.path.join(yapi.WEBROOT, 'exts');
const initPlugins = require('../common/plugin.js').initPlugins;
var extConfig = require('../common/config.js').exts;
/**
* 钩子配置
*/
var hooks = {
/**
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/app.js | server/app.js | process.env.NODE_PATH = __dirname;
require('module').Module._initPaths();
const yapi = require('./yapi.js');
const commons = require('./utils/commons');
yapi.commons = commons;
const dbModule = require('./utils/db.js');
yapi.connect = dbModule.connect();
const mockServer = require('./middleware/mockServer.js');
requir... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/install.js | server/install.js | const fs = require('fs-extra');
const yapi = require('./yapi.js');
const commons = require('./utils/commons');
const dbModule = require('./utils/db.js');
const userModel = require('./models/user.js');
const mongoose = require('mongoose');
yapi.commons = commons;
yapi.connect = dbModule.connect();
function install() {... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/yapi.js | server/yapi.js | const path = require('path');
const fs = require('fs-extra');
const nodemailer = require('nodemailer');
const config = require('../../config.json');
let insts = new Map();
let mail;
const WEBROOT = path.resolve(__dirname, '..'); //路径
const WEBROOT_SERVER = __dirname;
const WEBROOT_RUNTIME = path.resolve(__dirname, '.... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/middleware/mockServer.js | server/middleware/mockServer.js | const yapi = require('../yapi.js');
const projectModel = require('../models/project.js');
const interfaceModel = require('../models/interface.js');
const mockExtra = require('../../common/mock-extra.js');
const { schemaValidator } = require('../../common/utils.js');
const _ = require('underscore');
const Mock = require... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/user.js | server/controllers/user.js | const userModel = require('../models/user.js');
const yapi = require('../yapi.js');
const baseController = require('./base.js');
const common = require('../utils/commons.js');
const ldap = require('../utils/ldap.js');
const interfaceModel = require('../models/interface.js');
const groupModel = require('../models/group... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/base.js | server/controllers/base.js | const yapi = require('../yapi.js');
const projectModel = require('../models/project.js');
const userModel = require('../models/user.js');
const interfaceModel = require('../models/interface.js');
const groupModel = require('../models/group.js');
const tokenModel = require('../models/token.js');
const _ = require('under... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/open.js | server/controllers/open.js | const projectModel = require('../models/project.js');
const interfaceColModel = require('../models/interfaceCol.js');
const interfaceCaseModel = require('../models/interfaceCase.js');
const interfaceModel = require('../models/interface.js');
const interfaceCatModel = require('../models/interfaceCat.js');
const followMo... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/interface.js | server/controllers/interface.js | const interfaceModel = require('../models/interface.js');
const interfaceCatModel = require('../models/interfaceCat.js');
const interfaceCaseModel = require('../models/interfaceCase.js');
const followModel = require('../models/follow.js');
const groupModel = require('../models/group.js');
const _ = require('underscore'... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/test.js | server/controllers/test.js | const yapi = require('../yapi.js');
const baseController = require('./base.js');
const fs = require('fs'); //引入文件模块
const path = require('path');
class interfaceColController extends baseController {
constructor(ctx) {
super(ctx);
}
/**
* 测试 get
* @interface /test/get
* @method GET
* @returns {O... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/interfaceCol.js | server/controllers/interfaceCol.js | const interfaceColModel = require('../models/interfaceCol.js');
const interfaceCaseModel = require('../models/interfaceCase.js');
const interfaceModel = require('../models/interface.js');
const projectModel = require('../models/project.js');
const baseController = require('./base.js');
const yapi = require('../yapi.js'... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/group.js | server/controllers/group.js | const groupModel = require('../models/group.js');
const yapi = require('../yapi.js');
const baseController = require('./base.js');
const projectModel = require('../models/project.js');
const userModel = require('../models/user.js');
const interfaceModel = require('../models/interface.js');
const interfaceColModel = req... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/follow.js | server/controllers/follow.js | const yapi = require('../yapi.js');
const baseController = require('./base.js');
const followModel = require('../models/follow');
const projectModel = require('../models/project');
class followController extends baseController {
constructor(ctx) {
super(ctx);
this.Model = yapi.getInst(followModel);
this.... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/log.js | server/controllers/log.js | const logModel = require('../models/log.js');
const yapi = require('../yapi.js');
const baseController = require('./base.js');
const groupModel = require('../models/group');
const projectModel = require('../models/project');
const interfaceModel = require('../models/interface');
class logController extends baseControl... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/controllers/project.js | server/controllers/project.js | const projectModel = require('../models/project.js');
const yapi = require('../yapi.js');
const _ = require('underscore');
const baseController = require('./base.js');
const interfaceModel = require('../models/interface.js');
const interfaceColModel = require('../models/interfaceCol.js');
const interfaceCaseModel = req... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | true |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/storage.js | server/models/storage.js | const baseModel = require('./base.js');
const mongoose = require('mongoose');
class stroageModel extends baseModel {
constructor() {
super()
let storageCol = mongoose.connection.db.collection('storage');
storageCol.createIndex(
{
key: 1
},
{
unique: true
}
);
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/avatar.js | server/models/avatar.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
class avatarModel extends baseModel {
getName() {
return 'avatar';
}
getSchema() {
return {
uid: { type: Number, required: true },
basecode: String,
type: String
};
}
get(uid) {
return this.model.f... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/user.js | server/models/user.js | const baseModel = require('./base.js');
class userModel extends baseModel {
getName() {
return 'user';
}
getSchema() {
return {
username: {
type: String,
required: true
},
password: {
type: String,
required: true
},
email: {
type: Str... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/base.js | server/models/base.js | const yapi = require('../yapi.js');
const mongoose = require('mongoose');
const autoIncrement = require('../utils/mongoose-auto-increment');
/**
* 所有的model都需要继承baseModel, 且需要 getSchema和getName方法,不然会报错
*/
class baseModel {
constructor() {
this.schema = new mongoose.Schema(this.getSchema());
this.name = thi... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/interfaceCase.js | server/models/interfaceCase.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
class interfaceCase extends baseModel {
getName() {
return 'interface_case';
}
getSchema() {
return {
casename: { type: String, required: true },
uid:... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/token.js | server/models/token.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
class tokenModel extends baseModel {
getName() {
return 'token';
}
getSchema() {
return {
project_id: { type: Number, required: true },
token: String
};
}
save(data) {
let m = new this.model(data);
r... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/interfaceCat.js | server/models/interfaceCat.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
/**
* 接口分类
*/
class interfaceCat extends baseModel {
getName() {
return 'interface_cat';
}
getSchema() {
return {
name: { type: String, required: true },
uid: { type: Number, required: true },
project_id: { t... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/interface.js | server/models/interface.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
class interfaceModel extends baseModel {
getName() {
return 'interface';
}
getSchema() {
return {
title: { type: String, required: true },
uid: { type: Number, required: true },
path: { type: String, required: ... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/interfaceCol.js | server/models/interfaceCol.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
class interfaceCol extends baseModel {
getName() {
return 'interface_col';
}
getSchema() {
return {
name: { type: String, required: true },
uid: { type: Number, required: true },
project_id: { type: Number, req... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/group.js | server/models/group.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
class groupModel extends baseModel {
getName() {
return 'group';
}
getSchema() {
return {
uid: Number,
group_name: String,
group_desc: String,
add_time: Number,
up_time: Number,
type: { type: ... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/follow.js | server/models/follow.js | const baseModel = require('./base.js');
class followModel extends baseModel {
getName() {
return 'follow';
}
getSchema() {
return {
uid: { type: Number, required: true },
projectid: { type: Number, required: true },
projectname: { type: String, required: true },
icon: String,
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/log.js | server/models/log.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
class logModel extends baseModel {
getName() {
return 'log';
}
getSchema() {
return {
uid: { type: Number, required: true },
typeid: { type: Number, r... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/models/project.js | server/models/project.js | const yapi = require('../yapi.js');
const baseModel = require('./base.js');
class projectModel extends baseModel {
getName() {
return 'project';
}
constructor(){
super()
this.handleEnvNullData = this.handleEnvNullData.bind(this)
}
getAuthList(uid){
return this.model.find({
$or: [{
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/storage.js | server/utils/storage.js | module.exports = function storageCreator(id) {
const storageModel = require('../models/storage.js');
const yapi = require('../yapi.js');
const defaultData = {}
return {
getItem: async (name = '') => {
let inst = yapi.getInst(storageModel);
let data = await inst.get(id);
data = data || defa... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/mongoose-auto-increment.js | server/utils/mongoose-auto-increment.js | // Module Scope
var mongoose = require('mongoose'),
extend = require('extend'),
counterSchema,
IdentityCounter;
// Initialize plugin by creating counter collection in database.
exports.initialize = function (connection) {
try {
IdentityCounter = mongoose.model('IdentityCounter');
} catch (ex) {
if (ex.name... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/ldap.js | server/utils/ldap.js | const ldap = require('ldapjs');
const yapi = require('../yapi.js');
const util = require('util');
exports.ldapQuery = (username, password) => {
// const deferred = Q.defer();
return new Promise((resolve, reject) => {
const { ldapLogin } = yapi.WEBCONFIG;
// 使用ldapjs库创建一个LDAP客户端
const client = ldap.c... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/token.js | server/utils/token.js | const yapi = require('../yapi')
const crypto = require('crypto');
/*
下面是使用加密算法
*/
// 创建加密算法
const aseEncode = function(data, password) {
// 如下方法使用指定的算法与密码来创建cipher对象
const cipher = crypto.createCipher('aes192', password);
// 使用该对象的update方法来指定需要被加密的数据
let crypted = cipher.update(data, 'utf-8', 'hex');
c... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/notice.js | server/utils/notice.js | const yapi = require('../yapi.js');
function arrUnique(arr1, arr2) {
let arr = arr1.concat(arr2);
let res = arr.filter(function(item, index, arr) {
return arr.indexOf(item) === index;
});
return res;
}
const noticeObj = {
mail: {
title: '邮件',
hander: (emails, title, content)=>{
yapi.common... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/db.js | server/utils/db.js | const mongoose = require('mongoose');
const yapi = require('../yapi.js');
const autoIncrement = require('./mongoose-auto-increment');
function model(model, schema) {
if (schema instanceof mongoose.Schema === false) {
schema = new mongoose.Schema(schema);
}
schema.set('autoIndex', false);
return mongoose.... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/sandbox.js | server/utils/sandbox.js | const Safeify = require('safeify').default;
module.exports = async function sandboxFn(context, script) {
// 创建 safeify 实例
const safeVm = new Safeify({
timeout: 3000,
asyncTimeout: 60000
})
script += "; return this;";
// 执行动态代码
const result = await safeVm.run(script, context)
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/initConfig.js | server/utils/initConfig.js | const path = require('path');
const fs = require('fs-extra');
const config = require('../config.js');
let runtimePath = config.runtime_path;
fs.ensureDirSync(runtimePath);
fs.ensureDirSync(path.join(runtimePath, 'log'));
let configPath = path.join(runtimePath, 'config.json');
fs.writeFileSync(configPath,
JSON.strin... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/commons.js | server/utils/commons.js | const fs = require('fs-extra');
const path = require('path');
const yapi = require('../yapi.js');
const sha1 = require('sha1');
const logModel = require('../models/log.js');
const projectModel = require('../models/project.js');
const interfaceColModel = require('../models/interfaceCol.js');
const interfaceCaseModel = r... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/reportHtml/defaultTheme.js | server/utils/reportHtml/defaultTheme.js | const fs = require('fs');
const sysPath = require('path');
const css = fs.readFileSync(sysPath.join(__dirname, './defaultTheme.css'));
module.exports = '<style>' + css + '</style>';
| javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/server/utils/reportHtml/index.js | server/utils/reportHtml/index.js | const defaultTheme = require('./defaultTheme.js');
function json_format(json) {
if (json && typeof json === 'object') {
return JSON.stringify(json, null, ' ');
}
return json;
}
module.exports = function renderToHtml(reports) {
let tp = createHtml(reports);
return tp;
};
function createHtml(reports) {... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/plugin.js | client/plugin.js | let hooks, pluginModule;
/**
* type component 组件
* listener 监听函数
* mulit 是否绑定多个监听函数
*/
hooks = {
/**
* 第三方登录 //可参考 yapi-plugin-qsso 插件
*/
third_login: {
type: 'component',
mulit: false,
listener: null
},
/**
* 导入数据
* @param Object importDataModule
*
* @info
* 可参考 v... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/Application.js | client/Application.js | import React, { PureComponent as Component } from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Route, BrowserRouter as Router } from 'react-router-dom';
import { Home, Group, Project, Follows, AddProject, Login } from './containers/index'... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/index.js | client/index.js | import './styles/common.scss';
import './styles/theme.less';
import { LocaleProvider } from 'antd';
import './plugin';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './Application';
import { Provider } from 'react-redux';
import createStore from './reducer/create';
// 由于 antd 组件的默认文案是英文,... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/common.js | client/common.js | const moment = require('moment');
const constants = require('./constants/variable');
const Mock = require('mockjs');
const json5 = require('json5');
const MockExtra = require('common/mock-extra.js');
const Roles = {
0: 'admin',
10: 'owner',
20: 'dev',
30: 'guest',
40: 'member'
};
const roleAction = {
mana... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/AuthenticatedComponent.js | client/components/AuthenticatedComponent.js | import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { changeMenuItem } from '../reducer/modules/menu';
export function requireAuthentication(Component) {
return @connect(
state => {
return {
isAuthenticated: state.user.isLogin
};
},... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/index.js | client/components/index.js | import Breadcrumb from './Breadcrumb/Breadcrumb.js';
import Footer from './Footer/Footer.js';
import Header from './Header/Header.js';
import Intro from './Intro/Intro.js';
import Loading from './Loading/Loading.js';
import ProjectCard from './ProjectCard/ProjectCard.js';
import Subnav from './Subnav/Subnav.js';
import... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/Breadcrumb/Breadcrumb.js | client/components/Breadcrumb/Breadcrumb.js | import './Breadcrumb.scss';
import { withRouter } from 'react-router-dom';
import { Breadcrumb } from 'antd';
import PropTypes from 'prop-types';
import React, { PureComponent as Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
@connect(state => {
return {
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/Subnav/Subnav.js | client/components/Subnav/Subnav.js | import './Subnav.scss';
import React, { PureComponent as Component } from 'react';
import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import { Menu } from 'antd';
class Subnav extends Component {
constructor(props) {
super(props);
}
static propTypes = {
data: PropTypes.array,
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/AceEditor/AceEditor.js | client/components/AceEditor/AceEditor.js | import React from 'react';
import mockEditor from './mockEditor';
import PropTypes from 'prop-types';
import './AceEditor.scss';
const ModeMap = {
javascript: 'ace/mode/javascript',
json: 'ace/mode/json',
text: 'ace/mode/text',
xml: 'ace/mode/xml',
html: 'ace/mode/html'
};
const defaultStyle = { width: '100... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/AceEditor/mockEditor.js | client/components/AceEditor/mockEditor.js | var ace = require('brace'),
Mock = require('mockjs');
require('brace/mode/javascript');
require('brace/mode/json');
require('brace/mode/xml');
require('brace/mode/html');
require('brace/theme/xcode');
require('brace/ext/language_tools.js');
var json5 = require('json5');
const MockExtra = require('common/mock-extra.js... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/Footer/Footer.js | client/components/Footer/Footer.js | import './Footer.scss';
import React, { PureComponent as Component } from 'react';
import PropTypes from 'prop-types';
import { Row, Col } from 'antd';
import { Icon } from 'antd';
const version = process.env.version;
class Footer extends Component {
constructor(props) {
super(props);
}
static propTypes = {
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/TimeLine/TimeLine.js | client/components/TimeLine/TimeLine.js | import React, { PureComponent as Component } from 'react';
import { Timeline, Spin, Row, Col, Tag, Avatar, Button, Modal, AutoComplete } from 'antd';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { formatTime } from '../../common.js';
import showDiffMsg from '../../../common/diff-vie... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/Loading/Loading.js | client/components/Loading/Loading.js | import React from 'react';
import PropTypes from 'prop-types';
import './Loading.scss';
export default class Loading extends React.PureComponent {
static defaultProps = {
visible: false
};
static propTypes = {
visible: PropTypes.bool
};
constructor(props) {
super(props);
this.state = { show: ... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/ModalPostman/index.js | client/components/ModalPostman/index.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './index.scss';
import { Alert, Modal, Row, Col, Icon, Collapse, Input, Tooltip } from 'antd';
import MockList from './MockList.js';
import MethodsList from './MethodsList.js';
import VariablesSelect from './VariablesSelect.js';
import... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/ModalPostman/VariablesSelect.js | client/components/ModalPostman/VariablesSelect.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Tree } from 'antd';
import { connect } from 'react-redux';
import { fetchVariableParamsList } from '../../reducer/modules/interfaceCol.js';
const TreeNode = Tree.TreeNode;
const CanSelectPathPrefix = 'CanSelectPath-';
function dele... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/ModalPostman/MethodsList.js | client/components/ModalPostman/MethodsList.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Row, Icon, Input, Select, Tooltip } from 'antd';
import _ from 'underscore';
const Option = Select.Option;
// 深拷贝
function deepEqual(state) {
return JSON.parse(JSON.stringify(state));
}
const METHODS_LIST = [
{ name: 'md5', typ... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/ModalPostman/MockList.js | client/components/ModalPostman/MockList.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Row, Input } from 'antd';
import constants from '../../constants/variable.js';
const wordList = constants.MOCK_SOURCE;
const Search = Input.Search;
class MockList extends Component {
static propTypes = {
click: PropTypes.func,... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/UsernameAutoComplete/UsernameAutoComplete.js | client/components/UsernameAutoComplete/UsernameAutoComplete.js | import React, { PureComponent as Component } from 'react';
import PropTypes from 'prop-types';
import { Select } from 'antd';
import axios from 'axios';
const Option = Select.Option;
/**
* 用户名输入框自动完成组件
*
* @component UsernameAutoComplete
* @examplelanguage js
*
* * 用户名输入框自动完成组件
* * 用户名输入框自动完成组件
*
*s
*/
/**... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
YMFE/yapi | https://github.com/YMFE/yapi/blob/59bade3a8a43e7db077d38a4b0c7c584f30ddf8c/client/components/MyPopConfirm/MyPopConfirm.js | client/components/MyPopConfirm/MyPopConfirm.js | import React, { PureComponent as Component } from 'react';
import { Modal, Button } from 'antd';
import PropTypes from 'prop-types';
// 嵌入到 BrowserRouter 内部,覆盖掉默认的 window.confirm
// http://reacttraining.cn/web/api/BrowserRouter/getUserConfirmation-func
class MyPopConfirm extends Component {
constructor(props) {
... | javascript | Apache-2.0 | 59bade3a8a43e7db077d38a4b0c7c584f30ddf8c | 2026-01-04T15:02:27.154950Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.