* feat: rename plugin-collection-manager to plugin-data-source-main (#4136) * feat: rename plugin * feat: rename * chore: rename classes of data-source-main * chore: use name for migrating instead of packageName * chore: rename china-region to field-china-region (#4167) * chore: rename china-region to field-china-region * chore: update yarn.lock * chore: rename classes * chore: use name instead of pkgName * chore: rename export to action-export (#4169) * chore: rename export to action-export * chore: rename classes * chore: use name * chore: rename formula-field to field-formula (#4170) * chore: rename formula-field to field-formula * chore: use name * chore: rename localization-management to localization (#4173) * chore: rename localization-management to localization * fix: test * chore: rename sequence-field to field-sequence (#4174) * chore: rename sequence-field to field-sequence * chore: use name * chore: rename custom-request to action-custom-request (#4168) * chore: rename custom-request to action-custom-request * chore: rename classes * chore: use name * fix: ns * chore: rename iframe-block to block-iframe (#4171) * chore: rename iframe-block to block-iframe * chore: use name * chore: rename sms-auth to auth-sms (#4175) * chore: rename sms-auth to auth-sms * chore: use name * chore: rename import to action-import (#4172) * chore: rename import to action-import * chore: use name * fix: ns * fix: packages * test: add rename test * fix: move rename migrations to preset * fix: version * fix(localization): remove duplicate records (#4182) * fix: locale ns * fix(localization): remove duplicate records * chore: merge * fix: migration * fix: test * feat: improve pm add command (#4198) * chore: remove sso auth plugins and add upgrade warning (#4192) * chore: remove sso auth plugins and add upgrade warning * chore: remove sso plugins dir * chore: remove dependencies * fix: names * refactor: move to migration * chore: adjust log * feat: allows to remove plugins from sub apps * fix: pm remove * chore: add test * chore: just for pro plugins * refactor: optimize migration * test: add test * fix: auth-sms * fix: add transaction --------- Co-authored-by: chenos <chenlinxh@gmail.com> * chore: make e2e more stable * chore(license): update LICENSE to AGPL-3.0 (#4207) * fix: improve pm (#4200) * fix: improve pm * feat: improve pm update * fix: test error * fix: rename plugin * fix: remove only * refactor(e2e): extract * fix: await * fix: nameOrPkg * feat: remove multi-app-share-collection from local --------- Co-authored-by: Zeke Zhang <958414905@qq.com> * chore: add new line * chore: rename migration * fix: version * fix: test * feat: v1.0.0-alpha.1 * fix: multi-app-share-collection --------- Co-authored-by: chenos <chenlinxh@gmail.com> Co-authored-by: Chareice <chareice@live.com> Co-authored-by: katherinehhh <katherine_15995@163.com> Co-authored-by: Zeke Zhang <958414905@qq.com>
api-doc
English | 中文
Introduction
This plugin is based on swagger
to write documentation.
How to access the documentation
- The access address in the plugin center is
{domain}/admin/settings/api-doc/documentation
- The access address outside the plugin center is
{domain}/api-documentation
How to write swagger documentation
The method in the plugin is the same
src/swagger.{ts,json}
src/swagger/index.{ts,json}
The file paths above can all be traversed to write documentation. Just export your written documentation by default. An example is shown below:
export default {
info: {
title: 'NocoBase API - Api-doc plugin',
},
tags: [],
paths: {},
components: {
schemas: {}
}
};
Usually, you only need to write info.title, tags, paths, and components. Other information such as server and info are merged into our base-swagger.
Base swagger includes the following code:
// base swagger
export default {
openapi: '3.0.3',
info: {
title: 'NocoBase API documentation',
description: '',
contact: {
url: 'https://github.com/nocobase/nocobase/issues',
},
license: {
name: 'Core packages are Apache 2.0 & Plugins packages are AGPL 3.0 licensed.',
url: 'https://github.com/nocobase/nocobase#license',
},
},
externalDocs: {
description: 'Find out more about NocoBase',
url: 'https://docs.nocobase.com/',
},
components: {
securitySchemes: {
'api-key': {
type: 'http',
scheme: 'bearer',
},
},
},
security: [
{
'api-key': [],
},
],
};
Note that configurations that can only be obtained at runtime, such as the server and version fields, are not filled in the base-swagger.
You can also override these defaults. When writing the swagger documentation for your plugin, you should consider whether your plugin's documentation can be accessed independently.
For detailed swagger writing rules, please refer to the official documentation.