Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into check-langchain-doc…
Browse files Browse the repository at this point in the history
…s-urls
  • Loading branch information
netroy committed Jan 9, 2024
2 parents 87942c0 + 23abd8f commit 20be042
Show file tree
Hide file tree
Showing 49 changed files with 193 additions and 151 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/units-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:
if: ${{ inputs.collectCoverage == 'true' }}
uses: codecov/codecov-action@v3
with:
files: packages/@n8n/client-oauth2/coverage/cobertura-coverage.xml,packages/cli/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/design-system/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
files: packages/@n8n/chat/coverage/cobertura-coverage.xml,packages/@n8n/nodes-langchain/coverage/cobertura-coverage.xml,packages/@n8n/permissions/coverage/cobertura-coverage.xml,packages/@n8n/client-oauth2/coverage/cobertura-coverage.xml,packages/cli/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/design-system/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
5 changes: 3 additions & 2 deletions cypress/composables/modals/workflow-credential-setup-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

export const getWorkflowCredentialsModal = () => cy.getByTestId('setup-workflow-credentials-modal');

export const getContinueButton = () => cy.getByTestId('continue-button');

/**
* Actions
*/

export const closeModal = () =>
getWorkflowCredentialsModal().find("button[aria-label='Close this dialog']").click();
export const closeModalFromContinueButton = () => getContinueButton().click();
11 changes: 6 additions & 5 deletions cypress/e2e/34-template-credentials-setup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Template credentials setup', () => {
templateWorkflowPage.actions.clickUseThisWorkflowButton();

templateCredentialsSetupPage.getters
.title(`Setup 'Promote new Shopify products on Twitter and Telegram' template`)
.title(`Set up 'Promote new Shopify products on Twitter and Telegram' template`)
.should('be.visible');
});

Expand All @@ -53,23 +53,23 @@ describe('Template credentials setup', () => {
clickUseWorkflowButtonByTitle('Promote new Shopify products on Twitter and Telegram');

templateCredentialsSetupPage.getters
.title(`Setup 'Promote new Shopify products on Twitter and Telegram' template`)
.title(`Set up 'Promote new Shopify products on Twitter and Telegram' template`)
.should('be.visible');
});

it('can be opened with a direct url', () => {
templateCredentialsSetupPage.visitTemplateCredentialSetupPage(testTemplate.id);

templateCredentialsSetupPage.getters
.title(`Setup 'Promote new Shopify products on Twitter and Telegram' template`)
.title(`Set up 'Promote new Shopify products on Twitter and Telegram' template`)
.should('be.visible');
});

