bdf27f6218
* fix(fe2): better resiliency for when mp cant be loaded * WIP mixpanel track calls * more resiliency improvements * added all clientside tracking calls * run finished event * minor adjustment * feat(automate): revert automationRunTriggerinAssociation * feat(automate): track manual run triggers * feat(automate): backend track automation run created events * fix(automate): manual trigger type gql schema fix * feat(automate): add source based filter to run trigger tracking * fix(automate): fix trigger mock * various minor adjustments * remove comment --------- Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
56 lines
1.5 KiB
TypeScript
56 lines
1.5 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>
|
|
}
|
|
|
|
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
|
|
}
|