From e1356b34bee6f0883579f81e696aa83888ed99d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Thu, 2 Jan 2025 12:43:58 +0100 Subject: [PATCH 1/5] ci: revert lockfile regressions (no-changelog) --- pnpm-lock.yaml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 14b8680478..54cca8607f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -434,7 +434,7 @@ importers: version: 3.666.0(@aws-sdk/client-sts@3.666.0) '@getzep/zep-cloud': specifier: 1.0.12 - version: 1.0.12(@langchain/core@0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(langchain@0.3.6(4axcxpjbcq5bce7ff6ajxrpp4i)) + version: 1.0.12(@langchain/core@0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(langchain@0.3.6(e4rnrwhosnp2xiru36mqgdy2bu)) '@getzep/zep-js': specifier: 0.9.0 version: 0.9.0 @@ -461,7 +461,7 @@ importers: version: 0.3.1(@aws-sdk/client-sso-oidc@3.666.0(@aws-sdk/client-sts@3.666.0))(@langchain/core@0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13) '@langchain/community': specifier: 0.3.15 - version: 0.3.15(v4qhcw25bevfr6xzz4fnsvjiqe) + version: 0.3.15(vc5hvyy27o4cmm4jplsptc2fqm) '@langchain/core': specifier: 'catalog:' version: 0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)) @@ -548,7 +548,7 @@ importers: version: 23.0.1 langchain: specifier: 0.3.6 - version: 0.3.6(4axcxpjbcq5bce7ff6ajxrpp4i) + version: 0.3.6(e4rnrwhosnp2xiru36mqgdy2bu) lodash: specifier: 'catalog:' version: 4.17.21 @@ -15690,7 +15690,7 @@ snapshots: '@gar/promisify@1.1.3': optional: true - '@getzep/zep-cloud@1.0.12(@langchain/core@0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(langchain@0.3.6(4axcxpjbcq5bce7ff6ajxrpp4i))': + '@getzep/zep-cloud@1.0.12(@langchain/core@0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(langchain@0.3.6(e4rnrwhosnp2xiru36mqgdy2bu))': dependencies: form-data: 4.0.0 node-fetch: 2.7.0(encoding@0.1.13) @@ -15699,7 +15699,7 @@ snapshots: zod: 3.23.8 optionalDependencies: '@langchain/core': 0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)) - langchain: 0.3.6(4axcxpjbcq5bce7ff6ajxrpp4i) + langchain: 0.3.6(e4rnrwhosnp2xiru36mqgdy2bu) transitivePeerDependencies: - encoding @@ -16163,7 +16163,7 @@ snapshots: - aws-crt - encoding - '@langchain/community@0.3.15(v4qhcw25bevfr6xzz4fnsvjiqe)': + '@langchain/community@0.3.15(vc5hvyy27o4cmm4jplsptc2fqm)': dependencies: '@ibm-cloud/watsonx-ai': 1.1.2 '@langchain/core': 0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)) @@ -16173,7 +16173,7 @@ snapshots: flat: 5.0.2 ibm-cloud-sdk-core: 5.1.0 js-yaml: 4.1.0 - langchain: 0.3.6(4axcxpjbcq5bce7ff6ajxrpp4i) + langchain: 0.3.6(e4rnrwhosnp2xiru36mqgdy2bu) langsmith: 0.2.3(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)) uuid: 10.0.0 zod: 3.23.8 @@ -16186,7 +16186,7 @@ snapshots: '@aws-sdk/client-s3': 3.666.0 '@aws-sdk/credential-provider-node': 3.666.0(@aws-sdk/client-sso-oidc@3.666.0(@aws-sdk/client-sts@3.666.0))(@aws-sdk/client-sts@3.666.0) '@azure/storage-blob': 12.18.0(encoding@0.1.13) - '@getzep/zep-cloud': 1.0.12(@langchain/core@0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(langchain@0.3.6(4axcxpjbcq5bce7ff6ajxrpp4i)) + '@getzep/zep-cloud': 1.0.12(@langchain/core@0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(langchain@0.3.6(e4rnrwhosnp2xiru36mqgdy2bu)) '@getzep/zep-js': 0.9.0 '@google-ai/generativelanguage': 2.6.0(encoding@0.1.13) '@google-cloud/storage': 7.12.1(encoding@0.1.13) @@ -19470,6 +19470,14 @@ snapshots: transitivePeerDependencies: - debug + axios@1.7.4(debug@4.3.7): + dependencies: + follow-redirects: 1.15.6(debug@4.3.7) + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + axios@1.7.7: dependencies: follow-redirects: 1.15.6(debug@4.3.6) @@ -22321,7 +22329,7 @@ snapshots: '@types/debug': 4.1.12 '@types/node': 18.16.16 '@types/tough-cookie': 4.0.2 - axios: 1.7.4 + axios: 1.7.4(debug@4.3.7) camelcase: 6.3.0 debug: 4.3.7 dotenv: 16.4.5 @@ -22331,7 +22339,7 @@ snapshots: isstream: 0.1.2 jsonwebtoken: 9.0.2 mime-types: 2.1.35 - retry-axios: 2.6.0(axios@1.7.4(debug@4.3.7)) + retry-axios: 2.6.0(axios@1.7.4) tough-cookie: 4.1.3 transitivePeerDependencies: - supports-color @@ -23332,7 +23340,7 @@ snapshots: kuler@2.0.0: {} - langchain@0.3.6(4axcxpjbcq5bce7ff6ajxrpp4i): + langchain@0.3.6(e4rnrwhosnp2xiru36mqgdy2bu): dependencies: '@langchain/core': 0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)) '@langchain/openai': 0.3.14(@langchain/core@0.3.19(openai@4.73.1(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13) @@ -25702,7 +25710,7 @@ snapshots: ret@0.1.15: {} - retry-axios@2.6.0(axios@1.7.4(debug@4.3.7)): + retry-axios@2.6.0(axios@1.7.4): dependencies: axios: 1.7.4 From dab7bc43c6ac051dfe7d117e66ed722390751520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Thu, 2 Jan 2025 15:34:28 +0100 Subject: [PATCH 2/5] ci: Fix e2e tests (#12432) --- cypress/e2e/14-mapping.cy.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/14-mapping.cy.ts b/cypress/e2e/14-mapping.cy.ts index e19959453f..46448b4966 100644 --- a/cypress/e2e/14-mapping.cy.ts +++ b/cypress/e2e/14-mapping.cy.ts @@ -41,7 +41,9 @@ describe('Data mapping', () => { ndv.actions.mapDataFromHeader(1, 'value'); ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.timestamp }}'); ndv.getters.inlineExpressionEditorInput().type('{esc}'); - ndv.getters.parameterExpressionPreview('value').should('include.text', '2024'); + ndv.getters + .parameterExpressionPreview('value') + .should('include.text', new Date().getFullYear()); ndv.actions.mapDataFromHeader(2, 'value'); ndv.getters From 6b46657412a1efff35be5083f0ff4c00f9b3e7f9 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Thu, 2 Jan 2025 10:43:34 -0500 Subject: [PATCH 3/5] fix(editor): Only ignore managed credentials in the HTTP node (#12417) --- .../src/components/NodeCredentials.test.ts | 67 ++++++++++++++++++- .../src/components/NodeCredentials.vue | 15 +++-- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/packages/editor-ui/src/components/NodeCredentials.test.ts b/packages/editor-ui/src/components/NodeCredentials.test.ts index f5f816b0b1..2839a75c03 100644 --- a/packages/editor-ui/src/components/NodeCredentials.test.ts +++ b/packages/editor-ui/src/components/NodeCredentials.test.ts @@ -7,6 +7,7 @@ import { createComponentRenderer } from '@/__tests__/render'; import { useCredentialsStore } from '@/stores/credentials.store'; import { mockedStore } from '@/__tests__/utils'; import type { INodeUi } from '@/Interface'; +import { useNDVStore } from '@/stores/ndv.store'; const httpNode: INodeUi = { parameters: { @@ -31,6 +32,25 @@ const httpNode: INodeUi = { issues: { parameters: { url: ['Parameter "URL" is required.'] } }, }; +const openAiNode: INodeUi = { + parameters: { + resource: 'text', + operation: 'message', + modelId: { __rl: true, mode: 'list', value: '' }, + messages: { values: [{ content: '', role: 'user' }] }, + simplify: true, + jsonOutput: false, + options: {}, + }, + type: '@n8n/n8n-nodes-langchain.openAi', + typeVersion: 1.8, + position: [440, 0], + id: '17241295-a277-4cdf-8c46-6c3f85b335e9', + name: 'OpenAI', + credentials: { openAiApi: { id: 'byDFnd7vN5GzMVD2', name: 'n8n free OpenAI API credits' } }, + issues: { parameters: { modelId: ['Parameter "Model" is required.'] } }, +}; + describe('NodeCredentials', () => { const defaultRenderOptions: RenderOptions = { pinia: createTestingPinia(), @@ -45,6 +65,9 @@ describe('NodeCredentials', () => { const renderComponent = createComponentRenderer(NodeCredentials, defaultRenderOptions); + const credentialsStore = mockedStore(useCredentialsStore); + const ndvStore = mockedStore(useNDVStore); + beforeAll(() => { credentialsStore.state.credentialTypes = { openAiApi: { @@ -80,9 +103,8 @@ describe('NodeCredentials', () => { }; }); - const credentialsStore = mockedStore(useCredentialsStore); - it('should display available credentials in the dropdown', async () => { + ndvStore.activeNode = httpNode; credentialsStore.state.credentials = { c8vqdPpPClh4TgIO: { id: 'c8vqdPpPClh4TgIO', @@ -103,7 +125,8 @@ describe('NodeCredentials', () => { expect(screen.queryByText('OpenAi account')).toBeInTheDocument(); }); - it('should ignore managed credentials in the dropdown', async () => { + it('should ignore managed credentials in the dropdown if active node is the HTTP node', async () => { + ndvStore.activeNode = httpNode; credentialsStore.state.credentials = { c8vqdPpPClh4TgIO: { id: 'c8vqdPpPClh4TgIO', @@ -132,4 +155,42 @@ describe('NodeCredentials', () => { expect(screen.queryByText('OpenAi account')).toBeInTheDocument(); expect(screen.queryByText('OpenAi account 2')).not.toBeInTheDocument(); }); + + it('should not ignored managed credentials in the dropdown if active node is not the HTTP node', async () => { + ndvStore.activeNode = openAiNode; + credentialsStore.state.credentials = { + c8vqdPpPClh4TgIO: { + id: 'c8vqdPpPClh4TgIO', + name: 'OpenAi account', + type: 'openAiApi', + isManaged: false, + createdAt: '', + updatedAt: '', + }, + SkXM3oUkQvvYS31c: { + id: 'c8vqdPpPClh4TgIO', + name: 'OpenAi account 2', + type: 'openAiApi', + isManaged: true, + createdAt: '', + updatedAt: '', + }, + }; + + renderComponent( + { + props: { + node: openAiNode, + }, + }, + { merge: true }, + ); + + const credentialsSelect = screen.getByTestId('node-credentials-select'); + + await fireEvent.click(credentialsSelect); + + expect(screen.queryByText('OpenAi account')).toBeInTheDocument(); + expect(screen.queryByText('OpenAi account 2')).toBeInTheDocument(); + }); }); diff --git a/packages/editor-ui/src/components/NodeCredentials.vue b/packages/editor-ui/src/components/NodeCredentials.vue index 1872db8191..8fe4b15153 100644 --- a/packages/editor-ui/src/components/NodeCredentials.vue +++ b/packages/editor-ui/src/components/NodeCredentials.vue @@ -1,9 +1,10 @@