e312110933
* feat(automate): query active user functions * fix(automate): show automations to non-stream-owners * feat(automate): associate function with workspace * fix(automate): split functions page between user and example functions * fix(automate): ugh * fix(functions): use correct query type in different places * fix(automate): workspace functions page * feat(automate): query specific categories of functions * fix(automate): checkpoint * fix(workspaces): successful queries w local env * fix(automate): createFunctionWithoutVersion * fix(automate): successful associate function with workspace * fix(automate): query and return workspaces on functions * fix(automate): show current function workspace * fix(automate): query functions in automation create dialog * fix(automate): audit non-owner automation access * 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): successful usage of multiregion results * 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 * fix(automate): inject projectid correctly * fix(automate): drop user-source functions * fix(automate): owners edit, others can view * fix(automate): simplify queries, auto workspace association * chore(automate): appease * chore(automate): fix function types * fix(automate): get to workspace functions from empty state * chore(automate): death to all slugs * fix(automate): no create automation from function * fix(automate): hide workspace change, tweak role access --------- Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
73 lines
2.1 KiB
TypeScript
73 lines
2.1 KiB
TypeScript
import { VersionCreationTriggerType } from '@/modules/automate/helpers/types'
|
|
import {
|
|
AutomateFunctionTemplateLanguage,
|
|
AutomateRunTriggerType
|
|
} from '@/modules/core/graph/generated/graphql'
|
|
import { Nullable, SourceAppName } from '@speckle/shared'
|
|
|
|
// TODO: These should be managed in a shared package maybe?
|
|
export type FunctionSchemaType = {
|
|
functionId: string
|
|
repoUrl: string
|
|
functionName: string
|
|
description: string
|
|
tags: string[]
|
|
supportedSourceApps: SourceAppName[]
|
|
createdAt: string
|
|
isFeatured: boolean
|
|
logo: Nullable<string>
|
|
functionCreator: Nullable<{
|
|
speckleUserId: string
|
|
speckleServerOrigin: string
|
|
}>
|
|
workspaceIds: string[]
|
|
}
|
|
|
|
export type FunctionReleaseSchemaType = {
|
|
functionVersionId: string
|
|
versionTag: string
|
|
inputSchema: Nullable<Record<string, unknown>>
|
|
createdAt: string
|
|
commitId: string
|
|
}
|
|
|
|
export type FunctionWithVersionsSchemaType = FunctionSchemaType & {
|
|
functionVersions: FunctionReleaseSchemaType[]
|
|
}
|
|
|
|
// TODO: Retrieve from API
|
|
export const functionTemplateRepos = <const>[
|
|
{
|
|
id: AutomateFunctionTemplateLanguage.Python,
|
|
title: 'Python',
|
|
url: 'https://github.com/specklesystems/speckle_automate_python_example',
|
|
logo: '/images/functions/python.svg'
|
|
},
|
|
{
|
|
id: AutomateFunctionTemplateLanguage.DotNet,
|
|
title: '.NET / C#',
|
|
url: 'https://github.com/specklesystems/SpeckleAutomateDotnetExample',
|
|
logo: '/images/functions/dotnet.svg'
|
|
},
|
|
{
|
|
id: AutomateFunctionTemplateLanguage.Demonstration,
|
|
title: 'SpeckleCon 2024 - Thermal',
|
|
url: 'https://github.com/specklesystems/Thermal-Resistance-Checker-Template',
|
|
logo: '/images/functions/specklecon.svg'
|
|
},
|
|
{
|
|
id: AutomateFunctionTemplateLanguage.Demonstrationpython,
|
|
title: 'SpeckleCon 2024 - QAQC',
|
|
url: 'https://github.com/specklesystems/SpeckleConWorkshop-QAQC',
|
|
logo: '/images/functions/specklecon.svg'
|
|
}
|
|
]
|
|
|
|
export const dbToGraphqlTriggerTypeMap = <const>{
|
|
[VersionCreationTriggerType]: AutomateRunTriggerType.VersionCreated
|
|
}
|
|
|
|
export const graphqlToDbTriggerTypeMap = <const>{
|
|
[AutomateRunTriggerType.VersionCreated]: VersionCreationTriggerType
|
|
}
|