• 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/aggregation/get-row-count.ts
1
import type { RouteConfig } from '@asteasolutions/zod-to-openapi';
×
2
import { axios } from '../axios';
×
NEW
3
import type { IQueryBaseRo } from '../record';
×
NEW
4
import { queryBaseSchema } from '../record';
×
5
import { registerRoute, urlBuilder } from '../utils';
×
6
import { z } from '../zod';
×
NEW
7
import { baseRawAggregationValueSchema } from './get-aggregation';
×
NEW
8

×
NEW
9
export const rawRowCountValueSchema = baseRawAggregationValueSchema.pick({
×
NEW
10
  rowCount: true,
×
NEW
11
});
×
NEW
12

×
NEW
13
export type IRawRowCountValue = z.infer<typeof rawRowCountValueSchema>;
×
NEW
14

×
NEW
15
export const rowCountVoSchema = rawRowCountValueSchema;
×
NEW
16

×
NEW
17
export type IRowCountVo = z.infer<typeof rowCountVoSchema>;
×
18

×
19
export const GET_ROW_COUNT = '/table/{tableId}/aggregation/row-count';
×
20

×
21
export const GetRowCountRoute: RouteConfig = registerRoute({
×
22
  method: 'get',
×
23
  path: GET_ROW_COUNT,
×
24
  description: 'Get row count for the view',
×
25
  request: {
×
26
    params: z.object({
×
27
      tableId: z.string(),
×
28
    }),
×
29
    query: queryBaseSchema,
×
30
  },
×
31
  responses: {
×
32
    200: {
×
33
      description: 'Row count for the view',
×
34
      content: {
×
35
        'application/json': {
×
36
          schema: rowCountVoSchema,
×
37
        },
×
38
      },
×
39
    },
×
40
  },
×
41
  tags: ['aggregation'],
×
42
});
×
43

×
44
export const getRowCount = async (tableId: string, query?: IQueryBaseRo) => {
×
45
  return axios.get<IRowCountVo>(urlBuilder(GET_ROW_COUNT, { tableId }), { params: query });
×
46
};
×
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