Remove core/docs directory and related files

Deleted the entire core/docs directory, which contained:
- .gitignore
- package.json
- API documentation files (index.html, openapi.yaml)
- Publishing script for documentation
This commit is contained in:
Marvin Zhang
2025-03-04 22:58:12 +08:00
parent a1f870715f
commit 00e0352ef7
5 changed files with 0 additions and 4338 deletions

View File

@@ -1,6 +0,0 @@
.idea
node_modules
dist
build
tmp
yarn.lock

View File

@@ -1,10 +0,0 @@
<!doctype html> <!-- Important: must specify -->
<html>
<head>
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</head>
<body>
<rapi-doc spec-url="./openapi.yaml"></rapi-doc>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
{
"name": "docs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"publish": "node scripts/publish.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"chalk": "^4.1.2",
"qiniu": "^7.4.0",
"walk-sync": "^3.0.0"
}
}

View File

@@ -1,81 +0,0 @@
const path = require('path')
const qiniu = require('qiniu')
const walkSync = require('walk-sync')
const chalk = require('chalk')
// target directory
const targetDir = './api'
// access key
const accessKey = process.env.QINIU_ACCESS_KEY
// secret key
const secretKey = process.env.QINIU_SECRET_KEY
// bucket
const bucket = process.env.QINIU_BUCKET
// config
const config = new qiniu.conf.Config()
// zone
config.zone = qiniu.zone[process.env.QINIU_ZONE]
function uploadFile(localFile, key) {
// options
const options = {
scope: `${bucket}:${key}`,
}
// mac
const mac = new qiniu.auth.digest.Mac(accessKey, secretKey)
// put policy
const putPolicy = new qiniu.rs.PutPolicy(options)
// upload token
const uploadToken = putPolicy.uploadToken(mac)
return new Promise((resolve, reject) => {
const formUploader = new qiniu.form_up.FormUploader(config)
const putExtra = new qiniu.form_up.PutExtra()
formUploader.putFile(uploadToken, key, localFile, putExtra, function (respErr, respBody, respInfo) {
if (respErr) {
throw respErr
}
if (respInfo.statusCode === 200) {
console.log(`${chalk.green('uploaded')} ${localFile} => ${key}`)
resolve()
} else if (respInfo.statusCode === 614) {
console.log(`${chalk.yellow('exists')} ${localFile} => ${key}`)
resolve()
} else {
const errMsg = `${chalk.red('error[' + respInfo.statusCode + ']')} ${localFile} => ${key}`
console.error(errMsg)
reject(new Error(respBody))
}
})
})
}
async function main() {
// paths
const paths = walkSync(targetDir, {
includeBasePath: true, directories: false,
})
// iterate paths
for (const filePath of paths) {
const localFile = path.resolve(filePath)
const key = filePath.replace(targetDir + '/', '')
try {
await uploadFile(localFile, key)
} finally {
// do nothing
}
}
}
(async () => {
await main()
})()