From 8f0a234ae3f36a4d66f331292c05da04c6160b4a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 23 Oct 2024 11:13:52 +0100 Subject: [PATCH] fix tests --- packages/server/src/automations/actions.ts | 3 +-- packages/types/src/documents/app/automation/schema.ts | 8 ++++---- .../src/api/controllers/global/tests/configs.spec.ts | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/server/src/automations/actions.ts b/packages/server/src/automations/actions.ts index a6c9be41c5..a8b69fa7d7 100644 --- a/packages/server/src/automations/actions.ts +++ b/packages/server/src/automations/actions.ts @@ -51,6 +51,7 @@ const ACTION_IMPLS: ActionImplType = { QUERY_ROWS: queryRow.run, COLLECT: collect.run, TRIGGER_AUTOMATION_RUN: triggerAutomationRun.run, + OPENAI: openai.run, // these used to be lowercase step IDs, maintain for backwards compat discord: discord.run, slack: slack.run, @@ -107,8 +108,6 @@ export async function getActionDefinitions() { (await features.flags.isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS)) ) { BUILTIN_ACTION_DEFINITIONS["OPENAI"] = openai.definition - // @ts-ignore - ACTION_IMPLS["OPENAI"] = openai.run } const actionDefinitions = BUILTIN_ACTION_DEFINITIONS diff --git a/packages/types/src/documents/app/automation/schema.ts b/packages/types/src/documents/app/automation/schema.ts index 599256694d..b8a19b7b45 100644 --- a/packages/types/src/documents/app/automation/schema.ts +++ b/packages/types/src/documents/app/automation/schema.ts @@ -126,16 +126,16 @@ export type ActionImplementations = { n8nStepInputs, ExternalAppStepOutputs > + [AutomationActionStepId.OPENAI]: ActionImplementation< + OpenAIStepInputs, + OpenAIStepOutputs + > } & (T extends "self" ? { [AutomationActionStepId.EXECUTE_BASH]: ActionImplementation< BashStepInputs, BashStepOutputs > - [AutomationActionStepId.OPENAI]: ActionImplementation< - OpenAIStepInputs, - OpenAIStepOutputs - > } : {}) diff --git a/packages/worker/src/api/controllers/global/tests/configs.spec.ts b/packages/worker/src/api/controllers/global/tests/configs.spec.ts index 9091f29247..857f499dcc 100644 --- a/packages/worker/src/api/controllers/global/tests/configs.spec.ts +++ b/packages/worker/src/api/controllers/global/tests/configs.spec.ts @@ -13,10 +13,6 @@ describe("Global configs controller", () => { await config.afterAll() }) - afterEach(() => { - jest.resetAllMocks() - }) - it("Should strip secrets when pulling AI config", async () => { const data = structures.configs.ai() await config.api.configs.saveConfig(data)