dsh-apis-plugin 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -13,27 +13,33 @@ dsh plugin --profile web add dsh-apis-plugin
13
13
  安装后重启 `dsh web` 生效。指定版本:
14
14
 
15
15
  ```sh
16
- dsh plugin --profile web add dsh-apis-plugin@0.1.5
16
+ dsh plugin --profile web add dsh-apis-plugin@0.1.6
17
17
  ```
18
18
 
19
19
  ## 配置
20
20
 
21
+ 建议把 `api.cfg` 和 `api_doc.md` 一起放在同一个目录下(如项目的 `config/` 目录),然后在插件配置页把「API配置」指向该目录:
22
+
23
+ ```
24
+ config/
25
+ ├── api.cfg # 接口清单
26
+ └── api_doc.md # 接口文档
27
+ ```
28
+
21
29
  ### 1. api.cfg(接口清单,必需)
22
30
 
23
- 在插件配置页指定的 API 目录下创建 `api.cfg`(key=value 行,`#` 注释,UTF-8 编码):
31
+ key=value 行格式,`#` 注释,UTF-8 编码:
24
32
 
25
33
  ```ini
26
34
  # 接口服务前缀:域名 + nginx 前缀 + 网关路由段
27
35
  baseUrl=http://your-host/prod-api
28
36
 
29
- # 接口列表:逗号分隔同行书写
30
- apis=/users/page,/users/{id}
31
-
32
- # 或逐行列举
37
+ # 接口列表:apis= 下面逐行一个接口
33
38
  apis=
39
+ /users/page
40
+ /users/{id}
34
41
  /outline/page
35
42
  /outline/detailByNos
36
- /basicTargetChar/item/listByTargetCharId
37
43
  ```
38
44
 
39
45
  - `baseUrl`:请求时拼接在接口路径前(改文件即生效,无需重启)
@@ -42,7 +48,7 @@ apis=
42
48
 
43
49
  ### 2. api_doc.md(接口文档,建议提供)
44
50
 
45
- 与 `api.cfg` 同目录。用 `---` 分节,每节描述一个接口,节内用反引号标注接口路径:
51
+ 与 `api.cfg` 放在一起。用 `---` 分节,每节描述一个接口,节内用反引号标注接口路径:
46
52
 
47
53
  ```markdown
48
54
  ## 通用说明
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-apis-plugin",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "通用接口管理插件:把任意一套 HTTP 接口注册成 agent 可用的文档查询与请求双工具",
5
5
  "type": "module",
6
6
  "license": "MIT",