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

teableio / teable / 8389034572

22 Mar 2024 10:38AM UTC coverage: 26.087% (-2.1%) from 28.208%
8389034572

Pull #487

github

web-flow
Merge 3045b1f94 into a06c6afb1
Pull Request #487: refactor: move zod schema to openapi

2100 of 3363 branches covered (62.44%)

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

224 existing lines in 8 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

0.0
/packages/openapi/src/share/view-link-records.ts
1
import type { RouteConfig } from '@asteasolutions/zod-to-openapi';
×
2
import { axios } from '../axios';
×
NEW
3
import { getRecordsRoSchema, recordsVoSchema } from '../record';
×
4
import { registerRoute, urlBuilder } from '../utils';
×
5
import { z } from '../zod';
×
6

×
7
export const SHARE_VIEW_LINK_RECORDS = '/share/{shareId}/view/link-records';
×
8

×
9
export const shareViewLinkRecordsRoSchema = getRecordsRoSchema
×
10
  .omit({
×
11
    viewId: true,
×
12
    projection: true,
×
13
    filterLinkCellSelected: true,
×
14
  })
×
15
  .extend({
×
16
    tableId: z.string(),
×
17
  });
×
18

×
19
export type IShareViewLinkRecordsRo = z.infer<typeof shareViewLinkRecordsRoSchema>;
×
20

×
21
export const shareViewLinkRecordsVoSchema = recordsVoSchema;
×
22

×
23
export type IShareViewLinkRecordsVo = z.infer<typeof shareViewLinkRecordsVoSchema>;
×
24

×
25
export const ShareViewLinkRecordsRoute: RouteConfig = registerRoute({
×
26
  method: 'get',
×
27
  path: SHARE_VIEW_LINK_RECORDS,
×
28
  description: 'Link records in Share view',
×
29
  request: {
×
30
    params: z.object({
×
31
      shareId: z.string(),
×
32
    }),
×
33
    query: shareViewLinkRecordsRoSchema,
×
34
  },
×
35
  responses: {
×
36
    200: {
×
37
      description: 'Link records',
×
38
      content: {
×
39
        'application/json': {
×
40
          schema: shareViewLinkRecordsVoSchema,
×
41
        },
×
42
      },
×
43
    },
×
44
  },
×
45
  tags: ['share'],
×
46
});
×
47

×
48
export const getShareViewLinkRecords = async (shareId: string, query: IShareViewLinkRecordsRo) => {
×
49
  return axios.get<IShareViewLinkRecordsVo>(urlBuilder(SHARE_VIEW_LINK_RECORDS, { shareId }), {
×
50
    params: query,
×
51
  });
×
52
};
×
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

© 2025 Coveralls, Inc