blob: 36c5a7539418b28d76c70bcce545f52c48207522 [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';
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +020010import LegacyNodeWatcherScript from '../../../common/architecture/scripts/nodeWatcher/LegacyNodeWatcherScript';
Adrià Vilanova Martínezc78c3ad2024-05-18 00:35:51 +020011import 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
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +020021export default class WorkflowsNodeWatcherScript extends LegacyNodeWatcherScript<WorkflowsNodeWatcherDependencies> {
Adrià Vilanova Martínezc78c3ad2024-05-18 00:35:51 +020022 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}