feat: Add draft triggers and actions to twitter app
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
c07b377de1
commit
b6c7ce96c9
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
34
packages/backend/src/graphql/types/action.ts
Normal file
34
packages/backend/src/graphql/types/action.ts
Normal file
@@ -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;
|
@@ -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) },
|
||||
}
|
||||
}
|
||||
|
@@ -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 }
|
||||
}
|
||||
})
|
||||
)
|
||||
},
|
||||
}
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user