• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 13519268829

25 Feb 2025 10:39AM UTC coverage: 81.337% (+0.007%) from 81.33%
13519268829

push

github

web-flow
feat: table plugin (#1340)

* chore: sonner component import

* chore: publish 1.6.1-beta.0 release

* chore: publish 1.6.1-beta.1 release

* feat: add plugin status ui and fix some plugin ui

* feat: add panel plugin and record menu plugin

* feat: chart plugin support table panel

* fix: line and area chart label decimal

* fix: init plugin context order when install

* fix: update plugin logo

* chore: revert versions

6821 of 7251 branches covered (94.07%)

768 of 909 new or added lines in 12 files covered. (84.49%)

24 existing lines in 2 files now uncovered.

32038 of 39389 relevant lines covered (81.34%)

1805.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/apps/nestjs-backend/src/features/plugin/plugin.controller.ts
1
import { Body, Controller, Delete, Get, Param, Patch, Post, Put, Query } from '@nestjs/common';
4✔
2
import type {
3
  ICreatePluginVo,
4
  IGetPluginCenterListVo,
5
  IGetPluginsVo,
6
  IGetPluginVo,
7
  IPluginGetTokenVo,
8
  IPluginRefreshTokenVo,
9
  IPluginRegenerateSecretVo,
10
  IUpdatePluginVo,
11
} from '@teable/openapi';
12
import {
13
  createPluginRoSchema,
14
  ICreatePluginRo,
15
  updatePluginRoSchema,
16
  IUpdatePluginRo,
17
  getPluginCenterListRoSchema,
18
  IGetPluginCenterListRo,
19
  pluginGetTokenRoSchema,
20
  IPluginGetTokenRo,
21
  pluginRefreshTokenRoSchema,
22
  IPluginRefreshTokenRo,
23
} from '@teable/openapi';
24
import { ZodValidationPipe } from '../../zod.validation.pipe';
25
import { Permissions } from '../auth/decorators/permissions.decorator';
26
import { Public } from '../auth/decorators/public.decorator';
27
import { ResourceMeta } from '../auth/decorators/resource_meta.decorator';
28
import { PluginAuthService } from './plugin-auth.service';
29
import { PluginService } from './plugin.service';
30

31
@Controller('api/plugin')
32
export class PluginController {
4✔
33
  constructor(
107✔
34
    private readonly pluginService: PluginService,
107✔
35
    private readonly pluginAuthService: PluginAuthService
107✔
36
  ) {}
107✔
37

38
  @Post()
39
  createPlugin(
107✔
40
    @Body(new ZodValidationPipe(createPluginRoSchema)) data: ICreatePluginRo
66✔
41
  ): Promise<ICreatePluginVo> {
66✔
42
    return this.pluginService.createPlugin(data);
66✔
43
  }
66✔
44

45
  @Get()
46
  getPlugins(): Promise<IGetPluginsVo> {
107✔
47
    return this.pluginService.getPlugins();
2✔
48
  }
2✔
49

50
  @Get(':pluginId')
51
  getPlugin(@Param('pluginId') pluginId: string): Promise<IGetPluginVo> {
107✔
52
    return this.pluginService.getPlugin(pluginId);
8✔
53
  }
8✔
54

55
  @Post(':pluginId/regenerate-secret')
56
  regenerateSecret(@Param('pluginId') pluginId: string): Promise<IPluginRegenerateSecretVo> {
107✔
57
    return this.pluginService.regenerateSecret(pluginId);
×
58
  }
×
59

60
  @Put(':pluginId')
61
  updatePlugin(
107✔
62
    @Param('pluginId') pluginId: string,
2✔
63
    @Body(new ZodValidationPipe(updatePluginRoSchema)) ro: IUpdatePluginRo
2✔
64
  ): Promise<IUpdatePluginVo> {
2✔
65
    return this.pluginService.updatePlugin(pluginId, ro);
2✔
66
  }
2✔
67

68
  @Delete(':pluginId')
69
  deletePlugin(@Param('pluginId') pluginId: string): Promise<void> {
107✔
70
    return this.pluginService.delete(pluginId);
66✔
71
  }
66✔
72

73
  @Get('center/list')
74
  getPluginCenterList(
107✔
75
    @Query(new ZodValidationPipe(getPluginCenterListRoSchema)) ro: IGetPluginCenterListRo
4✔
76
  ): Promise<IGetPluginCenterListVo> {
4✔
77
    return this.pluginService.getPluginCenterList(ro.positions, ro.ids);
4✔
78
  }
4✔
79

80
  @Patch(':pluginId/submit')
81
  submitPlugin(@Param('pluginId') pluginId: string): Promise<void> {
107✔
82
    return this.pluginService.submitPlugin(pluginId);
40✔
83
  }
40✔
84

85
  @Patch(':pluginId/unpublish')
86
  unpublishPlugin(@Param('pluginId') pluginId: string): Promise<void> {
107✔
NEW
87
    return this.pluginService.unpublishPlugin(pluginId);
×
NEW
88
  }
×
89

90
  @Post(':pluginId/token')
91
  @Public()
92
  accessToken(
107✔
93
    @Param('pluginId') pluginId: string,
×
94
    @Body(new ZodValidationPipe(pluginGetTokenRoSchema)) ro: IPluginGetTokenRo
×
95
  ): Promise<IPluginGetTokenVo> {
×
96
    return this.pluginAuthService.token(pluginId, ro);
×
97
  }
×
98

99
  @Post(':pluginId/refreshToken')
100
  @Public()
101
  refreshToken(
107✔
102
    @Param('pluginId') pluginId: string,
×
103
    @Body(new ZodValidationPipe(pluginRefreshTokenRoSchema)) ro: IPluginRefreshTokenRo
×
104
  ): Promise<IPluginRefreshTokenVo> {
×
105
    return this.pluginAuthService.refreshToken(pluginId, ro);
×
106
  }
×
107

108
  @Post(':pluginId/authCode')
109
  @Permissions('base|read')
110
  @ResourceMeta('baseId', 'body')
111
  authCode(@Param('pluginId') pluginId: string, @Body('baseId') baseId: string): Promise<string> {
107✔
112
    return this.pluginAuthService.authCode(pluginId, baseId);
×
113
  }
×
114
}
107✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc