11import util from 'node:util' ;
2- import { ConsoleLogger , LogLevel , type Logger } from '@slack/logger' ;
2+ import { ConsoleLogger , type Logger , LogLevel } from '@slack/logger' ;
33import {
4+ addAppMetadata ,
45 type FetchFunction ,
56 WebAPIHTTPError ,
67 WebAPIPlatformError ,
78 WebAPIRateLimitedError ,
89 WebClient ,
910 type WebClientOptions ,
10- addAppMetadata ,
1111} from '@slack/web-api' ;
1212import type { Assistant } from './Assistant' ;
1313import {
@@ -23,24 +23,25 @@ import {
2323 createSay ,
2424 createSayStream ,
2525 createSetStatus ,
26+ type SayStreamFn ,
27+ type SetStatusFn ,
2628} from './context' ;
27- import type { SayStreamFn , SetStatusFn } from './context' ;
28- import { type ConversationStore , MemoryStore , conversationContext } from './conversation-store' ;
29+ import { type ConversationStore , conversationContext , MemoryStore } from './conversation-store' ;
2930import {
3031 AppInitializationError ,
3132 AuthorizationError ,
33+ asCodedError ,
3234 type CodedError ,
3335 InvalidCustomPropertyError ,
3436 MultipleListenerError ,
35- asCodedError ,
3637} from './errors' ;
3738import {
38- IncomingEventType ,
3939 assertNever ,
4040 extractEventChannelId ,
4141 extractEventThreadTs ,
4242 extractEventTs ,
4343 getTypeAndConversation ,
44+ IncomingEventType ,
4445 isBodyWithTypeEnterpriseInstall ,
4546 isEventTypeToSkipAuthorize ,
4647} from './helpers' ;
@@ -99,7 +100,8 @@ import type {
99100 ViewOutput ,
100101} from './types' ;
101102import { contextBuiltinKeys } from './types' ;
102- import { type StringIndexed , isRejected } from './types/utilities' ;
103+ import { isRejected , type StringIndexed } from './types/utilities' ;
104+
103105const packageJson = require ( '../package.json' ) ;
104106
105107export type { ActionConstraints , OptionsConstraints , ShortcutConstraints , ViewConstraints } from './types' ;
@@ -155,7 +157,7 @@ export interface AppOptions {
155157 attachFunctionToken ?: boolean ;
156158}
157159
158- export { LogLevel , Logger } from '@slack/logger' ;
160+ export { Logger , LogLevel } from '@slack/logger' ;
159161
160162/** Authorization function - seeds the middleware processing and listeners with an authorization context */
161163export type Authorize < IsEnterpriseInstall extends boolean = false > = (
@@ -1051,7 +1053,7 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
10511053
10521054 // TODO: this logic should be isolated and tested according to the expected behavior
10531055 if ( token !== undefined ) {
1054- let pool : WebClientPool | undefined = undefined ;
1056+ let pool : WebClientPool | undefined ;
10551057 const clientOptionsCopy = { ...this . clientOptions } ;
10561058 if ( authorizeResult . teamId !== undefined ) {
10571059 pool = this . clients [ authorizeResult . teamId ] ;
@@ -1196,7 +1198,6 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
11961198 const rejectedListenerResults = settledListenerResults . filter ( isRejected ) ;
11971199 if ( rejectedListenerResults . length === 1 ) {
11981200 throw rejectedListenerResults [ 0 ] . reason ;
1199- // biome-ignore lint/style/noUselessElse: I think this is a biome issue actually...
12001201 } else if ( rejectedListenerResults . length > 1 ) {
12011202 throw new MultipleListenerError ( rejectedListenerResults . map ( ( rlr ) => rlr . reason ) ) ;
12021203 }
@@ -1323,15 +1324,15 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
13231324 throw new AppInitializationError (
13241325 `${ tokenUsage } \n\nSince you have not provided a token or authorize, you might be missing one or more required oauth installer options. See https://docs.slack.dev/tools/bolt-js/concepts/authenticating-oauth/ for these required fields.\n` ,
13251326 ) ;
1326- // biome-ignore lint/style/noUselessElse: I think this is a biome issue actually...
1327- } else if ( authorize !== undefined && usingOauth ) {
1327+ }
1328+ if ( authorize !== undefined && usingOauth ) {
13281329 throw new AppInitializationError ( `You cannot provide both authorize and oauth installer options. ${ tokenUsage } ` ) ;
1329- // biome-ignore lint/style/noUselessElse: I think this is a biome issue actually...
1330- } else if ( authorize === undefined && usingOauth ) {
1330+ }
1331+ if ( authorize === undefined && usingOauth ) {
13311332 // biome-ignore lint/style/noNonNullAssertion: we know installer is truthy here
13321333 return httpReceiver . installer ! . authorize ;
1333- // biome-ignore lint/style/noUselessElse: I think this is a biome issue actually...
1334- } else if ( authorize !== undefined && ! usingOauth ) {
1334+ }
1335+ if ( authorize !== undefined && ! usingOauth ) {
13351336 return authorize as Authorize < boolean > ;
13361337 }
13371338 return undefined ;
@@ -1623,9 +1624,9 @@ function escapeHtml(input: string | undefined | null): string {
16231624}
16241625
16251626function extractFunctionContext ( body : StringIndexed ) {
1626- let functionExecutionId : string | undefined = undefined ;
1627- let functionBotAccessToken : string | undefined = undefined ;
1628- let functionInputs : FunctionInputs | undefined = undefined ;
1627+ let functionExecutionId : string | undefined ;
1628+ let functionBotAccessToken : string | undefined ;
1629+ let functionInputs : FunctionInputs | undefined ;
16291630
16301631 // function_executed event
16311632 if ( body . event && body . event . type === 'function_executed' && body . event . function_execution_id ) {
0 commit comments