|
|
|
|
@ -10,7 +10,7 @@ import type { AppServerOrchestrator } from '../../../../ee/server/apps/orchestra |
|
|
|
|
import { parseParameters } from '../../../../lib/utils/parseParameters'; |
|
|
|
|
|
|
|
|
|
export class AppCommandsBridge extends CommandBridge { |
|
|
|
|
disabledCommands: Map<string, typeof slashCommands.commands[string]>; |
|
|
|
|
disabledCommands: Map<string, (typeof slashCommands.commands)[string]>; |
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-empty-function
|
|
|
|
|
constructor(private readonly orch: AppServerOrchestrator) { |
|
|
|
|
@ -42,7 +42,7 @@ export class AppCommandsBridge extends CommandBridge { |
|
|
|
|
throw new Error(`The command is not currently disabled: "${cmd}"`); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
slashCommands.commands[cmd] = this.disabledCommands.get(cmd) as typeof slashCommands.commands[string]; |
|
|
|
|
slashCommands.commands[cmd] = this.disabledCommands.get(cmd) as (typeof slashCommands.commands)[string]; |
|
|
|
|
this.disabledCommands.delete(cmd); |
|
|
|
|
|
|
|
|
|
this.orch.getNotifier().commandUpdated(cmd); |
|
|
|
|
@ -93,7 +93,7 @@ export class AppCommandsBridge extends CommandBridge { |
|
|
|
|
item.previewer = command.previewer ? this._appCommandPreviewer.bind(this) : item.previewer; |
|
|
|
|
item.previewCallback = ( |
|
|
|
|
command.executePreviewItem ? this._appCommandPreviewExecutor.bind(this) : item.previewCallback |
|
|
|
|
) as typeof slashCommands.commands[string]['previewCallback']; |
|
|
|
|
) as (typeof slashCommands.commands)[string]['previewCallback']; |
|
|
|
|
|
|
|
|
|
slashCommands.commands[cmd] = item; |
|
|
|
|
this.orch.getNotifier().commandUpdated(cmd); |
|
|
|
|
@ -114,7 +114,7 @@ export class AppCommandsBridge extends CommandBridge { |
|
|
|
|
providesPreview: command.providesPreview, |
|
|
|
|
previewer: !command.previewer ? undefined : this._appCommandPreviewer.bind(this), |
|
|
|
|
previewCallback: (!command.executePreviewItem ? undefined : this._appCommandPreviewExecutor.bind(this)) as |
|
|
|
|
| typeof slashCommands.commands[string]['previewCallback'] |
|
|
|
|
| (typeof slashCommands.commands)[string]['previewCallback'] |
|
|
|
|
| undefined, |
|
|
|
|
} as SlashCommand; |
|
|
|
|
|
|
|
|
|
|