refactor: Slack authentication by passing flow, connection and step

This commit is contained in:
Faruk AYDIN
2022-09-01 16:07:20 +03:00
committed by Ali BARIN
parent d12984f324
commit 92053ea25a
5 changed files with 83 additions and 43 deletions

View File

@@ -1,28 +1,31 @@
import {
IService,
IAuthentication,
IApp,
IJSONObject,
IConnection,
IFlow,
IStep,
} from '@automatisch/types';
import Authentication from './authentication';
import Triggers from './triggers';
import Actions from './actions';
import Data from './data';
import SlackClient from './client';
export default class Slack implements IService {
client: SlackClient;
authenticationClient: IAuthentication;
triggers: Triggers;
actions: Actions;
data: Data;
constructor(
appData: IApp,
connectionData: IJSONObject,
parameters: IJSONObject
) {
this.authenticationClient = new Authentication(appData, connectionData);
this.data = new Data(connectionData);
this.triggers = new Triggers(connectionData, parameters);
this.actions = new Actions(connectionData, parameters);
constructor(connection: IConnection, flow?: IFlow, step?: IStep) {
this.client = new SlackClient(connection, flow, step);
this.authenticationClient = new Authentication(this.client);
// this.triggers = new Triggers(this.client);
// this.actions = new Actions(this.client);
// this.data = new Data(this.client);
}
}