feat: Convert service folder to js files
This commit is contained in:
@@ -9,13 +9,7 @@ import HttpError from '../errors/http';
|
||||
import EarlyExitError from '../errors/early-exit';
|
||||
import AlreadyProcessedError from '../errors/already-processed';
|
||||
|
||||
type ProcessActionOptions = {
|
||||
flowId: string;
|
||||
executionId: string;
|
||||
stepId: string;
|
||||
};
|
||||
|
||||
export const processAction = async (options: ProcessActionOptions) => {
|
||||
export const processAction = async (options) => {
|
||||
const { flowId, stepId, executionId } = options;
|
||||
|
||||
const flow = await Flow.query().findById(flowId).throwIfNotFound();
|
@@ -5,12 +5,7 @@ import AlreadyProcessedError from '../errors/already-processed';
|
||||
import HttpError from '../errors/http';
|
||||
import { logger } from '../helpers/logger';
|
||||
|
||||
type ProcessFlowOptions = {
|
||||
flowId: string;
|
||||
testRun?: boolean;
|
||||
};
|
||||
|
||||
export const processFlow = async (options: ProcessFlowOptions) => {
|
||||
export const processFlow = async (options) => {
|
||||
const { testRun, flowId } = options;
|
||||
const flow = await Flow.query().findById(flowId).throwIfNotFound();
|
||||
const triggerStep = await flow.getTriggerStep();
|
@@ -1,13 +1,9 @@
|
||||
import Step from '../models/step';
|
||||
import { processFlow } from '../services/flow';
|
||||
import { processTrigger } from '../services/trigger';
|
||||
import { processAction } from '../services/action';
|
||||
import { processFlow } from './flow';
|
||||
import { processTrigger } from './trigger';
|
||||
import { processAction } from './action';
|
||||
|
||||
type TestRunOptions = {
|
||||
stepId: string;
|
||||
};
|
||||
|
||||
const testRun = async (options: TestRunOptions) => {
|
||||
const testRun = async (options) => {
|
||||
const untilStep = await Step.query()
|
||||
.findById(options.stepId)
|
||||
.throwIfNotFound();
|
@@ -1,18 +1,9 @@
|
||||
import { IJSONObject, ITriggerItem } from '@automatisch/types';
|
||||
import Step from '../models/step';
|
||||
import Flow from '../models/flow';
|
||||
import Execution from '../models/execution';
|
||||
import globalVariable from '../helpers/global-variable';
|
||||
|
||||
type ProcessTriggerOptions = {
|
||||
flowId: string;
|
||||
stepId: string;
|
||||
triggerItem?: ITriggerItem;
|
||||
error?: IJSONObject;
|
||||
testRun?: boolean;
|
||||
};
|
||||
|
||||
export const processTrigger = async (options: ProcessTriggerOptions) => {
|
||||
export const processTrigger = async (options) => {
|
||||
const { flowId, stepId, triggerItem, error, testRun } = options;
|
||||
|
||||
const step = await Step.query().findById(stepId).throwIfNotFound();
|
Reference in New Issue
Block a user