refactor: Pass connection, flow and step as params to apps

This commit is contained in:
Faruk AYDIN
2022-08-21 20:25:04 +03:00
parent cd6c5216ff
commit 44e3de8534
18 changed files with 60 additions and 85 deletions

View File

@@ -1,8 +1,9 @@
import {
IService,
IAuthentication,
IApp,
IJSONObject,
IFlow,
IStep,
IConnection,
} from '@automatisch/types';
import Authentication from './authentication';
import Triggers from './triggers';
@@ -16,12 +17,8 @@ export default class Twitter implements IService {
triggers: Triggers;
actions: Actions;
constructor(
appData: IApp,
connectionData: IJSONObject,
parameters: IJSONObject
) {
this.client = new TwitterClient(appData, connectionData, parameters);
constructor(connection: IConnection, flow?: IFlow, step?: IStep) {
this.client = new TwitterClient(connection, flow, step);
this.authenticationClient = new Authentication(this.client);
this.triggers = new Triggers(this.client);