fix typecheck errors

This commit is contained in:
Christoph Dyllick-Brenzinger 2024-06-26 05:21:25 +02:00
parent 71f13ab240
commit 49f3f61676
4 changed files with 6 additions and 12 deletions

View file

@ -67,7 +67,7 @@ function endpointCtxExpr(ctx: ICtx, endpoint: string): string {
return endpoint.replace( return endpoint.replace(
/({{ *(access_token|dtable_uuid|server) *}})/g, /({{ *(access_token|dtable_uuid|server) *}})/g,
(match: string, expr: string, name: TEndpointVariableName) => { (match: string, name: TEndpointVariableName) => {
return endpointVariables[name] || match; return endpointVariables[name] || match;
}, },
); );
@ -227,7 +227,7 @@ export const split = (subject: string): string[] =>
normalize(subject) normalize(subject)
.split(/\s*((?:[^\\,]*?(?:\\[\s\S])*)*?)\s*(?:,|$)/) .split(/\s*((?:[^\\,]*?(?:\\[\s\S])*)*?)\s*(?:,|$)/)
.filter((s) => s.length) .filter((s) => s.length)
.map((s) => s.replace(/\\([\s\S])/gm, ($0, $1) => $1)); .map((s) => s.replace(/\\([\s\S])/gm, (_, $1) => $1));
export function columnNamesToArray(columnNames: string): string[] { export function columnNamesToArray(columnNames: string): string[] {
return columnNames ? split(columnNames).filter(nonInternalPredicate).filter(uniquePredicate) : []; return columnNames ? split(columnNames).filter(nonInternalPredicate).filter(uniquePredicate) : [];

View file

@ -67,7 +67,7 @@ function endpointCtxExpr(ctx: ICtx, endpoint: string): string {
return endpoint.replace( return endpoint.replace(
/({{ *(access_token|dtable_uuid|server) *}})/g, /({{ *(access_token|dtable_uuid|server) *}})/g,
(match: string, expr: string, name: TEndpointVariableName) => { (match: string, name: TEndpointVariableName) => {
// I need expr. Why? // I need expr. Why?
return (endpointVariables[name] as string) || match; return (endpointVariables[name] as string) || match;
}, },
@ -193,7 +193,7 @@ export const split = (subject: string): string[] =>
normalize(subject) normalize(subject)
.split(/\s*((?:[^\\,]*?(?:\\[\s\S])*)*?)\s*(?:,|$)/) .split(/\s*((?:[^\\,]*?(?:\\[\s\S])*)*?)\s*(?:,|$)/)
.filter((s) => s.length) .filter((s) => s.length)
.map((s) => s.replace(/\\([\s\S])/gm, ($0, $1) => $1)); .map((s) => s.replace(/\\([\s\S])/gm, (_, $1) => $1));
// INTERNAL: get collaborator info from @auth.local address // INTERNAL: get collaborator info from @auth.local address
function getCollaboratorInfo( function getCollaboratorInfo(

View file

@ -1,10 +1,7 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow'; import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { seaTableApiRequest } from '../../../GenericFunctions'; import { seaTableApiRequest } from '../../../GenericFunctions';
export async function metadata( export async function metadata(this: IExecuteFunctions): Promise<INodeExecutionData[]> {
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const responseData = await seaTableApiRequest.call( const responseData = await seaTableApiRequest.call(
this, this,
{}, {},

View file

@ -1,10 +1,7 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow'; import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { seaTableApiRequest } from '../../../GenericFunctions'; import { seaTableApiRequest } from '../../../GenericFunctions';
export async function snapshot( export async function snapshot(this: IExecuteFunctions): Promise<INodeExecutionData[]> {
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const responseData = await seaTableApiRequest.call( const responseData = await seaTableApiRequest.call(
this, this,
{}, {},