chore: introduce @automatisch/types

This commit is contained in:
Ali BARIN
2022-03-01 22:56:19 +01:00
committed by Ömer Faruk Aydın
parent bbb6f0b0ff
commit 3391578655
54 changed files with 377 additions and 297 deletions

View File

@@ -1,7 +1,6 @@
import Step from '../../models/step';
import flowType, { flowInputType } from '../types/flow';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
import { StepType } from '../../types/step';
type Params = {
input: {
@@ -21,7 +20,7 @@ const createFlowResolver = async (
await Step.query().insert({
flowId: flow.id,
type: StepType.Trigger,
type: 'trigger',
position: 1,
appKey,
});

View File

@@ -1,7 +1,6 @@
import { GraphQLNonNull } from 'graphql';
import stepType, { stepInputType } from '../types/step';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
import { StepType } from '../../types/step';
type Params = {
input: {
@@ -42,7 +41,7 @@ const createStepResolver = async (
const step = await flow.$relatedQuery('steps').insertAndFetch({
key: input.key,
appKey: input.appKey,
type: StepType.Action,
type: 'action',
position: previousStep.position + 1,
parameters: {},
});

View File

@@ -1,11 +1,11 @@
import type { IApp } from '@automatisch/types';
import { GraphQLEnumType } from 'graphql';
import App from '../../models/app';
import appInfoType from '../../types/app-info'
const apps = App.findAll();
const availableAppEnumValues: any = {}
apps.forEach((app: appInfoType) => {
apps.forEach((app: IApp) => {
availableAppEnumValues[app.key] = { value: app.key }
})