chore: suit eslint rules

This commit is contained in:
Ali BARIN
2022-01-16 19:47:16 +01:00
parent f6d7971b4f
commit c09a535653
73 changed files with 1197 additions and 2549 deletions

View File

@@ -1,20 +1,18 @@
import { GraphQLInt, GraphQLNonNull } from 'graphql';
import App from '../../models/app';
import Connection from '../../models/connection';
import Step from '../../models/step';
import stepType from '../types/step';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = {
id: number,
data: object
data: Record<string, unknown>
}
const executeStepResolver = async (params: Params, req: RequestWithCurrentUser) => {
let step = await Step.query().findOne({
const executeStepResolver = async (params: Params): Promise<any> => {
const step = await Step.query().findOne({
id: params.id
}).throwIfNotFound();
let connection = await Connection.query().findOne({
const connection = await Connection.query().findOne({
id: step.connectionId
}).throwIfNotFound();
@@ -30,7 +28,7 @@ const executeStep = {
args: {
id: { type: GraphQLNonNull(GraphQLInt) }
},
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => executeStepResolver(params, req)
resolve: (_: any, params: Params) => executeStepResolver(params)
};
export default executeStep;

View File

@@ -1,7 +1,6 @@
import { GraphQLInt, GraphQLString, GraphQLNonNull } from 'graphql';
import Flow from '../../models/flow';
import Step from '../../models/step';
import flowType from '../types/flow';
import stepType from '../types/step';
import availableAppsEnumType from '../types/available-apps-enum-type';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';

View File

@@ -1,9 +1,9 @@
import { GraphQLList, GraphQLString } from 'graphql';
import { GraphQLList } from 'graphql';
import Flow from '../../models/flow';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
import flowType from '../types/flow';
const getFlowsResolver = async (req: RequestWithCurrentUser) => {
const getFlowsResolver = async (req: RequestWithCurrentUser): Promise<any[]> => {
const flows = await Flow.query()
.withGraphJoined('[steps.[connection]]')
.where({'flows.user_id': req.currentUser.id});

View File

@@ -1,4 +1,4 @@
import { GraphQLString, GraphQLNonNull, GraphQLBoolean } from 'graphql';
import { GraphQLString, GraphQLNonNull } from 'graphql';
import Connection from '../../models/connection';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
import connectionType from '../types/connection'

View File

@@ -1,4 +1,4 @@
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt, GraphQLBoolean } from 'graphql';
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLBoolean } from 'graphql';
const actionType = new GraphQLObjectType({
name: 'Action',
@@ -6,13 +6,13 @@ const actionType = new GraphQLObjectType({
name: { type: GraphQLString },
key: { type: GraphQLString },
description: { type: GraphQLString },
subSteps: {
subSteps: {
type: GraphQLList(
new GraphQLObjectType({
name: 'ActionSubStep',
fields: {
name: { type: GraphQLString },
arguments: {
arguments: {
type: GraphQLList(
new GraphQLObjectType({
name: 'ActionSubStepArgument',

View File

@@ -8,6 +8,7 @@ import actionType from './action';
const appType = new GraphQLObjectType({
name: 'App',
fields: () => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const connectionType = require('./connection').default;
return {

View File

@@ -4,6 +4,7 @@ import connectionDataType from './connection-data';
const connectionType = new GraphQLObjectType({
name: 'Connection',
fields: () => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const appType = require('./app').default;
return {

View File

@@ -1,4 +1,4 @@
import { GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLEnumType, GraphQLInt } from 'graphql';
import { GraphQLObjectType, GraphQLString, GraphQLEnumType, GraphQLInt } from 'graphql';
import ConnectionType from './connection';
const stepType = new GraphQLObjectType({

View File

@@ -1,4 +1,4 @@
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt, GraphQLBoolean } from 'graphql';
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLBoolean } from 'graphql';
const triggerType = new GraphQLObjectType({
name: 'Trigger',
@@ -6,13 +6,13 @@ const triggerType = new GraphQLObjectType({
name: { type: GraphQLString },
key: { type: GraphQLString },
description: { type: GraphQLString },
subSteps: {
subSteps: {
type: GraphQLList(
new GraphQLObjectType({
name: 'TriggerSubStep',
fields: {
name: { type: GraphQLString },
arguments: {
arguments: {
type: GraphQLList(
new GraphQLObjectType({
name: 'TriggerSubStepArgument',