@@ -1,6 +1,6 @@
-import { AuthorizeResult } from '@slack/oauth';
+import type { AuthorizeResult } from '@slack/oauth';
-import { GrowiCommand } from './growi-command';
+import type { GrowiCommand } from './growi-command';
export interface GrowiCommandProcessor<ProcessCommandContext = {[key: string]: string}> {
shouldHandleCommand(growiCommand?: GrowiCommand): boolean;
@@ -1,4 +1,4 @@
-import { WebClient } from '@slack/web-api';
+import type { WebClient } from '@slack/web-api';
export interface GrowiEventProcessor {
shouldHandleEvent(eventType: string): boolean;
import { InteractionPayloadAccessor } from '../utils/interaction-payload-accessor';
-import { Request } from 'express';
+import type { Request } from 'express';
export interface BlockKitRequest {
// Block Kit properties
export interface IInteractionPayloadAccessor {
firstAction(): any;
-import { RespondBodyForResponseUrl } from './response-url';
+import type { RespondBodyForResponseUrl } from './response-url';
export interface IRespondUtil {
respond(body: RespondBodyForResponseUrl): Promise<void>,
-import { KnownBlock, Block } from '@slack/web-api';
+import type { KnownBlock, Block } from '@slack/web-api';
export type RespondBodyForResponseUrl = {
text?: string,
-import { Response, NextFunction } from 'express';
+import type { Response, NextFunction } from 'express';
-import { RequestFromSlack } from '../interfaces/request-from-slack';
+import type { RequestFromSlack } from '../interfaces/request-from-slack';
@@ -1,7 +1,7 @@
import createError from 'http-errors';
-import { RequestFromGrowi } from '../interfaces/request-between-growi-and-proxy';
+import type { RequestFromGrowi } from '../interfaces/request-between-growi-and-proxy';
import loggerFactory from '../utils/logger';
const logger = loggerFactory('@growi/slack:middlewares:verify-growi-to-slack-request');
@@ -1,10 +1,10 @@
import { createHmac, timingSafeEqual } from 'crypto';
import { stringify } from 'qs';
const logger = loggerFactory('@growi/slack:middlewares:verify-slack-request');
-import {
+import type {
SectionBlock, HeaderBlock, InputBlock, DividerBlock, ActionsBlock,
Button, Overflow, Datepicker, Select, RadioButtons, Checkboxes, Action, MultiSelect, PlainTextInput, Option,
} from '@slack/types';
@@ -1,8 +1,8 @@
import { WebClient } from '@slack/web-api';
-import axios, { AxiosError } from 'axios';
+import axios, { type AxiosError } from 'axios';
-import { ConnectionStatus } from '../interfaces/connection-status';
+import type { ConnectionStatus } from '../interfaces/connection-status';
import { markdownSectionBlock } from './block-kit-builder';
import { requiredScopes } from './required-scopes';
import assert from 'assert';
-import { IChannel } from '../interfaces/channel';
-import { IInteractionPayloadAccessor } from '../interfaces/request-from-slack';
+import type { IChannel } from '../interfaces/channel';
+import type { IInteractionPayloadAccessor } from '../interfaces/request-from-slack';
import loggerFactory from './logger';
-import { IChannelOptionalId } from '../interfaces/channel';
+import type { IChannelOptionalId } from '../interfaces/channel';
export const permissionParser = (permissionForCommand: boolean | string[], channel: IChannelOptionalId): boolean => {
-import { WebAPICallResult } from '@slack/web-api';
+import type { WebAPICallResult } from '@slack/web-api';
import { respond } from './response-url';
// Now Home tab is disabled
// TODO Imple Home tab
-import { ViewsPublishResponse, WebClient } from '@slack/web-api';
+import type { ViewsPublishResponse, WebClient } from '@slack/web-api';
export const publishInitialHomeView = (client: WebClient, userId: string): Promise<ViewsPublishResponse> => {
return client.views.publish({
import axios from 'axios';
import urljoin from 'url-join';
-import { IRespondUtil } from '../interfaces/respond-util';
-import { RespondBodyForResponseUrl } from '../interfaces/response-url';
+import type { IRespondUtil } from '../interfaces/respond-util';
+import type { RespondBodyForResponseUrl } from '../interfaces/response-url';
type AxiosOptions = {
headers?: {
export async function respond(responseUrl: string, body: RespondBodyForResponseUrl): Promise<void> {
return axios.post(responseUrl, {
-import { GrowiCommand } from '../interfaces/growi-command';
+import type { GrowiCommand } from '../interfaces/growi-command';
import { InvalidGrowiCommandError } from '../models/errors';
export const parseSlashCommand = (slashCommand:{[key:string]:string}): GrowiCommand => {
-import { LogLevel, WebClient, WebClientOptions } from '@slack/web-api';
+import { LogLevel, WebClient, type WebClientOptions } from '@slack/web-api';
const isProduction = process.env.NODE_ENV === 'production';
const logLevel: LogLevel = isProduction ? LogLevel.DEBUG : LogLevel.INFO;