it('has all the elements on page', () => {
templateCredentialsSetupPage.visitTemplateCredentialSetupPage(testTemplate.id);

templateCredentialsSetupPage.getters
.title(`Setup 'Promote new Shopify products on Twitter and Telegram' template`)
.title(`Set up 'Promote new Shopify products on Twitter and Telegram' template`)
.should('be.visible');

templateCredentialsSetupPage.getters
Expand Down Expand Up @@ -195,7 +195,8 @@ describe('Template credentials setup', () => {
templateCredentialsSetupPage.fillInDummyCredentialsForAppWithConfirm('X (Formerly Twitter)');
templateCredentialsSetupPage.fillInDummyCredentialsForApp('Telegram');

setupCredsModal.closeModal();
setupCredsModal.closeModalFromContinueButton();
setupCredsModal.getWorkflowCredentialsModal().should('not.exist');

// Focus the canvas so the copy to clipboard works
workflowPage.getters.canvasNodes().eq(0).realClick();
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const config = {
}, {}),
setupFilesAfterEnv: ['jest-expect-message'],
collectCoverage: process.env.COVERAGE_ENABLED === 'true',
coverageReporters: [process.env.COVERAGE_REPORT === 'true' ? 'text' : 'text-summary'],
coverageReporters: ['text-summary'],
collectCoverageFrom: ['src/**/*.ts'],
};

Expand Down
41 changes: 0 additions & 41 deletions packages/@n8n/chat/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,4 @@ module.exports = {
extends: ['@n8n_io/eslint-config/frontend'],

...sharedOptions(__dirname, 'frontend'),

rules: {
'n8n-local-rules/dangerously-use-html-string-missing': 'off',

// TODO: Remove these
'id-denylist': 'warn',
'import/extensions': 'warn',
'import/no-default-export': 'warn',
'import/order': 'off',
'import/no-cycle': 'warn',
'import/no-duplicates': 'warn',
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/dot-notation': 'warn',
'@typescript-eslint/lines-between-class-members': 'warn',
'@typescript-eslint/member-delimiter-style': 'warn',
'@typescript-eslint/naming-convention': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
'@typescript-eslint/no-for-in-array': 'warn',
'@typescript-eslint/no-loop-func': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-shadow': 'warn',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
'@typescript-eslint/no-redundant-type-constituents': 'warn',
'@typescript-eslint/no-base-to-string': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
},
};
3 changes: 2 additions & 1 deletion packages/@n8n/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"test:dev": "vitest",
"test": "vitest run --coverage",
"type-check": "vue-tsc --noEmit -p tsconfig.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore --ignore-path .eslintignore",
"lint": "eslint . --ext .js,.ts,.vue --quiet",
"lintfix": "eslint . --ext .js,.ts,.vue --fix",
"format": "prettier --write src/",
"storybook": "storybook dev -p 6006 --no-open",
"build:storybook": "storybook build",
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import { Chat, ChatWindow } from '@n8n/chat/components';
import { computed, onMounted } from 'vue';
import hljs from 'highlight.js/lib/core';
import hljsXML from 'highlight.js/lib/languages/xml';
import hljsJavascript from 'highlight.js/lib/languages/javascript';
import { Chat, ChatWindow } from '@n8n/chat/components';
import { useOptions } from '@n8n/chat/composables';
defineProps({});
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/__stories__/App.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type { StoryObj } from '@storybook/vue3';
import { onMounted } from 'vue';
import type { ChatOptions } from '@n8n/chat/types';
import { createChat } from '@n8n/chat/index';
import { onMounted } from 'vue';

const webhookUrl = 'http://localhost:5678/webhook/f406671e-c954-4691-b39a-66c90aa2f103/chat';

Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/components/Chat.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import { nextTick, onMounted } from 'vue';
import Layout from '@n8n/chat/components/Layout.vue';
import GetStarted from '@n8n/chat/components/GetStarted.vue';
import GetStartedFooter from '@n8n/chat/components/GetStartedFooter.vue';
import MessagesList from '@n8n/chat/components/MessagesList.vue';
import Input from '@n8n/chat/components/Input.vue';
import { nextTick, onMounted } from 'vue';
import { useI18n, useChat, useOptions } from '@n8n/chat/composables';
import { chatEventBus } from '@n8n/chat/event-buses';
Expand Down
4 changes: 2 additions & 2 deletions packages/@n8n/chat/src/components/ChatWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import IconChat from 'virtual:icons/mdi/chat';
// eslint-disable-next-line import/no-unresolved
import IconChevronDown from 'virtual:icons/mdi/chevron-down';
import Chat from '@n8n/chat/components/Chat.vue';
import { nextTick, ref } from 'vue';
import Chat from '@n8n/chat/components/Chat.vue';
import { chatEventBus } from '@n8n/chat/event-buses';
const isOpen = ref(false);
Expand All @@ -23,7 +23,7 @@ function toggle() {
<template>
<div class="chat-window-wrapper">
<Transition name="chat-window-transition">
<div class="chat-window" v-show="isOpen">
<div v-show="isOpen" class="chat-window">
<Chat />
</div>
</Transition>
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/components/Input.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
// eslint-disable-next-line import/no-unresolved
import IconSend from 'virtual:icons/mdi/send';
import { useI18n, useChat } from '@n8n/chat/composables';
import { computed, ref } from 'vue';
import { useI18n, useChat } from '@n8n/chat/composables';
const chatStore = useChat();
const { waitingForResponse } = chatStore;
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/components/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ onBeforeUnmount(() => {
<div v-if="$slots.header" class="chat-header">
<slot name="header" />
</div>
<div v-if="$slots.default" class="chat-body" ref="chatBodyRef">
<div v-if="$slots.default" ref="chatBodyRef" class="chat-body">
<slot />
</div>
<div v-if="$slots.footer" class="chat-footer">
Expand Down
8 changes: 2 additions & 6 deletions packages/@n8n/chat/src/components/Message.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
/* eslint-disable @typescript-eslint/naming-convention */
import type { ChatMessage } from '@n8n/chat/types';
import type { PropType } from 'vue';
import { computed, toRefs } from 'vue';
import VueMarkdown from 'vue-markdown-render';
import hljs from 'highlight.js/lib/core';
import type { ChatMessage } from '@n8n/chat/types';
const props = defineProps({
message: {
Expand Down Expand Up @@ -41,11 +41,7 @@ const markdownOptions = {
<template>
<div class="chat-message" :class="classes">
<slot>
<vue-markdown
class="chat-message-markdown"
:source="messageText"
:options="markdownOptions"
/>
<VueMarkdown class="chat-message-markdown" :source="messageText" :options="markdownOptions" />
</slot>
</div>
</template>
Expand Down
4 changes: 2 additions & 2 deletions packages/@n8n/chat/src/components/MessageTyping.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts" setup>
import type { ChatMessage } from '@n8n/chat/types';
import { Message } from './index';
import type { PropType } from 'vue';
import { computed } from 'vue';
import { Message } from './index';
import type { ChatMessage } from '@n8n/chat/types';
const props = defineProps({
animation: {
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/plugins/chat.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Plugin } from 'vue';
import { computed, nextTick, ref } from 'vue';
import type { ChatMessage, ChatOptions } from '@n8n/chat/types';
import { v4 as uuidv4 } from 'uuid';
import type { ChatMessage, ChatOptions } from '@n8n/chat/types';
import { chatEventBus } from '@n8n/chat/event-buses';
import * as api from '@n8n/chat/api';
import { ChatOptionsSymbol, ChatSymbol, localStorageSessionIdKey } from '@n8n/chat/constants';
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/types/chat.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ChatMessage } from '@n8n/chat/types/messages';
import type { Ref } from 'vue';
import type { ChatMessage } from '@n8n/chat/types/messages';

export interface Chat {
initialMessages: Ref<ChatMessage[]>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class GooglePalmApi implements ICredentialType {

displayName = 'GooglePaLMApi';

documentationUrl = 'googlePalm';
documentationUrl = 'google';

properties: INodeProperties[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class MistralCloudApi implements ICredentialType {

displayName = 'Mistral Cloud API';

documentationUrl = 'mistralCloud';
documentationUrl = 'mistral';

properties: INodeProperties[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class QdrantApi implements ICredentialType {
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
required: true,
required: false,
default: '',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class SerpApi implements ICredentialType {

displayName = 'SerpAPI';

documentationUrl = 'serpapi';
documentationUrl = 'serp';

properties: INodeProperties[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DocumentBinaryInputLoader implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.documentbinaryinputloader/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.documentdefaultdataloader/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class DocumentJsonInputLoader implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.documentjsoninputloader/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.documentdefaultdataloader/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class VectorStoreInMemoryInsert implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemoryinsert/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class VectorStoreInMemoryLoad implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.vectorstoreinmemoryload/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class VectorStorePineconeInsert implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepineconeinsert/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepinecone/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class VectorStorePineconeLoad implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.vectorstorepineconeload/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepinecone/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class VectorStoreSupabaseInsert implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoresupabaseinsert/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoresupabase/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class VectorStoreSupabaseLoad implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.vectorstoresupabaseload/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoresupabase/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class VectorStoreZepInsert implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorezepinsert/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorezep/',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class VectorStoreZepLoad implements INodeType {
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.vectorstorezepload/',
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorezep/',
},
],
},
Expand Down
6 changes: 0 additions & 6 deletions packages/@n8n_io/eslint-config/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ module.exports = {
ignorePatterns: ['**/*.js', '**/*.d.ts', 'vite.config.ts', '**/*.ts.snap'],

overrides: [
{
files: ['src/**/*.vue'],
rules: {
'n8n-local-rules/dangerously-use-html-string-missing': 'error',
},
},
{
files: ['**/*.test.ts', '**/test/**/*.ts', '**/__tests__/**/*.ts'],
rules: {
Expand Down
Loading

0 comments on commit 20be042

Please sign in to comment.