@nocobase/plugin-api-doc 1.4.0-alpha.0 → 1.4.0-alpha.10

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.
@@ -8,15 +8,15 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.4.0-alpha.0",
12
- "@nocobase/sdk": "1.4.0-alpha.0",
11
+ "@nocobase/client": "1.4.0-alpha.10",
12
+ "@nocobase/sdk": "1.4.0-alpha.10",
13
13
  "antd": "5.12.8",
14
14
  "react": "18.2.0",
15
15
  "@ant-design/icons": "5.2.6",
16
16
  "antd-style": "3.7.1",
17
17
  "react-i18next": "11.18.6",
18
- "@nocobase/actions": "1.4.0-alpha.0",
19
- "@nocobase/server": "1.4.0-alpha.0",
20
- "@nocobase/utils": "1.4.0-alpha.0",
21
- "@nocobase/database": "1.4.0-alpha.0"
18
+ "@nocobase/actions": "1.4.0-alpha.10",
19
+ "@nocobase/server": "1.4.0-alpha.10",
20
+ "@nocobase/utils": "1.4.0-alpha.10",
21
+ "@nocobase/database": "1.4.0-alpha.10"
22
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-api-doc",
3
- "version": "1.4.0-alpha.0",
3
+ "version": "1.4.0-alpha.10",
4
4
  "displayName": "API documentation",
5
5
  "displayName.zh-CN": "API 文档",
6
6
  "description": "An OpenAPI documentation generator for NocoBase HTTP API.",
@@ -23,5 +23,5 @@
23
23
  "url": "git+https://github.com/nocobase/nocobase.git",
24
24
  "directory": "packages/plugins/api-doc"
25
25
  },
26
- "gitHead": "8ffa7b54bbaf720c0c9857da4b19a99110dffc4b"
26
+ "gitHead": "74c99c0f2d84690d7e3db62c7a913e6aca97c762"
27
27
  }
package/README.zh-CN.md DELETED
@@ -1,79 +0,0 @@
1
- # api-doc
2
-
3
- [English](./README.md) | 中文
4
-
5
- ## 简介
6
-
7
- 该插件基于 `swagger` 编写文档。
8
-
9
- ## 如何访问文档
10
-
11
- 1. 在插件中心访问地址是 `{domain}/admin/settings/api-doc/documentation`
12
- 2. 在插件中心外访问地址是 `{domain}/api-documentation`
13
-
14
- ## 如何编写 swagger 文档
15
-
16
- > 插件内方式一样
17
-
18
- 1. `src/swagger.{ts,json}`
19
- 2. `src/swagger/index.{ts,json}`
20
-
21
- 上面的文件路径均可遍写文档,只需最后将您编写的文档默认导出即可,例子如下:
22
-
23
- ```ts
24
- export default {
25
- info: {
26
- title: 'NocoBase API - Auth plugin',
27
- },
28
- tags: [],
29
- paths: {},
30
- components: {
31
- schemas: {}
32
- }
33
- };
34
- ```
35
-
36
- 通常你只需要编写 **info.title**, **tags**, **paths**, **components** 即可其他内容如 **server**, **info** 的其他信息都合并我们的 **base-swagger**.
37
-
38
- base swagger 包含如下代码
39
- ```ts
40
- // base swagger
41
- export default {
42
- openapi: '3.0.3',
43
- info: {
44
- title: 'NocoBase API documentation',
45
- description: '',
46
- contact: {
47
- url: 'https://github.com/nocobase/nocobase/issues',
48
- },
49
- license: {
50
- name: 'Core packages are Apache 2.0 & Plugins packages are AGPL 3.0 licensed.',
51
- url: 'https://github.com/nocobase/nocobase#license',
52
- },
53
- },
54
- externalDocs: {
55
- description: 'Find out more about NocoBase',
56
- url: 'https://docs.nocobase.com/',
57
- },
58
- components: {
59
- securitySchemes: {
60
- 'api-key': {
61
- type: 'http',
62
- scheme: 'bearer',
63
- },
64
- },
65
- },
66
- security: [
67
- {
68
- 'api-key': [],
69
- },
70
- ],
71
- };
72
-
73
- ```
74
-
75
- > 注意:涉及到运行时才能获取的配置,并没有填写在 base-swagger 里,如 server, version 字段
76
-
77
- 这些默认的配置你同样也可以覆盖它,在你编写插件的 `swagger` 文档时,你需要视你的插件文档是独立的文档,可以被单独访问。
78
-
79
- 详细的 `swagger` 编写规则请参考[官方文档](https://swagger.io/docs/specification/about/)