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

teableio / teable / 8389034572

22 Mar 2024 10:38AM CUT 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-aggregations.ts
1
import type { RouteConfig } from '@asteasolutions/zod-to-openapi';
×
NEW
2
import { viewVoSchema } from '@teable/core';
×
NEW
3
import type { IAggregationVo } from '../aggregation';
×
NEW
4
import { aggregationRoSchema } from '../aggregation';
×
5
import { axios } from '../axios';
×
6
import { registerRoute, urlBuilder } from '../utils';
×
7
import { z } from '../zod';
×
8

×
9
export const SHARE_VIEW_AGGREGATIONS_LIST = '/share/{shareId}/view/aggregations';
×
10

×
11
export const shareViewAggregationsRoSchema = aggregationRoSchema.omit({
×
12
  viewId: true,
×
13
});
×
14

×
15
export type IShareViewAggregationsRo = z.infer<typeof shareViewAggregationsRoSchema>;
×
16

×
17
export const ShareViewAggregationsRoute: RouteConfig = registerRoute({
×
18
  method: 'get',
×
19
  path: SHARE_VIEW_AGGREGATIONS_LIST,
×
20
  description: 'Get share view aggregations',
×
21
  request: {
×
22
    params: z.object({
×
23
      shareId: z.string(),
×
24
    }),
×
25
    query: shareViewAggregationsRoSchema,
×
26
  },
×
27
  responses: {
×
28
    200: {
×
29
      description: 'Returns aggregations list of share view.',
×
30
      content: {
×
31
        'application/json': {
×
32
          schema: z.array(viewVoSchema),
×
33
        },
×
34
      },
×
35
    },
×
36
  },
×
37
  tags: ['share'],
×
38
});
×
39

×
40
export const getShareViewAggregations = async (
×
41
  shareId: string,
×
42
  query?: IShareViewAggregationsRo
×
43
) => {
×
44
  return axios.get<IAggregationVo>(urlBuilder(SHARE_VIEW_AGGREGATIONS_LIST, { shareId }), {
×
45
    params: {
×
46
      ...query,
×
47
      filter: JSON.stringify(query?.filter),
×
48
    },
×
49
  });
×
50
};
×
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