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

teableio / teable / 20065394908

09 Dec 2025 01:36PM UTC coverage: 71.858%. First build
20065394908

Pull #2168

github

web-flow
Merge b9dc7a0f8 into 6fd609a47
Pull Request #2168: feat: base node

22892 of 25545 branches covered (89.61%)

1916 of 2478 new or added lines in 35 files covered. (77.32%)

57741 of 80354 relevant lines covered (71.86%)

4259.47 hits per line

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

80.49
/apps/nestjs-backend/src/event-emitter/events/base/folder/base.folder.event.ts
1
import { match } from 'ts-pattern';
8✔
2
import type { IEventContext } from '../../core-event';
3
import { CoreEvent } from '../../core-event';
4
import { Events } from '../../event.enum';
5

6
type IBaseFolder = {
7
  id: string;
8
  name: string;
9
};
10

11
type IBaseFolderCreatePayload = { baseId: string; folder: IBaseFolder };
12
type IBaseFolderDeletePayload = { baseId: string; folderId: string };
13
type IBaseFolderUpdatePayload = IBaseFolderCreatePayload;
14

15
export class BaseFolderCreateEvent extends CoreEvent<IBaseFolderCreatePayload> {
8✔
16
  public readonly name = Events.BASE_FOLDER_CREATE;
70✔
17

18
  constructor(payload: IBaseFolderCreatePayload, context: IEventContext) {
70✔
19
    super(payload, context);
70✔
20
  }
70✔
21
}
70✔
22

23
export class BaseFolderDeleteEvent extends CoreEvent<IBaseFolderDeletePayload> {
8!
24
  public readonly name = Events.BASE_FOLDER_DELETE;
64✔
25
  constructor(payload: IBaseFolderDeletePayload, context: IEventContext) {
64✔
26
    super(payload, context);
64✔
27
  }
64✔
28
}
64✔
29

30
export class BaseFolderUpdateEvent extends CoreEvent<IBaseFolderUpdatePayload> {
8!
NEW
31
  public readonly name = Events.BASE_FOLDER_UPDATE;
×
32

NEW
33
  constructor(payload: IBaseFolderUpdatePayload, context: IEventContext) {
×
NEW
34
    super(payload, context);
×
NEW
35
  }
×
NEW
36
}
×
37

38
export class BaseFolderEventFactory {
8✔
39
  static create(
8✔
40
    name: string,
134✔
41
    payload: IBaseFolderCreatePayload | IBaseFolderDeletePayload | IBaseFolderUpdatePayload,
134✔
42
    context: IEventContext
134✔
43
  ) {
134✔
44
    return match(name)
134✔
45
      .with(Events.BASE_FOLDER_CREATE, () => {
134✔
46
        const { baseId, folder } = payload as IBaseFolderCreatePayload;
70✔
47
        return new BaseFolderCreateEvent({ baseId, folder }, context);
70✔
48
      })
70✔
49
      .with(Events.BASE_FOLDER_DELETE, () => {
134✔
50
        const { baseId, folderId } = payload as IBaseFolderDeletePayload;
64✔
51
        return new BaseFolderDeleteEvent({ baseId, folderId }, context);
64✔
52
      })
64✔
53
      .with(Events.BASE_FOLDER_UPDATE, () => {
134✔
NEW
54
        const { baseId, folder } = payload as IBaseFolderUpdatePayload;
×
NEW
55
        return new BaseFolderUpdateEvent({ baseId, folder }, context);
×
NEW
56
      })
×
57
      .otherwise(() => null);
134✔
58
  }
134✔
59
}
8✔
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