ci: Fix lint warnings in @n8n/chat and @n8n/nodes-langchain (no-changelog) (#7884)

Solve lint warnings shown on all PRs for `@n8n/chat` and
`@n8n/nodes-langchain`

Example: https://github.com/n8n-io/n8n/pull/7883/files
This commit is contained in:
Iván Ovejero
2023-11-30 13:22:27 +01:00
committed by GitHub
parent 627ddb91fb
commit b024cc52e7
4 changed files with 22 additions and 23 deletions

View File

@@ -192,13 +192,11 @@ export class LmOpenAi implements INodeType {
uri = `${options.baseURL}/models`;
}
const data = (
await this.helpers.requestWithAuthentication.call(this, 'openAiApi', {
method: 'GET',
uri,
json: true,
})
).data as Array<{ owned_by: string; id: string }>;
const { data } = (await this.helpers.requestWithAuthentication.call(this, 'openAiApi', {
method: 'GET',
uri,
json: true,
})) as { data: Array<{ owned_by: string; id: string }> };
for (const model of data) {
if (!model.owned_by?.startsWith('system')) continue;

View File

@@ -1,4 +1,4 @@
import type { IDataObject, ILoadOptionsFunctions } from 'n8n-workflow';
import { ApplicationError, type IDataObject, type ILoadOptionsFunctions } from 'n8n-workflow';
import { Pinecone } from '@pinecone-database/pinecone';
export async function pineconeIndexSearch(this: ILoadOptionsFunctions) {
@@ -24,16 +24,18 @@ export async function supabaseTableNameSearch(this: ILoadOptionsFunctions) {
const results = [];
const paths = (
await this.helpers.requestWithAuthentication.call(this, 'supabaseApi', {
headers: {
Prefer: 'return=representation',
},
method: 'GET',
uri: `${credentials.host}/rest/v1/`,
json: true,
})
).paths as IDataObject;
if (typeof credentials.host !== 'string') {
throw new ApplicationError('Expected Supabase credentials host to be a string');
}
const { paths } = (await this.helpers.requestWithAuthentication.call(this, 'supabaseApi', {
headers: {
Prefer: 'return=representation',
},
method: 'GET',
uri: `${credentials.host}/rest/v1/`,
json: true,
})) as { paths: IDataObject };
for (const path of Object.keys(paths)) {
//omit introspection path