refactor: Introduce IActionOutput and ITriggerOutput types

This commit is contained in:
Faruk AYDIN
2022-10-12 21:10:44 +02:00
committed by Ali BARIN
parent 6895378d33
commit d9192f6e6b
22 changed files with 327 additions and 279 deletions

View File

@@ -172,9 +172,9 @@ export interface IData {
}
export interface IAuth {
createAuthData($: IGlobalVariable): Promise<void>,
verifyCredentials($: IGlobalVariable): Promise<any>,
isStillVerified($: IGlobalVariable): Promise<boolean>,
createAuthData($: IGlobalVariable): Promise<void>;
verifyCredentials($: IGlobalVariable): Promise<any>;
isStillVerified($: IGlobalVariable): Promise<boolean>;
fields: IField[];
authenticationSteps: IAuthenticationStep[];
reconnectionSteps: IAuthenticationStep[];
@@ -187,23 +187,46 @@ export interface IService {
data?: any;
}
export interface ITriggerOutput {
data: ITriggerDataItem[];
error?: IJSONObject;
}
export interface ITriggerDataItem {
raw: IJSONObject;
meta: {
internalId: string;
};
}
export interface ITrigger {
name: string;
key: string,
key: string;
pollInterval: number;
description: string;
substeps: ISubstep[];
getInterval(parameters: IGlobalVariable["db"]["step"]["parameters"]): string;
run($: IGlobalVariable): Promise<{ data: IJSONObject[], error: IJSONObject | null }>;
testRun($: IGlobalVariable, startTime?: Date): Promise<{ data: IJSONObject[], error: IJSONObject | null }>;
getInterval(parameters: IGlobalVariable['step']['parameters']): string;
run($: IGlobalVariable): Promise<ITriggerOutput>;
testRun($: IGlobalVariable): Promise<ITriggerOutput>;
}
export interface IActionOutput {
data: IActionDataItem;
error?: IJSONObject;
}
export interface IActionDataItem {
raw: {
data?: IJSONObject;
};
}
export interface IAction {
name: string;
key: string,
key: string;
description: string;
substeps: ISubstep[];
run($: IGlobalVariable): Promise<{ data: IJSONObject, error: IJSONObject | null }>;
run($: IGlobalVariable): Promise<IActionOutput>;
}
export interface IAuthentication {
@@ -229,13 +252,11 @@ export type IGlobalVariable = {
};
app: IApp;
http: IHttpClient;
db: {
flow: {
lastInternalId: string;
};
step: {
parameters: IJSONObject;
}
flow: {
lastInternalId: string;
};
step: {
parameters: IJSONObject;
};
};