blob: 8d26c86f7cc073c3b605629bb851276867f37581 [file] [log] [blame]
Adrià Vilanova Martínezc78c3ad2024-05-18 00:35:51 +02001import DependenciesProviderSingleton, {
2 WorkflowsDependency,
3 WorkflowsImportDependency,
4} from '../../../common/architecture/dependenciesProvider/DependenciesProvider';
5import {
6 ScriptEnvironment,
7 ScriptPage,
8 ScriptRunPhase,
9} from '../../../common/architecture/scripts/Script';
10import NodeWatcherScript from '../../../common/architecture/scripts/nodeWatcher/NodeWatcherScript';
11import WorkflowsImport from '../core/communityConsole/import';
12import Workflows from '../core/communityConsole/workflows';
13import WorkflowsImportCRTagsHandler from '../nodeWatcherHandlers/crTags.handler';
14import WorkflowsThreadListActionBarHandler from '../nodeWatcherHandlers/threadListActionBar.handler';
15
16export interface WorkflowsNodeWatcherDependencies {
17 workflows: Workflows;
18 workflowsImport: WorkflowsImport;
19}
20
21export default class WorkflowsNodeWatcherScript extends NodeWatcherScript<WorkflowsNodeWatcherDependencies> {
22 public page = ScriptPage.CommunityConsole;
23 public environment = ScriptEnvironment.ContentScript;
24 public runPhase = ScriptRunPhase.Main;
25 public handlers = new Map([
26 ['workflowsImportCRTags', WorkflowsImportCRTagsHandler],
27 ['workflowsThreadListActionBar', WorkflowsThreadListActionBarHandler],
28 ]);
29
30 protected optionsFactory(): WorkflowsNodeWatcherDependencies {
31 const dependenciesProvider = DependenciesProviderSingleton.getInstance();
32 return {
33 workflows: dependenciesProvider.getDependency(WorkflowsDependency),
34 workflowsImport: dependenciesProvider.getDependency(
35 WorkflowsImportDependency,
36 ),
37 };
38 }
39}