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

teableio / teable / 8538004962

03 Apr 2024 11:36AM UTC coverage: 18.233% (-3.3%) from 21.535%
8538004962

Pull #528

github

web-flow
Merge c1a248a6f into 45ee7ebb3
Pull Request #528: feat: Kanban view

575 of 1136 branches covered (50.62%)

29 of 2908 new or added lines in 83 files covered. (1.0%)

5 existing lines in 5 files now uncovered.

6439 of 35315 relevant lines covered (18.23%)

3.94 hits per line

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

0.0
/apps/nextjs-app/src/backend/api/rest/table.ssr.ts
1
import type { IFieldVo, IRecord } from '@teable/core';
×
2
import { FieldKeyType } from '@teable/core';
×
3
import type {
×
4
  AcceptInvitationLinkRo,
×
5
  AcceptInvitationLinkVo,
×
6
  IGetBaseVo,
×
7
  IGetDefaultViewIdVo,
×
8
  IGetSpaceVo,
×
9
  IUpdateNotifyStatusRo,
×
10
  ListSpaceCollaboratorVo,
×
11
  ShareViewGetVo,
×
12
  ITableFullVo,
×
13
  ITableListVo,
×
14
} from '@teable/openapi';
×
15
import {
×
16
  ACCEPT_INVITATION_LINK,
×
17
  GET_BASE,
×
18
  GET_BASE_LIST,
×
19
  GET_DEFAULT_VIEW_ID,
×
20
  GET_FIELD_LIST,
×
21
  GET_RECORD_URL,
×
22
  GET_SPACE,
×
23
  GET_TABLE,
×
24
  GET_TABLE_LIST,
×
25
  SHARE_VIEW_GET,
×
26
  SPACE_COLLABORATE_LIST,
×
27
  UPDATE_NOTIFICATION_STATUS,
×
28
  urlBuilder,
×
29
} from '@teable/openapi';
×
30
import type { AxiosInstance } from 'axios';
×
31
import { getAxios } from './axios';
×
32

×
33
export class SsrApi {
×
34
  axios: AxiosInstance;
×
35

×
36
  // eslint-disable-next-line @typescript-eslint/no-empty-function
×
37
  constructor() {
×
38
    this.axios = getAxios();
×
39
  }
×
40

×
41
  async getTable(baseId: string, tableId: string, viewId?: string) {
×
42
    return this.axios
×
43
      .get<ITableFullVo>(urlBuilder(GET_TABLE, { baseId, tableId }), {
×
44
        params: {
×
45
          includeContent: true,
×
46
          viewId,
×
47
          fieldKeyType: FieldKeyType.Id,
×
48
        },
×
49
      })
×
50
      .then(({ data }) => data);
×
51
  }
×
52

×
53
  async getFields(tableId: string) {
×
54
    return this.axios
×
55
      .get<IFieldVo[]>(urlBuilder(GET_FIELD_LIST, { tableId }))
×
56
      .then(({ data }) => data);
×
57
  }
×
58

×
59
  async getTables(baseId: string) {
×
60
    return this.axios
×
61
      .get<ITableListVo>(urlBuilder(GET_TABLE_LIST, { baseId }))
×
62
      .then(({ data }) => data);
×
63
  }
×
64

×
65
  async getDefaultViewId(baseId: string, tableId: string) {
×
66
    return this.axios
×
67
      .get<IGetDefaultViewIdVo>(urlBuilder(GET_DEFAULT_VIEW_ID, { baseId, tableId }))
×
68
      .then(({ data }) => data);
×
69
  }
×
70

×
71
  async getRecord(tableId: string, recordId: string) {
×
72
    return this.axios
×
73
      .get<IRecord>(urlBuilder(GET_RECORD_URL, { tableId, recordId }), {
×
74
        params: { fieldKeyType: FieldKeyType.Id },
×
75
      })
×
76
      .then(({ data }) => data);
×
77
  }
×
78

×
79
  async getBaseById(baseId: string) {
×
80
    return await this.axios
×
81
      .get<IGetBaseVo>(urlBuilder(GET_BASE, { baseId }))
×
82
      .then(({ data }) => data);
×
83
  }
×
84

×
85
  async getSpaceById(spaceId: string) {
×
86
    return await this.axios
×
87
      .get<IGetSpaceVo>(urlBuilder(GET_SPACE, { spaceId }))
×
88
      .then(({ data }) => data);
×
89
  }
×
90

×
91
  async getBaseListBySpaceId(spaceId: string) {
×
92
    return await this.axios
×
93
      .get<IGetBaseVo[]>(urlBuilder(GET_BASE_LIST, { spaceId }))
×
94
      .then(({ data }) => data);
×
95
  }
×
96

×
97
  async getSpaceCollaboratorList(spaceId: string) {
×
98
    return await this.axios
×
99
      .get<ListSpaceCollaboratorVo>(urlBuilder(SPACE_COLLABORATE_LIST, { spaceId }))
×
100
      .then(({ data }) => data);
×
101
  }
×
102

×
103
  async acceptInvitationLink(acceptInvitationLinkRo: AcceptInvitationLinkRo) {
×
104
    return this.axios
×
105
      .post<AcceptInvitationLinkVo>(ACCEPT_INVITATION_LINK, acceptInvitationLinkRo)
×
106
      .then(({ data }) => data);
×
107
  }
×
108

×
109
  async getShareView(shareId: string) {
×
110
    return this.axios
×
111
      .get<ShareViewGetVo>(urlBuilder(SHARE_VIEW_GET, { shareId }))
×
112
      .then(({ data }) => data);
×
113
  }
×
114

×
115
  async updateNotificationStatus(notificationId: string, data: IUpdateNotifyStatusRo) {
×
116
    return this.axios
×
117
      .patch<void>(urlBuilder(UPDATE_NOTIFICATION_STATUS, { notificationId }), data)
×
118
      .then(({ data }) => data);
×
119
  }
×
120
}
×
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