• 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/import/import-table.ts
1
import type { RouteConfig } from '@asteasolutions/zod-to-openapi';
×
NEW
2
import type { IImportOptionRo } from '@teable/core';
×
NEW
3
import { importOptionRoSchema } from '@teable/core';
×
4
import { axios } from '../axios';
×
NEW
5
import type { ITableFullVo } from '../table';
×
NEW
6
import { tableVoSchema } from '../table';
×
7
import { registerRoute, urlBuilder } from '../utils';
×
8
import { z } from '../zod';
×
9

×
10
export const IMPORT_TABLE = '/import/{baseId}';
×
11

×
12
export const ImportTableFromFileRoute: RouteConfig = registerRoute({
×
13
  method: 'post',
×
14
  path: IMPORT_TABLE,
×
15
  description: 'create table from file',
×
16
  request: {
×
17
    params: z.object({
×
18
      baseId: z.string(),
×
19
    }),
×
20
    body: {
×
21
      content: {
×
22
        'application/json': {
×
23
          schema: importOptionRoSchema,
×
24
        },
×
25
      },
×
26
    },
×
27
  },
×
28
  responses: {
×
29
    200: {
×
30
      description: 'Returns data about a table without records',
×
31
      content: {
×
32
        'application/json': {
×
33
          schema: tableVoSchema,
×
34
        },
×
35
      },
×
36
    },
×
37
  },
×
38
  tags: ['import'],
×
39
});
×
40

×
41
export const importTableFromFile = async (baseId: string, importRo: IImportOptionRo) => {
×
42
  return axios.post<ITableFullVo[]>(urlBuilder(IMPORT_TABLE, { baseId }), importRo);
×
43
};
×
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