type Query {
  placeholderQuery(name: String): Boolean
}
type Mutation {
  createConnection(input: CreateConnectionInput): Connection
  createFlow(input: CreateFlowInput): Flow
  createUser(input: CreateUserInput): UserWithAcceptInvitationUrl
  deleteCurrentUser: Boolean
  deleteFlow(input: DeleteFlowInput): Boolean
  deleteStep(input: DeleteStepInput): Step
  duplicateFlow(input: DuplicateFlowInput): Flow
  executeFlow(input: ExecuteFlowInput): executeFlowType
  generateAuthUrl(input: GenerateAuthUrlInput): AuthLink
  resetConnection(input: ResetConnectionInput): Connection
  updateConnection(input: UpdateConnectionInput): Connection
  updateCurrentUser(input: UpdateCurrentUserInput): User
  updateFlowStatus(input: UpdateFlowStatusInput): Flow
  updateStep(input: UpdateStepInput): Step
  updateUser(input: UpdateUserInput): User
  verifyConnection(input: VerifyConnectionInput): Connection
}

"""
Exposes a URL that specifies the behaviour of this scalar.
"""
directive @specifiedBy(
  """
  The URL that specifies the behaviour of this scalar.
  """
  url: String!
) on SCALAR

type Trigger {
  name: String
  key: String
  description: String
  showWebhookUrl: Boolean
  pollInterval: Int
  type: String
  substeps: [Substep]
}

type Action {
  name: String
  key: String
  description: String
  substeps: [Substep]
}

type Substep {
  key: String
  name: String
  arguments: [SubstepArgument]
}

type SubstepArgument {
  label: String
  key: String
  type: String
  description: String
  required: Boolean
  variables: Boolean
  options: [SubstepArgumentOption]
  source: SubstepArgumentSource
  additionalFields: SubstepArgumentAdditionalFields
  dependsOn: [String]
  fields: [SubstepArgument]
  value: JSONObject
}

type SubstepArgumentOption {
  label: String
  value: JSONObject
}

type SubstepArgumentSource {
  type: String
  name: String
  arguments: [SubstepArgumentSourceArgument]
}

type SubstepArgumentSourceArgument {
  name: String
  value: String
}

type SubstepArgumentAdditionalFields {
  type: String
  name: String
  arguments: [SubstepArgumentAdditionalFieldsArgument]
}

type SubstepArgumentAdditionalFieldsArgument {
  name: String
  value: String
}

type App {
  name: String
  key: String
  connectionCount: Int
  flowCount: Int
  iconUrl: String
  docUrl: String
  authDocUrl: String
  primaryColor: String
  supportsConnections: Boolean
  auth: AppAuth
  triggers: [Trigger]
  actions: [Action]
  connections: [Connection]
}

type AppAuth {
  fields: [Field]
  authenticationSteps: [AuthenticationStep]
  sharedAuthenticationSteps: [AuthenticationStep]
  reconnectionSteps: [ReconnectionStep]
  sharedReconnectionSteps: [ReconnectionStep]
}

enum ArgumentEnumType {
  integer
  string
}

type AuthenticationStep {
  type: String
  name: String
  arguments: [AuthenticationStepArgument]
}

type AuthenticationStepArgument {
  name: String
  value: String
  type: ArgumentEnumType
  properties: [AuthenticationStepProperty]
}

type AuthenticationStepProperty {
  name: String
  value: String
}

type AuthLink {
  url: String
}

type Connection {
  id: String
  key: String
  reconnectable: Boolean
  appAuthClientId: String
  formattedData: ConnectionData
  verified: Boolean
  app: App
  createdAt: String
  flowCount: Int
}

type ConnectionData {
  screenName: String
}

type executeFlowType {
  data: JSONObject
  step: Step
}

type ExecutionStep {
  id: String
  executionId: String
  stepId: String
  step: Step
  status: String
  dataIn: JSONObject
  dataOut: JSONObject
  errorDetails: JSONObject
  createdAt: String
  updatedAt: String
}

