Skip to content

Commit aac7bd0

Browse files
committed
upgrade to slack/bolt v4
1 parent a0ba9dd commit aac7bd0

14 files changed

+243
-1110
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
"preinstall": "npx only-allow pnpm"
2828
},
2929
"devDependencies": {
30-
"@slack/types": "2.12.0",
30+
"@slack/types": "2.15.0",
3131
"@types/chance": "1.1.6",
32+
"@types/express": "^5.0.3",
3233
"@types/google-spreadsheet": "3.3.2",
3334
"@types/jest": "29.5.12",
3435
"@types/node": "22.10.6",
@@ -50,7 +51,7 @@
5051
"@aws-sdk/client-lambda": "^3.699.0",
5152
"@aws-sdk/client-s3": "^3.665.0",
5253
"@aws-sdk/s3-request-presigner": "^3.665.0",
53-
"@slack/bolt": "3.18.0",
54+
"@slack/bolt": "4.4.0",
5455
"dotenv": "16.4.5",
5556
"google-spreadsheet": "3.3.0",
5657
"lock": "1.1.0",

pnpm-lock.yaml

Lines changed: 204 additions & 1082 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bot/acceptReviewRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ export const acceptReviewRequest = {
3333
try {
3434
const user = body.user;
3535
const threadId = body.actions[0].value;
36+
if (!threadId) {
37+
throw new Error('No thread ID in action value');
38+
}
3639

3740
if (!body.message) {
3841
throw new Error('No message exists on body - unable to accept review');
3942
}
4043

4144
const messageTimestamp = body.message.ts;
45+
if (!messageTimestamp) {
46+
throw new Error('No timestamp on message');
47+
}
4248

4349
log.d('acceptReviewRequest.handleAccept', `${user.name} accepted review ${threadId}`);
4450

src/bot/declineReviewRequest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const declineReviewRequest = {
2323
try {
2424
const user = body.user;
2525
const threadId = body.actions[0].value;
26+
if (!threadId) {
27+
throw new Error('No thread ID in action value');
28+
}
2629

2730
log.d('declineReviewRequest.handleDecline', `${user.name} declined review ${threadId}`);
2831

src/bot/getReviewInfo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { GlobalShortcutParam } from '@/slackTypes';
22
import { userRepo } from '@repos/userRepo';
3-
import { App, View } from '@slack/bolt';
3+
import { App } from '@slack/bolt';
4+
import { View } from '@slack/types';
45
import log from '@utils/log';
56
import { ul } from '@utils/text';
67
import { Interaction } from './enums';

src/bot/joinQueue.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { CallbackParam, ShortcutParam } from '@/slackTypes';
22
import { languageRepo } from '@repos/languageRepo';
33
import { userRepo } from '@repos/userRepo';
4-
import { App, Option, View } from '@slack/bolt';
4+
import { App } from '@slack/bolt';
5+
import { Option, View } from '@slack/types';
56
import { blockUtils } from '@utils/blocks';
67
import log from '@utils/log';
78
import { bold, codeBlock, compose } from '@utils/text';

src/bot/requestReview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { isViewSubmitActionParam } from '@/typeGuards';
33
import { activeReviewRepo } from '@repos/activeReviewsRepo';
44
import { languageRepo } from '@repos/languageRepo';
55
import { QueueService } from '@services';
6-
import { App, Block, KnownBlock, PlainTextOption, View } from '@slack/bolt';
6+
import { App } from '@slack/bolt';
7+
import { Block, KnownBlock, PlainTextOption, View } from '@slack/types';
78
import { blockUtils } from '@utils/blocks';
89
import log from '@utils/log';
910
import { bold, codeBlock, compose, italic, mention, ul } from '@utils/text';

src/services/ChatService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ChatResponse, WebClient } from '@/slackTypes';
2-
import { Block } from '@slack/bolt';
32
import { requestBuilder } from '@utils/RequestBuilder';
4-
import { KnownBlock } from '@slack/types';
3+
import { Block, KnownBlock } from '@slack/types';
54

65
export const chatService = {
76
/**

src/services/PositionInQueueBlocksService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { PositionInformation } from '@/services/models/PositionInformation';
2-
import { KnownBlock, SectionBlock } from '@slack/types';
3-
import { DividerBlock, HeaderBlock } from '@slack/bolt';
2+
import { DividerBlock, HeaderBlock, KnownBlock, SectionBlock } from '@slack/types';
43

54
function buildBlocks(positionInformation: PositionInformation): KnownBlock[] {
65
const header = buildHeader();

src/services/__tests__/ChatService.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { buildMockWebClient } from '@utils/slackMocks';
22
import { chatService } from '@/services/ChatService';
3-
import { Block } from '@slack/bolt';
3+
import { Block } from '@slack/types';
44
import { Deadline, DeadlineLabel } from '@bot/enums';
55

66
describe('ChatService', () => {

0 commit comments

Comments
 (0)