Fix breaking change that resulted in the old v1 node from appearing

This commit is contained in:
Jonathan Bennetts 2024-01-16 11:54:44 +00:00
parent 5f4ada49b9
commit 787f33de4e
3 changed files with 52 additions and 41 deletions

View file

@ -8,7 +8,7 @@ export class SeaTable extends VersionedNodeType {
constructor() {
const baseDescription: INodeTypeBaseDescription = {
displayName: 'SeaTable',
name: 'seatable',
name: 'seaTable',
icon: 'file:seatable.svg',
group: ['output'],
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
@ -17,7 +17,7 @@ export class SeaTable extends VersionedNodeType {
};
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
1: new SeaTableV1(),
1: new SeaTableV1(baseDescription),
2: new SeaTableV2(baseDescription),
};

View file

@ -6,6 +6,7 @@ import type {
INodePropertyOptions,
INodeType,
INodeTypeDescription,
INodeTypeBaseDescription,
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
@ -21,50 +22,20 @@ import {
updateAble,
} from './GenericFunctions';
import { rowFields, rowOperations } from './RowDescription';
import type { TColumnsUiValues, TColumnValue } from './types';
import type { ICtx, IRow, IRowObject } from './Interfaces';
import { versionDescription } from './VersionDescription';
export class SeaTableV1 implements INodeType {
description: INodeTypeDescription = {
displayName: 'SeaTable',
name: 'seaTable',
icon: 'file:seaTable.svg',
group: ['input'],
version: 1,
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
description: 'Consume the SeaTable API',
defaults: {
name: 'SeaTable',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'seaTableApi',
required: true,
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Row',
value: 'row',
},
],
default: 'row',
},
...rowOperations,
...rowFields,
],
};
description: INodeTypeDescription;
constructor(baseDescription: INodeTypeBaseDescription) {
this.description = {
...baseDescription,
...versionDescription,
};
}
methods = {
loadOptions: {

View file

@ -0,0 +1,40 @@
import type { INodeTypeDescription } from 'n8n-workflow';
import { rowFields, rowOperations } from './RowDescription';
export const versionDescription: INodeTypeDescription = {
displayName: 'SeaTable',
name: 'seaTable',
icon: 'file:seaTable.svg',
group: ['input'],
version: 1,
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
description: 'Consume the SeaTable API',
defaults: {
name: 'SeaTable',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'seaTableApi',
required: true,
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Row',
value: 'row',
},
],
default: 'row',
},
...rowOperations,
...rowFields,
],
};