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

teableio / teable / 8389227144

22 Mar 2024 10:56AM UTC coverage: 26.087% (-53.9%) from 79.937%
8389227144

push

github

web-flow
refactor: move zod schema to openapi (#487)

2100 of 3363 branches covered (62.44%)

282 of 757 new or added lines in 74 files covered. (37.25%)

14879 existing lines in 182 files now uncovered.

25574 of 98035 relevant lines covered (26.09%)

5.17 hits per line

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

46.67
/apps/nestjs-backend/src/features/selection/selection.controller.ts
1
import { Body, Controller, Get, Param, Patch, Query } from '@nestjs/common';
1✔
2
import type { ICopyVo, IRangesToIdVo, IPasteVo } from '@teable/openapi';
1✔
3
import {
1✔
4
  IRangesToIdQuery,
1✔
5
  rangesToIdQuerySchema,
1✔
6
  rangesQuerySchema,
1✔
7
  IPasteRo,
1✔
8
  pasteRoSchema,
1✔
9
  rangesRoSchema,
1✔
10
  IRangesRo,
1✔
11
} from '@teable/openapi';
1✔
12
import { ZodValidationPipe } from '../../zod.validation.pipe';
1✔
13
import { Permissions } from '../auth/decorators/permissions.decorator';
1✔
14
import { TqlPipe } from '../record/open-api/tql.pipe';
1✔
15
import { SelectionService } from './selection.service';
1✔
16

1✔
17
@Controller('api/table/:tableId/selection')
1✔
18
export class SelectionController {
1✔
19
  constructor(private selectionService: SelectionService) {}
28✔
20

28✔
21
  @Permissions('record|read')
28✔
UNCOV
22
  @Get('/range-to-id')
×
UNCOV
23
  async getIdsFromRanges(
×
UNCOV
24
    @Param('tableId') tableId: string,
×
UNCOV
25
    @Query(new ZodValidationPipe(rangesToIdQuerySchema), TqlPipe) query: IRangesToIdQuery
×
UNCOV
26
  ): Promise<IRangesToIdVo> {
×
UNCOV
27
    return this.selectionService.getIdsFromRanges(tableId, query);
×
UNCOV
28
  }
×
29

28✔
30
  @Permissions('record|read')
28✔
UNCOV
31
  @Get('/copy')
×
UNCOV
32
  async copy(
×
UNCOV
33
    @Param('tableId') tableId: string,
×
UNCOV
34
    @Query(new ZodValidationPipe(rangesQuerySchema), TqlPipe) query: IRangesRo
×
UNCOV
35
  ): Promise<ICopyVo> {
×
UNCOV
36
    return this.selectionService.copy(tableId, query);
×
UNCOV
37
  }
×
38

28✔
39
  @Permissions('record|update')
28✔
UNCOV
40
  @Patch('/paste')
×
UNCOV
41
  async paste(
×
UNCOV
42
    @Param('tableId') tableId: string,
×
UNCOV
43
    @Body(new ZodValidationPipe(pasteRoSchema), TqlPipe)
×
UNCOV
44
    pasteRo: IPasteRo
×
UNCOV
45
  ): Promise<IPasteVo> {
×
UNCOV
46
    const ranges = await this.selectionService.paste(tableId, pasteRo);
×
UNCOV
47
    return { ranges };
×
UNCOV
48
  }
×
49

28✔
50
  @Permissions('record|update')
28✔
51
  @Patch('/clear')
×
52
  async clear(
×
53
    @Param('tableId') tableId: string,
×
54
    @Body(new ZodValidationPipe(rangesRoSchema), TqlPipe)
×
55
    rangesRo: IRangesRo
×
56
  ) {
×
57
    await this.selectionService.clear(tableId, rangesRo);
×
58
    return null;
×
59
  }
×
60
}
28✔
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