Compare commits
3 Commits
b12b179e2c
...
ad87a61807
Author | SHA1 | Date |
---|---|---|
liuyafei | ad87a61807 | |
liuyafei | 06003fceab | |
liuyafei | 6b195660c7 |
|
@ -0,0 +1,7 @@
|
|||
node_modules
|
||||
docs/.vuepress/.cache
|
||||
docs/.vuepress/.temp
|
||||
package-lock.json
|
||||
.idea
|
||||
.DS_Store
|
||||
docs/.vuepress/dist
|
|
@ -0,0 +1,10 @@
|
|||
FROM node:18.19.1-alpine3.19 AS build
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 将 package.json 和 package-lock.json 复制到工作目录
|
||||
COPY package.json ./
|
||||
|
||||
# 安装项目依赖
|
||||
RUN npm install
|
|
@ -0,0 +1,20 @@
|
|||
FROM registry.cn-hangzhou.aliyuncs.com/idmesh/base:flow-doc-base-v1 as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
# 构建 React 项目
|
||||
RUN npm run docs:build
|
||||
|
||||
FROM nginx:latest
|
||||
|
||||
# 复制 React 项目构建结果到 Nginx 的默认静态文件目录
|
||||
COPY --from=build /app/docs/.vuepress/dist /usr/share/nginx/html
|
||||
COPY --from=build /app/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# 暴露 Nginx 默认端口
|
||||
EXPOSE 80
|
||||
|
||||
# Nginx 启动命令
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
42
README.md
42
README.md
|
@ -1,41 +1,3 @@
|
|||
# Flow / 同步组件开发文档
|
||||
# flow-doc
|
||||
|
||||
# !!!!!!!!! gitea内部链接处理不对,建议clone到本地使用vs code查看本文档
|
||||
|
||||
## op
|
||||
|
||||
`op` 是为函数事件流、同步组件等一系列场景所提供的工具,可以使用它请求一系列 IDMesh 接口,使用它进行一系列数据处理等等。
|
||||
|
||||
``` js
|
||||
const onSyncTask = async (config, env, op, eventData) => {
|
||||
op.api.init('<AK>', '<SK>');
|
||||
op.api.user.disable({ id: '<User_ID>' });
|
||||
};
|
||||
```
|
||||
|
||||
详情参见:[op 文档](./op/README.md)
|
||||
|
||||
## Flow 场景文档
|
||||
|
||||
详情参见:[Flow 文档](./flow/README.md)
|
||||
|
||||
## npm包
|
||||
|
||||
你可以通过`require`使用指定的npm包,例如:
|
||||
|
||||
```js
|
||||
const { SHA256 } = require('crypto-js');
|
||||
log(SHA256('Message'));
|
||||
```
|
||||
|
||||
可以使用的npm包包括:
|
||||
|
||||
- [ldapjs](https://www.npmjs.com/package/ldapjs):LDAP client
|
||||
- [axios](https://www.npmjs.com/package/axios):HTTP client
|
||||
- [crypto-js](https://www.npmjs.com/package/crypto-js):加密工具
|
||||
- [node-rsa](https://www.npmjs.com/package/node-rsa)
|
||||
- [gm-crypto](https://www.npmjs.com/package/gm-crypto):国密算法(sm2,sm3,sm4)
|
||||
- [fast-xml-parser](https://www.npmjs.com/package/fast-xml-parser):XML 解析
|
||||
- [uuid](https://www.npmjs.com/package/uuid)
|
||||
- [dayjs](https://www.npmjs.com/package/dayjs):日期时间格式处理
|
||||
- [lodash](https://www.npmjs.com/package/lodash):工具类
|
||||
文档地址转移至:[https://flow-doc.idmesh.site/](https://flow-doc.idmesh.site/)
|
|
@ -0,0 +1,61 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: flow-doc
|
||||
namespace: ${NAMESPACE}
|
||||
labels:
|
||||
app: flow-doc
|
||||
spec:
|
||||
revisionHistoryLimit: 3
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: flow-doc
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: flow-doc
|
||||
annotations:
|
||||
config.linkerd.io/skip-outbound-ports: 3306,16379,6379
|
||||
spec:
|
||||
containers:
|
||||
- name: flow-doc
|
||||
image: ${TAG}
|
||||
imagePullPolicy: IfNotPresent
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
port: 80
|
||||
path: /
|
||||
resources:
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 200Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
env:
|
||||
- name: APP_DEBUG
|
||||
value: "true"
|
||||
- name: LOG_ALLOCATE
|
||||
value: "off"
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- containerPort: 10080
|
||||
imagePullSecrets:
|
||||
- name: docker-registry-public
|
||||
- name: docker-registry-vpc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: flow-doc-service
|
||||
namespace: ${NAMESPACE}
|
||||
labels:
|
||||
app: flow-doc
|
||||
spec:
|
||||
selector:
|
||||
app: flow-doc
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
name: http
|
|
@ -0,0 +1,37 @@
|
|||
import { viteBundler } from '@vuepress/bundler-vite'
|
||||
import { defaultTheme } from '@vuepress/theme-default'
|
||||
import { defineUserConfig } from 'vuepress'
|
||||
|
||||
export default defineUserConfig({
|
||||
bundler: viteBundler(),
|
||||
theme: defaultTheme(
|
||||
{
|
||||
navbar: [
|
||||
{
|
||||
text: '首页',
|
||||
link: '/',
|
||||
},
|
||||
],
|
||||
head: [['link', { rel: 'icon', href: '/images/logo.png' }]],
|
||||
markdown: {
|
||||
// // markdown-it-anchor 的选项
|
||||
// anchor: {
|
||||
// level: [1, 2, 3, 4, 5, 6],
|
||||
// permalink: anchorPlugin.permalink.ariaHidden({
|
||||
// class: 'header-anchor',
|
||||
// symbol: '#',
|
||||
// space: true,
|
||||
// placement: 'before',
|
||||
// }),
|
||||
// },
|
||||
// // markdown-it-toc 的选项
|
||||
// toc: { includeLevel: [1, 2,3,4] },
|
||||
// extendMarkdown: md => {
|
||||
// // 使用更多的 markdown-it 插件!
|
||||
// md.use(require('markdown-it-anchor'))
|
||||
// },
|
||||
|
||||
}
|
||||
}
|
||||
),
|
||||
})
|
|
@ -0,0 +1,3 @@
|
|||
# FAQ
|
||||
|
||||
##
|
|
@ -0,0 +1,39 @@
|
|||
# Flow / 同步组件开发文档
|
||||
|
||||
## op
|
||||
|
||||
`op` 是为函数事件流、同步组件等一系列场景所提供的工具,可以使用它请求一系列 IDMesh 接口,使用它进行一系列数据处理等等。
|
||||
|
||||
``` js
|
||||
const onSyncTask = async (config, env, op, eventData) => {
|
||||
op.api.init('<AK>', '<SK>');
|
||||
op.api.user.disable({ id: '<User_ID>' });
|
||||
};
|
||||
```
|
||||
|
||||
详情参见:[op 文档](./op/README.md)
|
||||
|
||||
## Flow 场景文档
|
||||
|
||||
详情参见:[Flow 文档](./flow/README.md)
|
||||
|
||||
## npm包
|
||||
|
||||
你可以通过`require`使用指定的npm包,例如:
|
||||
|
||||
```js
|
||||
const { SHA256 } = require('crypto-js');
|
||||
log(SHA256('Message'));
|
||||
```
|
||||
|
||||
可以使用的npm包包括:
|
||||
|
||||
- [ldapjs](https://www.npmjs.com/package/ldapjs):LDAP client
|
||||
- [axios](https://www.npmjs.com/package/axios):HTTP client
|
||||
- [crypto-js](https://www.npmjs.com/package/crypto-js):加密工具
|
||||
- [node-rsa](https://www.npmjs.com/package/node-rsa)
|
||||
- [gm-crypto](https://www.npmjs.com/package/gm-crypto):国密算法(sm2,sm3,sm4)
|
||||
- [fast-xml-parser](https://www.npmjs.com/package/fast-xml-parser):XML 解析
|
||||
- [uuid](https://www.npmjs.com/package/uuid)
|
||||
- [dayjs](https://www.npmjs.com/package/dayjs):日期时间格式处理
|
||||
- [lodash](https://www.npmjs.com/package/lodash):工具类
|
|
@ -0,0 +1,24 @@
|
|||
### Request
|
||||
|
||||
|
||||
#### 参数
|
||||
|
||||
``` ts
|
||||
{
|
||||
// 请求方IP
|
||||
ip: string;
|
||||
//
|
||||
hostname: string;
|
||||
geoip: {
|
||||
country_code: string;
|
||||
city_name: string;
|
||||
latitude: number;
|
||||
country_name: string;
|
||||
continent_code: string;
|
||||
time_zone: string;
|
||||
longitude: number;
|
||||
}
|
||||
language: string;
|
||||
request_id: string;
|
||||
}
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Document</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="description" content="Description">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
name: '',
|
||||
repo: ''
|
||||
}
|
||||
</script>
|
||||
<!-- Docsify v4 -->
|
||||
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,3 +0,0 @@
|
|||
# Request
|
||||
|
||||
TODO
|
|
@ -0,0 +1,52 @@
|
|||
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
# https support
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile off;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
# server_name localhost;
|
||||
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "flow-doc",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
"doc": "docs"
|
||||
},
|
||||
"scripts": {
|
||||
"docs:dev": "vuepress dev docs",
|
||||
"docs:build": "vuepress build docs",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@code.idmesh.cn:liuyafei/flow-doc.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@vuepress/bundler-vite": "^2.0.0-rc.9",
|
||||
"@vuepress/theme-default": "^2.0.0-rc.23",
|
||||
"vuepress": "^2.0.0-rc.9"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue