lint fixes

This commit is contained in:
Jonathan Bennetts 2024-10-28 12:06:05 +00:00
parent 41d770e9a6
commit f3207e2263
No known key found for this signature in database
28 changed files with 45 additions and 33 deletions

View file

@ -9,10 +9,6 @@ import type {
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
import type { TDtableMetadataColumns, TDtableViewColumns, TEndpointVariableName } from './types';
import { schema } from './Schema';
import type {
ICredential,
ICtx,
@ -22,6 +18,8 @@ import type {
IRow,
IRowObject,
} from './Interfaces';
import { schema } from './Schema';
import type { TDtableMetadataColumns, TDtableViewColumns, TEndpointVariableName } from './types';
const userBaseUri = (uri?: string) => {
if (uri === undefined) {

View file

@ -1,4 +1,5 @@
import { NodeConnectionType, type INodeTypeDescription } from 'n8n-workflow';
import { rowFields, rowOperations } from './RowDescription';
export const versionDescription: INodeTypeDescription = {

View file

@ -21,11 +21,9 @@ import {
split,
updateAble,
} from './GenericFunctions';
import type { TColumnsUiValues, TColumnValue } from './types';
import type { ICtx, IRow, IRowObject } from './Interfaces';
import { versionDescription } from './SeaTable.node';
import type { TColumnsUiValues, TColumnValue } from './types';
export class SeaTableV1 implements INodeType {
description: INodeTypeDescription;

View file

@ -1,5 +1,6 @@
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
import { NodeConnectionType, type INodeTypeDescription } from 'n8n-workflow';
import { rowFields, rowOperations } from './RowDescription';
export const versionDescription: INodeTypeDescription = {

View file

@ -10,6 +10,7 @@ export type TSeaTableServerEdition = 'enterprise edition';
// ----------------------------------
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
import type { IDtableMetadataColumn, IDtableMetadataTable, TDtableViewColumn } from './Interfaces';
export type TInheritColumnTypeTime = 'ctime' | 'mtime';

View file

@ -1,5 +1,4 @@
import type FormData from 'form-data';
import type {
IDataObject,
IExecuteFunctions,
@ -11,10 +10,6 @@ import type {
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
import type { TDtableMetadataColumns, TEndpointVariableName } from './types';
import { schema } from './Schema';
import type {
ICollaborator,
ICollaboratorsResult,
@ -28,6 +23,8 @@ import type {
IColumnDigitalSignature,
IFile,
} from './actions/Interfaces';
import { schema } from './Schema';
import type { TDtableMetadataColumns, TEndpointVariableName } from './types';
// remove last backslash
const userBaseUri = (uri?: string) => {
@ -124,9 +121,6 @@ export async function seaTableApiRequest(
};
}
// DEBUG-MODE OR API-REQUESTS
// console.log(options);
if (Object.keys(body).length === 0) {
delete options.body;
}
@ -292,32 +286,30 @@ export function enrichColumns(
return row;
}
// using create, I input a string like a5adebe279e04415a28b2c7e256e9e8d@auth.local and it should be transformed to an array.
// same with multi-select.
export function splitStringColumnsToArrays(
row: IRowObject,
columns: TDtableMetadataColumns,
): IRowObject {
columns.map((column) => {
if (column.type == 'collaborator' || column.type == 'multiple-select') {
if (column.type === 'collaborator' || column.type === 'multiple-select') {
if (typeof row[column.name] === 'string') {
const input = row[column.name] as string;
row[column.name] = input.split(',').map((item) => item.trim());
}
}
if (column.type == 'number') {
if (column.type === 'number') {
if (typeof row[column.name] === 'string') {
const input = row[column.name] as string;
row[column.name] = parseFloat(input);
}
}
if (column.type == 'rate' || column.type == 'duration') {
if (column.type === 'rate' || column.type === 'duration') {
if (typeof row[column.name] === 'string') {
const input = row[column.name] as string;
row[column.name] = parseInt(input);
}
}
if (column.type == 'checkbox') {
if (column.type === 'checkbox') {
if (typeof row[column.name] === 'string') {
const input = row[column.name] as string;
row[column.name] = false;

View file

@ -5,9 +5,9 @@ import type {
INodeTypeBaseDescription,
} from 'n8n-workflow';
import { router } from './actions/router';
import { versionDescription } from './actions/SeaTable.node';
import { loadOptions } from './methods';
import { router } from './actions/router';
export class SeaTableV2 implements INodeType {
description: INodeTypeDescription;

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
import type { IUploadLink, IRowObject } from '../Interfaces';

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
import type { APITypes } from '../../types';

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
import type { ICollaborator } from '../Interfaces';

View file

@ -1,8 +1,9 @@
import type { INodeProperties } from 'n8n-workflow';
import * as snapshot from './snapshot.operation';
import * as metadata from './metadata.operation';
import * as apiCall from './apiCall.operation';
import * as collaborator from './collaborator.operation';
import * as metadata from './metadata.operation';
import * as snapshot from './snapshot.operation';
export { snapshot, metadata, apiCall, collaborator };

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
export const properties: INodeProperties[] = [];

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
export const properties: INodeProperties[] = [];

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
export const properties: INodeProperties[] = [

View file

@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow';
import * as add from './add.operation';
import * as list from './list.operation';
import * as remove from './remove.operation';

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
export const properties: INodeProperties[] = [
@ -44,7 +45,7 @@ export const properties: INodeProperties[] = [
name: 'rowId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
required: true,
typeOptions: {
loadOptionsDependsOn: ['tableName'],

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
export const properties: INodeProperties[] = [

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import {
seaTableApiRequest,
getTableColumns,
@ -13,8 +14,8 @@ import {
updateAble,
splitStringColumnsToArrays,
} from '../../GenericFunctions';
import type { IRowObject } from '../Interfaces';
import type { TColumnValue, TColumnsUiValues } from '../../types';
import type { IRowObject } from '../Interfaces';
export const properties: INodeProperties[] = [
{

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import {
seaTableApiRequest,
enrichColumns,
@ -35,7 +36,7 @@ export const properties: INodeProperties[] = [
name: 'rowId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
required: true,
typeOptions: {
loadOptionsDependsOn: ['tableName'],

View file

@ -1,12 +1,13 @@
import type { INodeProperties } from 'n8n-workflow';
import * as create from './create.operation';
import * as get from './get.operation';
import * as list from './list.operation';
import * as search from './search.operation';
import * as update from './update.operation';
import * as remove from './remove.operation';
import * as lock from './lock.operation';
import * as remove from './remove.operation';
import * as search from './search.operation';
import * as unlock from './unlock.operation';
import * as update from './update.operation';
export { create, get, search, update, remove, lock, unlock, list };

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import {
seaTableApiRequest,
enrichColumns,

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
export const properties: INodeProperties[] = [

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
export const properties: INodeProperties[] = [

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import {
seaTableApiRequest,
enrichColumns,

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import { seaTableApiRequest } from '../../GenericFunctions';
export const properties: INodeProperties[] = [
@ -29,7 +30,7 @@ export const properties: INodeProperties[] = [
name: 'rowId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
required: true,
typeOptions: {
loadOptionsDependsOn: ['tableName'],

View file

@ -5,6 +5,7 @@ import {
type IExecuteFunctions,
updateDisplayOptions,
} from 'n8n-workflow';
import {
seaTableApiRequest,
getTableColumns,
@ -13,8 +14,8 @@ import {
updateAble,
splitStringColumnsToArrays,
} from '../../GenericFunctions';
import type { IRowObject } from '../Interfaces';
import type { TColumnsUiValues, TColumnValue } from '../../types';
import type { IRowObject } from '../Interfaces';
export const properties: INodeProperties[] = [
{

View file

@ -1,6 +1,7 @@
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
import { getTableColumns, seaTableApiRequest, updateAble } from '../GenericFunctions';
import type { IRow } from '../actions/Interfaces';
import { getTableColumns, seaTableApiRequest, updateAble } from '../GenericFunctions';
export async function getTableNames(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];

View file

@ -10,6 +10,7 @@ export type TSeaTableServerEdition = 'enterprise edition';
// ----------------------------------
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
import type {
IDtableMetadataColumn,
IDtableMetadataTable,