Skip to content

Commit

Permalink
Bump @slack/types and consume event payloads from it (#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
filmaj authored Aug 30, 2024
1 parent 1508366 commit abbe82c
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 2,290 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@slack/logger": "^4.0.0",
"@slack/oauth": "^2.6.3",
"@slack/socket-mode": "^1.3.6",
"@slack/types": "^2.11.0",
"@slack/types": "^2.13.0",
"@slack/web-api": "^6.12.1",
"@types/express": "^4.16.1",
"@types/promise.allsettled": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/CustomFunction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { FunctionExecutedEvent } from '@slack/types';
import {
WebClient,
FunctionsCompleteErrorResponse,
Expand All @@ -11,7 +12,6 @@ import {
AnyMiddlewareArgs,
SlackEventMiddlewareArgs,
Context,
FunctionExecutedEvent,
} from './types';
import processMiddleware from './middleware/process';
import { CustomFunctionCompleteFailError, CustomFunctionCompleteSuccessError, CustomFunctionInitializationError } from './errors';
Expand Down
2 changes: 1 addition & 1 deletion src/WorkflowStep.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { WorkflowStepExecuteEvent } from '@slack/types';
import {
KnownBlock,
Block,
Expand All @@ -17,7 +18,6 @@ import {
Context,
SlackEventMiddlewareArgs,
ViewWorkflowStepSubmitAction,
WorkflowStepExecuteEvent,
} from './types';
import processMiddleware from './middleware/process';
import { WorkflowStepInitializationError } from './errors';
Expand Down
11 changes: 7 additions & 4 deletions src/middleware/builtin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ import sinon from 'sinon';
import rewiremock from 'rewiremock';
import { Logger } from '@slack/logger';
import { WebClient } from '@slack/web-api';
import {
AppHomeOpenedEvent,
AppMentionEvent,
GenericMessageEvent,
MessageEvent,
SlackEvent,
} from '@slack/types';
import { ErrorCode } from '../errors';
import { Override, createFakeLogger } from '../test-helpers';
import {
SlackEventMiddlewareArgs,
NextFn,
Context,
SlackEvent,
MessageEvent,
SlackCommandMiddlewareArgs,
} from '../types';
import { onlyCommands, onlyEvents, matchCommandName, matchEventType, subtype } from './builtin';
import { SlashCommand } from '../types/command';
import { AppMentionEvent, AppHomeOpenedEvent } from '../types/events';
import { GenericMessageEvent } from '../types/events/message-events';

// Test fixtures
const validCommandPayload: SlashCommand = {
Expand Down
3 changes: 1 addition & 2 deletions src/middleware/builtin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/dot-notation */

import { SlackEvent } from '@slack/types';
import {
Middleware,
AnyMiddlewareArgs,
Expand All @@ -9,7 +9,6 @@ import {
SlackOptionsMiddlewareArgs,
SlackShortcutMiddlewareArgs,
SlackViewMiddlewareArgs,
SlackEvent,
SlackAction,
SlackShortcut,
SlashCommand,
Expand Down
41 changes: 0 additions & 41 deletions src/types/events/base-events.spec.ts

This file was deleted.

Loading

0 comments on commit abbe82c

Please sign in to comment.