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

teableio / teable / 8432338670

26 Mar 2024 07:31AM CUT coverage: 26.059% (-0.05%) from 26.106%
8432338670

Pull #493

github

web-flow
Merge 5e65977dd into 98543ea09
Pull Request #493: feat: export csv

2106 of 3377 branches covered (62.36%)

9 of 220 new or added lines in 12 files covered. (4.09%)

1 existing line in 1 file now uncovered.

25609 of 98275 relevant lines covered (26.06%)

5.16 hits per line

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

0.0
/packages/core/src/auth/actions.ts
1
/* eslint-disable @typescript-eslint/naming-convention */
×
2
import { z } from 'zod';
×
3

×
4
export enum ActionPrefix {
×
5
  Space = 'space',
×
6
  Base = 'base',
×
7
  Table = 'table',
×
8
  View = 'view',
×
9
  Record = 'record',
×
10
  Field = 'field',
×
11
}
×
12

×
13
const defaultActionsSchema = z.enum(['create', 'update', 'delete', 'read']);
×
14

×
15
export const spaceActionsSchema = defaultActionsSchema.or(
×
16
  z.enum(['invite_email', 'invite_link', 'grant_role'])
×
17
);
×
18

×
19
export type SpaceActions = `${ActionPrefix.Space}|${z.infer<typeof spaceActionsSchema>}`;
×
20

×
NEW
21
export const baseActionsSchema = defaultActionsSchema.or(
×
NEW
22
  z.enum(['invite_email', 'invite_link', 'table_import', 'table_export'])
×
NEW
23
);
×
24

×
25
export type BaseActions = `${ActionPrefix.Base}|${z.infer<typeof baseActionsSchema>}`;
×
26

×
NEW
27
export const tableActionsSchema = defaultActionsSchema.or(z.enum(['import', 'export']));
×
28

×
29
export type TableActions = `${ActionPrefix.Table}|${z.infer<typeof tableActionsSchema>}`;
×
30

×
31
export const viewActionsSchema = defaultActionsSchema;
×
32

×
33
export type ViewActions = `${ActionPrefix.View}|${z.infer<typeof viewActionsSchema>}`;
×
34

×
35
export const fieldActionsSchema = defaultActionsSchema;
×
36

×
37
export type FieldActions = `${ActionPrefix.Field}|${z.infer<typeof fieldActionsSchema>}`;
×
38

×
39
export const recordActionsSchema = defaultActionsSchema.or(z.enum(['comment']));
×
40

×
41
export type RecordActions = `${ActionPrefix.Record}|${z.infer<typeof recordActionsSchema>}`;
×
42

×
43
export type AllActions =
×
44
  | SpaceActions
×
45
  | BaseActions
×
46
  | TableActions
×
47
  | ViewActions
×
48
  | FieldActions
×
49
  | RecordActions;
×
50

×
51
export type ActionPrefixMap = {
×
52
  [ActionPrefix.Space]: SpaceActions[];
×
53
  [ActionPrefix.Base]: BaseActions[];
×
54
  [ActionPrefix.Table]: TableActions[];
×
55
  [ActionPrefix.View]: ViewActions[];
×
56
  [ActionPrefix.Field]: FieldActions[];
×
57
  [ActionPrefix.Record]: RecordActions[];
×
58
};
×
59

×
60
export const actionPrefixMap: ActionPrefixMap = {
×
61
  [ActionPrefix.Space]: ['space|create', 'space|delete', 'space|read', 'space|update'],
×
NEW
62
  [ActionPrefix.Base]: [
×
NEW
63
    'base|create',
×
NEW
64
    'base|delete',
×
NEW
65
    'base|read',
×
NEW
66
    'base|update',
×
NEW
67
    'base|table_import',
×
NEW
68
    'base|table_export',
×
NEW
69
  ],
×
70
  [ActionPrefix.Table]: ['table|create', 'table|delete', 'table|read', 'table|update'],
×
71
  [ActionPrefix.View]: ['view|create', 'view|delete', 'view|read', 'view|update'],
×
72
  [ActionPrefix.Field]: ['field|create', 'field|delete', 'field|read', 'field|update'],
×
73
  [ActionPrefix.Record]: [
×
74
    'record|comment',
×
75
    'record|create',
×
76
    'record|delete',
×
77
    'record|read',
×
78
    'record|update',
×
79
  ],
×
80
};
×
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