-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathISlackRequestService.ts
More file actions
34 lines (22 loc) · 1.34 KB
/
ISlackRequestService.ts
File metadata and controls
34 lines (22 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { NextApiRequest } from 'next';
import type { BlockAction, GlobalShortcut, SlashCommand } from '@slack/bolt';
import type { Member } from '../../entities';
import type { AnyModalServiceMethodParams } from './IModalService';
export interface ActionHandlerBaseParams<T extends AnyAction> {
body: T;
member: Member;
modalServiceParams: AnyModalServiceMethodParams;
}
export type NonSlashCommandAction = BlockAction | GlobalShortcut;
export type NonShortcutEvent = SlashCommand | BlockAction;
export type AnyAction = SlashCommand | BlockAction | GlobalShortcut;
export type ActionHandlerParams<T extends AnyAction> = ActionHandlerBaseParams<T>;
export interface ISlackRequestService {
validateSlackRequestAndReturnBuffer(req: NextApiRequest): Promise<Buffer>;
handleRenderMainMenu(params: ActionHandlerParams<NonShortcutEvent>): Promise<void>;
handleRenderCheckInSelfConfirmation(params: ActionHandlerParams<NonSlashCommandAction>): Promise<void>
handleRenderCheckInOtherMemberConfirmation(params: ActionHandlerParams<NonSlashCommandAction>): Promise<void>;
handleRenderRepeatCheckInConfirmation(params: ActionHandlerParams<NonSlashCommandAction>): Promise<void>;
handleClickConfirmAndRepeat(params: ActionHandlerParams<BlockAction>): Promise<void>;
handleRenderSuccess(params: ActionHandlerParams<BlockAction>): Promise<void>;
}