Yuki Takei пре 3 година
родитељ
комит
9f99435d49

+ 2 - 2
packages/slack/src/interfaces/growi-command-processor.ts

@@ -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 - 1
packages/slack/src/interfaces/growi-event-processor.ts

@@ -1,4 +1,4 @@
-import { WebClient } from '@slack/web-api';
+import type { WebClient } from '@slack/web-api';
 
 export interface GrowiEventProcessor {
   shouldHandleEvent(eventType: string): boolean;

+ 1 - 1
packages/slack/src/interfaces/growi-interaction-processor.ts

@@ -1,4 +1,4 @@
-import { AuthorizeResult } from '@slack/oauth';
+import type { AuthorizeResult } from '@slack/oauth';
 
 import { InteractionPayloadAccessor } from '../utils/interaction-payload-accessor';
 

+ 1 - 1
packages/slack/src/interfaces/request-between-growi-and-proxy.ts

@@ -1,4 +1,4 @@
-import { Request } from 'express';
+import type { Request } from 'express';
 
 export interface BlockKitRequest {
   // Block Kit properties

+ 1 - 1
packages/slack/src/interfaces/request-from-slack.ts

@@ -1,4 +1,4 @@
-import { Request } from 'express';
+import type { Request } from 'express';
 
 export interface IInteractionPayloadAccessor {
   firstAction(): any;

+ 1 - 1
packages/slack/src/interfaces/respond-util.ts

@@ -1,4 +1,4 @@
-import { RespondBodyForResponseUrl } from './response-url';
+import type { RespondBodyForResponseUrl } from './response-url';
 
 export interface IRespondUtil {
   respond(body: RespondBodyForResponseUrl): Promise<void>,

+ 1 - 1
packages/slack/src/interfaces/response-url.ts

@@ -1,4 +1,4 @@
-import { KnownBlock, Block } from '@slack/web-api';
+import type { KnownBlock, Block } from '@slack/web-api';
 
 export type RespondBodyForResponseUrl = {
   text?: string,

+ 2 - 2
packages/slack/src/middlewares/parse-slack-interaction-request.ts

@@ -1,6 +1,6 @@
-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';
 import { InteractionPayloadAccessor } from '../utils/interaction-payload-accessor';
 
 

+ 2 - 2
packages/slack/src/middlewares/verify-growi-to-slack-request.ts

@@ -1,7 +1,7 @@
-import { Response, NextFunction } from 'express';
+import type { Response, NextFunction } from 'express';
 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');

+ 2 - 2
packages/slack/src/middlewares/verify-slack-request.ts

@@ -1,10 +1,10 @@
 import { createHmac, timingSafeEqual } from 'crypto';
 
-import { Response, NextFunction } from 'express';
+import type { Response, NextFunction } from 'express';
 import createError from 'http-errors';
 import { stringify } from 'qs';
 
-import { RequestFromSlack } from '../interfaces/request-from-slack';
+import type { RequestFromSlack } from '../interfaces/request-from-slack';
 import loggerFactory from '../utils/logger';
 
 const logger = loggerFactory('@growi/slack:middlewares:verify-slack-request');

+ 1 - 1
packages/slack/src/utils/block-kit-builder.ts

@@ -1,4 +1,4 @@
-import {
+import type {
   SectionBlock, HeaderBlock, InputBlock, DividerBlock, ActionsBlock,
   Button, Overflow, Datepicker, Select, RadioButtons, Checkboxes, Action, MultiSelect, PlainTextInput, Option,
 } from '@slack/types';

+ 2 - 2
packages/slack/src/utils/check-communicable.ts

@@ -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';

+ 2 - 2
packages/slack/src/utils/interaction-payload-accessor.ts

@@ -1,7 +1,7 @@
 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';
 

+ 1 - 1
packages/slack/src/utils/permission-parser.ts

@@ -1,4 +1,4 @@
-import { IChannelOptionalId } from '../interfaces/channel';
+import type { IChannelOptionalId } from '../interfaces/channel';
 
 
 export const permissionParser = (permissionForCommand: boolean | string[], channel: IChannelOptionalId): boolean => {

+ 1 - 1
packages/slack/src/utils/post-ephemeral-errors.ts

@@ -1,4 +1,4 @@
-import { WebAPICallResult } from '@slack/web-api';
+import type { WebAPICallResult } from '@slack/web-api';
 
 import { markdownSectionBlock } from './block-kit-builder';
 import { respond } from './response-url';

+ 1 - 1
packages/slack/src/utils/publish-initial-home-view.ts

@@ -1,7 +1,7 @@
 // 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({

+ 2 - 2
packages/slack/src/utils/respond-util-factory.ts

@@ -1,8 +1,8 @@
 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?: {

+ 1 - 1
packages/slack/src/utils/response-url.ts

@@ -1,6 +1,6 @@
 import axios from 'axios';
 
-import { RespondBodyForResponseUrl } from '../interfaces/response-url';
+import type { RespondBodyForResponseUrl } from '../interfaces/response-url';
 
 export async function respond(responseUrl: string, body: RespondBodyForResponseUrl): Promise<void> {
   return axios.post(responseUrl, {

+ 1 - 1
packages/slack/src/utils/slash-command-parser.ts

@@ -1,4 +1,4 @@
-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 => {

+ 1 - 1
packages/slack/src/utils/webclient-factory.ts

@@ -1,4 +1,4 @@
-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;