Files
speckle-server/packages/server/test/graphql/automate.ts
T
Chuck Driesler fd5f316af0 fix(automate): automate module multi region (#3531)
* refactor(automate): logs api can get the projectId from the path

* fix(automate): multiregion gql resolvers

* fix(automate): multiregion event listeners

* fix(automate): drop automationCount

* fix(automate): multiregion run status

* fix(automate): correctness

* fix(automate): actually finish event listeners

* chore(automate): fix tests fix tests

* fix(automate): fix tests but make it multiregion flavor

* fix(automate): logs endpoint

* chore(automate): globalDb to db

* fix(automate): inject projectid correctly

* fix(automate): debug log fetch failure

* chore(automate): fix tests for new message

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-11-27 15:26:09 +00:00

128 lines
2.2 KiB
TypeScript

import { gql } from 'graphql-tag'
export const automateFunctionFragment = gql`
fragment TestAutomateFunction on AutomateFunction {
id
name
repo {
id
owner
name
}
isFeatured
description
logo
releases(limit: 5) {
totalCount
items {
id
versionTag
createdAt
inputSchema
commitId
}
}
supportedSourceApps
tags
}
`
export const automationFragment = gql`
fragment TestAutomation on Automation {
id
name
enabled
createdAt
updatedAt
runs {
totalCount
items {
id
trigger {
... on VersionCreatedTrigger {
version {
id
}
model {
id
}
}
}
status
createdAt
updatedAt
functionRuns {
id
status
statusMessage
contextView
function {
id
}
elapsed
results
}
}
}
currentRevision {
id
triggerDefinitions {
... on VersionCreatedTriggerDefinition {
type
model {
id
}
}
}
functions {
parameters
release {
id
function {
id
}
versionTag
createdAt
inputSchema
commitId
}
}
}
}
`
export const getProjectAutomationQuery = gql`
query GetProjectAutomation($projectId: String!, $automationId: String!) {
project(id: $projectId) {
id
automation(id: $automationId) {
...TestAutomation
}
}
}
${automationFragment}
`
export const getAutomateFunctionsQuery = gql`
query GetAutomateFunctions(
$cursor: String
$limit: Int!
$filter: AutomateFunctionsFilter
) {
automateFunctions(cursor: $cursor, limit: $limit, filter: $filter) {
cursor
totalCount
items {
...TestAutomateFunction
}
}
}
${automateFunctionFragment}
`
export const automateValidateAuthCodeQuery = gql`
query AutomateValidateAuthCode($payload: AutomateAuthCodePayloadTest!) {
automateValidateAuthCode(payload: $payload)
}
`