diff --git a/packages/backend/src/apps/twitter/info.json b/packages/backend/src/apps/twitter/info.json index 637e355e..44318274 100644 --- a/packages/backend/src/apps/twitter/info.json +++ b/packages/backend/src/apps/twitter/info.json @@ -227,12 +227,44 @@ { "name": "My Tweet", "key": "myTweet", - "description": "Will be triggered when you tweet something new." + "description": "Will be triggered when you tweet something new.", + "subSteps": [ + { + "name": "Choose app & event" + }, + { + "name": "Choose account" + }, + { + "name": "Test trigger" + } + ] }, { "name": "User Tweet", "key": "userTweet", - "description": "Will be triggered when a specific user tweet something new." + "description": "Will be triggered when a specific user tweet something new.", + "subSteps": [ + { + "name": "Choose app & event" + }, + { + "name": "Choose account" + }, + { + "name": "Set up a trigger", + "arguments": [ + { + "name": "username", + "type": "string", + "required": true + } + ] + }, + { + "name": "Test trigger" + } + ] } ], "actions": [ @@ -240,11 +272,25 @@ "name": "Create Tweet", "key": "createTweet", "description": "Will create a tweet.", - "parameters" : [ + "subSteps": [ { - "name": "Message", - "key": "message", - "required": true + "name": "Choose app & event" + }, + { + "name": "Choose account" + }, + { + "name": "Set up action", + "arguments": [ + { + "name": "tweet", + "type": "string", + "required": true + } + ] + }, + { + "name": "Test action" } ] } diff --git a/packages/backend/src/graphql/types/action.ts b/packages/backend/src/graphql/types/action.ts new file mode 100644 index 00000000..17c1844e --- /dev/null +++ b/packages/backend/src/graphql/types/action.ts @@ -0,0 +1,34 @@ +import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt, GraphQLBoolean } from 'graphql'; + +const actionType = new GraphQLObjectType({ + name: 'Action', + fields: { + name: { type: GraphQLString }, + key: { type: GraphQLString }, + description: { type: GraphQLString }, + subSteps: { + type: GraphQLList( + new GraphQLObjectType({ + name: 'ActionSubStep', + fields: { + name: { type: GraphQLString }, + arguments: { + type: GraphQLList( + new GraphQLObjectType({ + name: 'ActionSubStepArgument', + fields: { + name: { type: GraphQLString }, + type: { type: GraphQLString }, + required: { type: GraphQLBoolean } + } + }) + ) + }, + } + }), + ) + } + } +}) + +export default actionType; diff --git a/packages/backend/src/graphql/types/app.ts b/packages/backend/src/graphql/types/app.ts index b849c870..915e730a 100644 --- a/packages/backend/src/graphql/types/app.ts +++ b/packages/backend/src/graphql/types/app.ts @@ -3,6 +3,7 @@ import fieldType from './field'; import authenticationStepType from './authentication-step'; import reconnectionStepType from './reconnection-step'; import triggerType from './trigger'; +import actionType from './action'; const appType = new GraphQLObjectType({ name: 'App', @@ -20,6 +21,7 @@ const appType = new GraphQLObjectType({ authenticationSteps: { type: GraphQLList(authenticationStepType) }, reconnectionSteps: { type: GraphQLList(reconnectionStepType) }, triggers: { type: GraphQLList(triggerType) }, + actions: { type: GraphQLList(actionType) }, connections: { type: GraphQLList(connectionType) }, } } diff --git a/packages/backend/src/graphql/types/trigger.ts b/packages/backend/src/graphql/types/trigger.ts index 9185bb52..0918a476 100644 --- a/packages/backend/src/graphql/types/trigger.ts +++ b/packages/backend/src/graphql/types/trigger.ts @@ -1,11 +1,33 @@ -import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt } from 'graphql'; +import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt, GraphQLBoolean } from 'graphql'; const triggerType = new GraphQLObjectType({ name: 'Trigger', fields: { name: { type: GraphQLString }, key: { type: GraphQLString }, - description: { type: GraphQLString } + description: { type: GraphQLString }, + subSteps: { + type: GraphQLList( + new GraphQLObjectType({ + name: 'TriggerSubStep', + fields: { + name: { type: GraphQLString }, + arguments: { + type: GraphQLList( + new GraphQLObjectType({ + name: 'TriggerSubStepArgument', + fields: { + name: { type: GraphQLString }, + type: { type: GraphQLString }, + required: { type: GraphQLBoolean } + } + }) + ) + }, + } + }), + ) + } } })