From 566bec59a5193e538837a322540884653047652e Mon Sep 17 00:00:00 2001 From: Chuck Driesler Date: Sat, 16 Nov 2024 19:57:04 +0000 Subject: [PATCH] Revert "fix(automate): drop specklecon function templates (#3503)" (#3504) This reverts commit adeb529826a4f59fa7bc758cf81c492c86d08b81. --- .../lib/common/generated/gql/gql.ts | 1 - .../lib/common/generated/gql/graphql.ts | 2 + .../public/images/functions/specklecon.svg | 986 ++++++++++++++++++ .../assets/automate/typedefs/automate.graphql | 2 + .../automate/clients/executionEngine.ts | 4 +- .../automate/helpers/executionEngine.ts | 12 + .../automate/services/functionManagement.ts | 4 + .../modules/core/graph/generated/graphql.ts | 2 + .../graph/generated/graphql.ts | 2 + .../server/test/graphql/generated/graphql.ts | 2 + 10 files changed, 1015 insertions(+), 2 deletions(-) create mode 100644 packages/frontend-2/public/images/functions/specklecon.svg diff --git a/packages/frontend-2/lib/common/generated/gql/gql.ts b/packages/frontend-2/lib/common/generated/gql/gql.ts index cf4407c432..46ba12dfb9 100644 --- a/packages/frontend-2/lib/common/generated/gql/gql.ts +++ b/packages/frontend-2/lib/common/generated/gql/gql.ts @@ -11,7 +11,6 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- * 3. It does not support dead code elimination, so it will add unused operations. * * Therefore it is highly recommended to use the babel or swc plugin for production. - * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size */ const documents = { "\n fragment AuthLoginWithEmailBlock_PendingWorkspaceCollaborator on PendingWorkspaceCollaborator {\n id\n email\n user {\n id\n }\n }\n": types.AuthLoginWithEmailBlock_PendingWorkspaceCollaboratorFragmentDoc, diff --git a/packages/frontend-2/lib/common/generated/gql/graphql.ts b/packages/frontend-2/lib/common/generated/gql/graphql.ts index 39a3cc6da5..184ac99583 100644 --- a/packages/frontend-2/lib/common/generated/gql/graphql.ts +++ b/packages/frontend-2/lib/common/generated/gql/graphql.ts @@ -299,6 +299,8 @@ export type AutomateFunctionTemplate = { }; export enum AutomateFunctionTemplateLanguage { + Demonstration = 'DEMONSTRATION', + Demonstrationpython = 'DEMONSTRATIONPYTHON', DotNet = 'DOT_NET', Python = 'PYTHON', Typescript = 'TYPESCRIPT' diff --git a/packages/frontend-2/public/images/functions/specklecon.svg b/packages/frontend-2/public/images/functions/specklecon.svg new file mode 100644 index 0000000000..74332c2acb --- /dev/null +++ b/packages/frontend-2/public/images/functions/specklecon.svg @@ -0,0 +1,986 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/server/assets/automate/typedefs/automate.graphql b/packages/server/assets/automate/typedefs/automate.graphql index 4b63c77f70..6507c32081 100644 --- a/packages/server/assets/automate/typedefs/automate.graphql +++ b/packages/server/assets/automate/typedefs/automate.graphql @@ -274,6 +274,8 @@ enum AutomateFunctionTemplateLanguage { TYPESCRIPT PYTHON DOT_NET + DEMONSTRATION + DEMONSTRATIONPYTHON } type AutomateFunctionTemplate { diff --git a/packages/server/modules/automate/clients/executionEngine.ts b/packages/server/modules/automate/clients/executionEngine.ts index 93a9304aa0..671b083982 100644 --- a/packages/server/modules/automate/clients/executionEngine.ts +++ b/packages/server/modules/automate/clients/executionEngine.ts @@ -249,7 +249,9 @@ export const triggerAutomationRun = async (params: { export enum ExecutionEngineFunctionTemplateId { Python = 'python', DotNet = '.net', - TypeScript = 'typescript' + TypeScript = 'typescript', + Demonstration = 'demonstration', + DemonstrationPython = 'demonstrationpython' } export type CreateFunctionBody = diff --git a/packages/server/modules/automate/helpers/executionEngine.ts b/packages/server/modules/automate/helpers/executionEngine.ts index 772e93f76c..74ea4e06db 100644 --- a/packages/server/modules/automate/helpers/executionEngine.ts +++ b/packages/server/modules/automate/helpers/executionEngine.ts @@ -47,6 +47,18 @@ export const functionTemplateRepos = [ 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' } ] diff --git a/packages/server/modules/automate/services/functionManagement.ts b/packages/server/modules/automate/services/functionManagement.ts index cd2ac398bf..8ade673abc 100644 --- a/packages/server/modules/automate/services/functionManagement.ts +++ b/packages/server/modules/automate/services/functionManagement.ts @@ -57,6 +57,10 @@ const mapGqlTemplateIdToExecEngineTemplateId = ( return ExecutionEngineFunctionTemplateId.DotNet case AutomateFunctionTemplateLanguage.Typescript: return ExecutionEngineFunctionTemplateId.TypeScript + case AutomateFunctionTemplateLanguage.Demonstration: + return ExecutionEngineFunctionTemplateId.Demonstration + case AutomateFunctionTemplateLanguage.Demonstrationpython: + return ExecutionEngineFunctionTemplateId.DemonstrationPython default: throw new Error('Unknown template id') } diff --git a/packages/server/modules/core/graph/generated/graphql.ts b/packages/server/modules/core/graph/generated/graphql.ts index 38c28efc36..02c2a0e16c 100644 --- a/packages/server/modules/core/graph/generated/graphql.ts +++ b/packages/server/modules/core/graph/generated/graphql.ts @@ -316,6 +316,8 @@ export type AutomateFunctionTemplate = { }; export enum AutomateFunctionTemplateLanguage { + Demonstration = 'DEMONSTRATION', + Demonstrationpython = 'DEMONSTRATIONPYTHON', DotNet = 'DOT_NET', Python = 'PYTHON', Typescript = 'TYPESCRIPT' diff --git a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts index 6420348085..acc81a416a 100644 --- a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts +++ b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts @@ -297,6 +297,8 @@ export type AutomateFunctionTemplate = { }; export enum AutomateFunctionTemplateLanguage { + Demonstration = 'DEMONSTRATION', + Demonstrationpython = 'DEMONSTRATIONPYTHON', DotNet = 'DOT_NET', Python = 'PYTHON', Typescript = 'TYPESCRIPT' diff --git a/packages/server/test/graphql/generated/graphql.ts b/packages/server/test/graphql/generated/graphql.ts index 7c5381bc79..027596cebf 100644 --- a/packages/server/test/graphql/generated/graphql.ts +++ b/packages/server/test/graphql/generated/graphql.ts @@ -298,6 +298,8 @@ export type AutomateFunctionTemplate = { }; export enum AutomateFunctionTemplateLanguage { + Demonstration = 'DEMONSTRATION', + Demonstrationpython = 'DEMONSTRATIONPYTHON', DotNet = 'DOT_NET', Python = 'PYTHON', Typescript = 'TYPESCRIPT'