type Field {
  key: String
  label: String
  type: String
  required: Boolean
  readOnly: Boolean
  value: String
  placeholder: String
  description: String
  docUrl: String
  clickToCopy: Boolean
  options: [SubstepArgumentOption]
}

enum FlowStatus {
  paused
  published
  draft
}

type Flow {
  id: String
  name: String
  active: Boolean
  steps: [Step]
  createdAt: String
  updatedAt: String
  status: FlowStatus
}

type SamlAuthProvidersRoleMapping {
  id: String
  samlAuthProviderId: String
  roleId: String
  remoteRoleName: String
}

input CreateConnectionInput {
  key: String!
  appAuthClientId: String
  formattedData: JSONObject
}

input GenerateAuthUrlInput {
  id: String!
}

input UpdateConnectionInput {
  id: String!
  formattedData: JSONObject
  appAuthClientId: String
}

input ResetConnectionInput {
  id: String!
}

input VerifyConnectionInput {
  id: String!
}

input CreateFlowInput {
  triggerAppKey: String
  connectionId: String
}

input UpdateFlowStatusInput {
  id: String!
  active: Boolean!
}

input ExecuteFlowInput {
  stepId: String!
}

input DeleteFlowInput {
  id: String!
}

input DuplicateFlowInput {
  id: String!
}

input UpdateStepInput {
  id: String
  previousStepId: String
  key: String
  appKey: String
  connection: StepConnectionInput
  flow: StepFlowInput
  parameters: JSONObject
  previousStep: PreviousStepInput
}

input DeleteStepInput {
  id: String!
}

input CreateUserInput {
  fullName: String!
  email: String!
  role: UserRoleInput!
}

input UserRoleInput {
  id: String
}

input UpdateUserInput {
  id: String!
  fullName: String
  email: String
  role: UserRoleInput
}

input UpdateCurrentUserInput {
  email: String
  password: String
  fullName: String
}

"""
The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSONObject

input PreviousStepInput {
  id: String
}

type ReconnectionStep {
  type: String
  name: String
  arguments: [ReconnectionStepArgument]
}

type ReconnectionStepArgument {
  name: String
  value: String
  type: ArgumentEnumType
  properties: [ReconnectionStepProperty]
}

type ReconnectionStepProperty {
  name: String
  value: String
}

type Step {
  id: String
  previousStepId: String
  key: String
  appKey: String
  iconUrl: String
  webhookUrl: String
  type: StepEnumType
  parameters: JSONObject
  connection: Connection
  flow: Flow
  position: Int
  status: String
  executionSteps: [ExecutionStep]
}

input StepConnectionInput {
  id: String
}

enum StepEnumType {
  trigger
  action
}

input StepFlowInput {
  id: String
}

input StepInput {
  id: String
  previousStepId: String
  key: String
  appKey: String
  connection: StepConnectionInput
  flow: StepFlowInput
  parameters: JSONObject
  previousStep: PreviousStepInput
}

type User {
  id: String
  fullName: String
  email: String
  role: Role
  permissions: [Permission]
  createdAt: String
  updatedAt: String
}

type UserWithAcceptInvitationUrl {
  user: User
  acceptInvitationUrl: String
}

type Role {
  id: String
  name: String
  key: String
  description: String
  isAdmin: Boolean
  permissions: [Permission]
}

type PageInfo {
  currentPage: Int!
  totalPages: Int!
}

type ExecutionStepEdge {
  node: ExecutionStep
}

type ExecutionStepConnection {
  edges: [ExecutionStepEdge]
  pageInfo: PageInfo
}

type License {
  id: String
  name: String
  expireAt: String
  verified: Boolean
}

type Permission {
  id: String
  action: String
  subject: String
  conditions: [String]
}

type Action {
  label: String
  key: String
  subjects: [String]
}

type Condition {
  key: String
  label: String
}

type Subject {
  label: String
  key: String
}

schema {
  query: Query
  mutation: Mutation
}
