Files
speckle-server/packages/server/modules/automate/helpers/executionEngine.ts
T
Kristaps Fabians Geikins 4b06f42db7 chore(server): run TS files directly (no compilation) (#5134)
* sort of works

* type fixes

* added option to run old way too
2025-07-23 11:20:40 +02:00

63 lines
1.8 KiB
TypeScript

import { VersionCreationTriggerType } from '@/modules/automate/helpers/types'
import {
AutomateFunctionTemplateLanguage,
AutomateRunTriggerType
} from '@/modules/core/graph/generated/graphql'
import type { 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
}>
functionCreatorSpeckleUserId: Nullable<string>
functionCreatorSpeckleServerOrigin: Nullable<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'
}
]
export const dbToGraphqlTriggerTypeMap = <const>{
[VersionCreationTriggerType]: AutomateRunTriggerType.VersionCreated
}
export const graphqlToDbTriggerTypeMap = <const>{
[AutomateRunTriggerType.VersionCreated]: VersionCreationTriggerType
}