mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fixed linter errors and new action get row links
This commit is contained in:
parent
6f41c759eb
commit
3b0325a7e8
|
@ -69,7 +69,8 @@ export class SeaTableTrigger implements INodeType {
|
||||||
default: 'newRow',
|
default: 'newRow',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Table Name or ID',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -77,11 +78,13 @@ export class SeaTableTrigger implements INodeType {
|
||||||
loadOptionsMethod: 'getTableNames',
|
loadOptionsMethod: 'getTableNames',
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify the name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'View Name or ID',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'View Name',
|
||||||
name: 'viewName',
|
name: 'viewName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -94,11 +97,13 @@ export class SeaTableTrigger implements INodeType {
|
||||||
loadOptionsMethod: 'getTableViews',
|
loadOptionsMethod: 'getTableViews',
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable view to access. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable view to access. Choose from the list, or specify the name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Signature Column Name or ID',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Signature Column',
|
||||||
name: 'assetColumn',
|
name: 'assetColumn',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -112,8 +117,9 @@ export class SeaTableTrigger implements INodeType {
|
||||||
loadOptionsMethod: 'getSignatureColumns',
|
loadOptionsMethod: 'getSignatureColumns',
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'Select the digital-signature column that should be tracked. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'Select the digital-signature column that should be tracked. Choose from the list, or specify the name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Simplify',
|
displayName: 'Simplify',
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><path fill="url(#a)" d="M16.787 43.213 28.574 55l16.943-16.942a7.87 7.87 0 0 0 0-11.132l-6.22-6.221-.112-.111-18.611 18.57.13.131z"/><path fill="#ff8000" d="m20.704 39.295 22.51-22.507L31.425 5 14.483 21.942a7.87 7.87 0 0 0 0 11.133z"/><defs><linearGradient id="a" x1="0" x2="1" y1="0" y2="0" gradientTransform="rotate(-109.048 29.213 6.813)scale(10.08407)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ff8000"/><stop offset="1" stop-color="#ec2837"/></linearGradient></defs></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><path d="M16.787 43.213L28.574 55l16.943-16.942a7.872 7.872 0 000-11.132l-6.22-6.221-.112-.111-18.611 18.57.13.131z" fill="url(#g1)"/><path d="M20.704 39.295l22.51-22.507L31.425 5 14.483 21.942a7.872 7.872 0 000 11.133z" fill="#ff8000"/><defs id="d1"><linearGradient id="g1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="scale(-10.08407) rotate(70.952 .948 -4.065)"><stop offset="0" id="stop905" stop-color="#ff8000" stop-opacity="1"/><stop offset="1" id="stop907" stop-color="#ec2837" stop-opacity="1"/></linearGradient></defs></svg>
|
Before Width: | Height: | Size: 560 B After Width: | Height: | Size: 629 B |
|
@ -49,10 +49,11 @@ export const rowFields: INodeProperties[] = [
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|
||||||
{
|
{
|
||||||
displayName: 'Table Name or ID',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
placeholder: 'Name of table',
|
placeholder: 'Name of the table',
|
||||||
required: true,
|
required: true,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getTableNames',
|
loadOptionsMethod: 'getTableNames',
|
||||||
|
@ -63,14 +64,16 @@ export const rowFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify the name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Table Name or ID',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Table ID',
|
||||||
name: 'tableId',
|
name: 'tableId',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
placeholder: 'Name of table',
|
placeholder: 'ID of the table',
|
||||||
required: true,
|
required: true,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getTableIds',
|
loadOptionsMethod: 'getTableIds',
|
||||||
|
@ -81,6 +84,7 @@ export const rowFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
|
@ -157,11 +161,13 @@ export const rowFields: INodeProperties[] = [
|
||||||
name: 'columnValues',
|
name: 'columnValues',
|
||||||
values: [
|
values: [
|
||||||
{
|
{
|
||||||
displayName: 'Column Name or ID',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Column Name',
|
||||||
name: 'columnName',
|
name: 'columnName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
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 the name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsDependsOn: ['table'],
|
loadOptionsDependsOn: ['table'],
|
||||||
loadOptionsMethod: 'getTableUpdateAbleColumns',
|
loadOptionsMethod: 'getTableUpdateAbleColumns',
|
||||||
|
@ -243,7 +249,6 @@ export const rowFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
minValue: 1,
|
minValue: 1,
|
||||||
maxValue: 100,
|
|
||||||
},
|
},
|
||||||
default: 50,
|
default: 50,
|
||||||
description: 'Max number of results to return',
|
description: 'Max number of results to return',
|
||||||
|
@ -261,11 +266,13 @@ export const rowFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
displayName: 'View Name or ID',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'View Name',
|
||||||
name: 'view_name',
|
name: 'view_name',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
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 View Name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getViews',
|
loadOptionsMethod: 'getViews',
|
||||||
},
|
},
|
||||||
|
@ -291,7 +298,7 @@ export const rowFields: INodeProperties[] = [
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
description:
|
description:
|
||||||
'Whether the link column in the returned row is the ID of the linked row or the name of the linked row',
|
'Whether the ID of the linked row is returned in the link column (true). Otherwise, it return the name of the linked row (false).',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Direction',
|
displayName: 'Direction',
|
||||||
|
@ -312,15 +319,16 @@ export const rowFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Order By',
|
displayName: 'Order By Column',
|
||||||
name: 'order_by',
|
name: 'order_by',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getAllSortableColumns',
|
loadOptionsMethod: 'getAllSortableColumns',
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'A column\'s name or ID, use this column to sort the rows. 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 a Column using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
40
packages/nodes-base/nodes/SeaTable/v1/SeaTable.node.ts
Normal file
40
packages/nodes-base/nodes/SeaTable/v1/SeaTable.node.ts
Normal 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,
|
||||||
|
],
|
||||||
|
};
|
|
@ -25,7 +25,7 @@ import {
|
||||||
import type { TColumnsUiValues, TColumnValue } from './types';
|
import type { TColumnsUiValues, TColumnValue } from './types';
|
||||||
|
|
||||||
import type { ICtx, IRow, IRowObject } from './Interfaces';
|
import type { ICtx, IRow, IRowObject } from './Interfaces';
|
||||||
import { versionDescription } from './VersionDescription';
|
import { versionDescription } from './SeaTable.node';
|
||||||
|
|
||||||
export class SeaTableV1 implements INodeType {
|
export class SeaTableV1 implements INodeType {
|
||||||
description: INodeTypeDescription;
|
description: INodeTypeDescription;
|
||||||
|
|
|
@ -9,8 +9,8 @@ export type TSeaTableServerEdition = 'enterprise edition';
|
||||||
// dtable
|
// dtable
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|
||||||
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
|
|
||||||
import type { IDtableMetadataColumn, IDtableMetadataTable, TDtableViewColumn } from './Interfaces';
|
import type { IDtableMetadataColumn, IDtableMetadataTable, TDtableViewColumn } from './Interfaces';
|
||||||
|
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
|
||||||
|
|
||||||
export type TInheritColumnTypeTime = 'ctime' | 'mtime';
|
export type TInheritColumnTypeTime = 'ctime' | 'mtime';
|
||||||
export type TInheritColumnTypeUser = 'creator' | 'last-modifier';
|
export type TInheritColumnTypeUser = 'creator' | 'last-modifier';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import type {
|
||||||
INodeTypeBaseDescription,
|
INodeTypeBaseDescription,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
import { versionDescription } from './actions/versionDescription';
|
import { versionDescription } from './actions/SeaTable.node';
|
||||||
import { loadOptions } from './methods';
|
import { loadOptions } from './methods';
|
||||||
import { router } from './actions/router';
|
import { router } from './actions/router';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import type { AllEntities, Entity, PropertiesOf } from 'n8n-workflow';
|
||||||
type SeaTableMap = {
|
type SeaTableMap = {
|
||||||
row: 'create' | 'get' | 'search' | 'update' | 'remove' | 'lock' | 'unlock' | 'list';
|
row: 'create' | 'get' | 'search' | 'update' | 'remove' | 'lock' | 'unlock' | 'list';
|
||||||
base: 'snapshot' | 'metadata' | 'apiCall' | 'collaborator';
|
base: 'snapshot' | 'metadata' | 'apiCall' | 'collaborator';
|
||||||
link: 'add' | 'remove';
|
link: 'add' | 'list' | 'remove';
|
||||||
asset: 'upload' | 'getPublicURL';
|
asset: 'upload' | 'getPublicURL';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
import type { INodeTypeDescription } from 'n8n-workflow';
|
||||||
|
import * as row from './row';
|
||||||
|
import * as base from './base';
|
||||||
|
import * as link from './link';
|
||||||
|
import * as asset from './asset';
|
||||||
|
|
||||||
|
export const versionDescription: INodeTypeDescription = {
|
||||||
|
displayName: 'SeaTable',
|
||||||
|
name: 'seaTable',
|
||||||
|
icon: 'file:seatable.svg',
|
||||||
|
group: ['output'],
|
||||||
|
version: 2,
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Base',
|
||||||
|
value: 'base',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Link',
|
||||||
|
value: 'link',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Asset',
|
||||||
|
value: 'asset',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
default: 'row',
|
||||||
|
},
|
||||||
|
...row.descriptions,
|
||||||
|
...base.descriptions,
|
||||||
|
...link.descriptions,
|
||||||
|
...asset.descriptions,
|
||||||
|
],
|
||||||
|
};
|
|
@ -2,7 +2,7 @@ import type { AssetProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const assetGetPublicURLDescription: AssetProperties = [
|
export const assetGetPublicURLDescription: AssetProperties = [
|
||||||
{
|
{
|
||||||
displayName: 'Asset path',
|
displayName: 'Asset Path',
|
||||||
name: 'assetPath',
|
name: 'assetPath',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
placeholder: '/images/2023-09/logo.png',
|
placeholder: '/images/2023-09/logo.png',
|
||||||
|
@ -14,6 +14,5 @@ export const assetGetPublicURLDescription: AssetProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: '',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -26,7 +26,7 @@ export const descriptions: INodeProperties[] = [
|
||||||
name: 'Upload',
|
name: 'Upload',
|
||||||
value: 'upload',
|
value: 'upload',
|
||||||
description: 'Add a file/image to an existing row',
|
description: 'Add a file/image to an existing row',
|
||||||
action: 'Upload a file/image',
|
action: 'Upload a file or image',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'upload',
|
default: 'upload',
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { AssetProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const assetUploadDescription: AssetProperties = [
|
export const assetUploadDescription: AssetProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,11 +18,13 @@ export const assetUploadDescription: AssetProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Column',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Column Name',
|
||||||
name: 'uploadColumn',
|
name: 'uploadColumn',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -36,12 +39,17 @@ export const assetUploadDescription: AssetProperties = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Select the column for the upload.',
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Select the column for the upload. Choose from the list, or specify the name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Row ID',
|
displayName: 'Row ID',
|
||||||
name: 'rowId',
|
name: 'rowId',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
description:
|
||||||
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
required: true,
|
required: true,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsDependsOn: ['tableName'],
|
loadOptionsDependsOn: ['tableName'],
|
||||||
|
@ -70,7 +78,7 @@ export const assetUploadDescription: AssetProperties = [
|
||||||
description: 'Name of the binary property which contains the data for the file to be written',
|
description: 'Name of the binary property which contains the data for the file to be written',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Replace existing file',
|
displayName: 'Replace Existing File',
|
||||||
name: 'replace',
|
name: 'replace',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
|
@ -81,10 +89,10 @@ export const assetUploadDescription: AssetProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description:
|
description:
|
||||||
'Replace existing asset with the same name. Otherwise a new version with another name (numeral in parentheses) will be uploaded.',
|
'Whether to replace the existing asset with the same name (true). Otherwise, a new version with a different name (numeral in parentheses) will be uploaded (false).',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Append to column',
|
displayName: 'Append to Column',
|
||||||
name: 'append',
|
name: 'append',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
|
@ -95,6 +103,6 @@ export const assetUploadDescription: AssetProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description:
|
description:
|
||||||
'Keep existing files/images in the column and append the new asset. Otherwise the existing files/images are remove from the column.',
|
'Whether to keep existing files/images in the column and append the new asset (true). Otherwise, the existing files/images are removed from the column (false).',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -30,7 +30,7 @@ export const baseApiCallDescription: BaseProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: 'POST',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Hint: The Authentication header is included automatically.',
|
displayName: 'Hint: The Authentication header is included automatically.',
|
||||||
|
@ -56,20 +56,17 @@ export const baseApiCallDescription: BaseProperties = [
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
placeholder: '/dtable-server/...',
|
placeholder: '/dtable-server/...',
|
||||||
description:
|
description: 'The URL has to start with /dtable-server/ or /dtable-db/. All possible requests can be found at the SeaTable API Reference at https://api.seatable.io Please be aware that only request from the section Base Operations that use an Base-Token for the authentication are allowed to use.',
|
||||||
'The URL has to start with /dtable-server/ or /dtable-db/. All possible requests can be found at the SeaTable API Reference at https://api.seatable.io \
|
|
||||||
Please be aware that only request from the section Base Operations that use an Base-Token for the authentication are allowed to use.',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Query String Parameters',
|
displayName: 'Query String Parameters',
|
||||||
name: 'apiParams',
|
name: 'apiParams',
|
||||||
type: 'fixedCollection',
|
type: 'fixedCollection',
|
||||||
default: '',
|
default: {},
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
multipleValues: true,
|
multipleValues: true,
|
||||||
},
|
},
|
||||||
description:
|
description: 'These params will be URL-encoded and appended to the URL when making the request',
|
||||||
'These params will be URL-encoded and appended to the URL when making the request.',
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'apiParamsValues',
|
name: 'apiParamsValues',
|
||||||
|
@ -115,11 +112,10 @@ export const baseApiCallDescription: BaseProperties = [
|
||||||
'Only valid JSON is accepted. n8n will pass anything you enter as raw input. For example, {"foo", "bar"} is perfectly valid. Of cause you can use variables from n8n inside your JSON.',
|
'Only valid JSON is accepted. n8n will pass anything you enter as raw input. For example, {"foo", "bar"} is perfectly valid. Of cause you can use variables from n8n inside your JSON.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Response object parameter name',
|
displayName: 'Response Object Parameter Name',
|
||||||
name: 'responseObjectName',
|
name: 'responseObjectName',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
placeholder: 'Leave it empty or use a value like "rows", "metadata", "views" etc.',
|
placeholder: 'Leave it empty or use a value like "rows", "metadata", "views" etc.',
|
||||||
required: false,
|
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: ['base'],
|
resource: ['base'],
|
||||||
|
|
|
@ -23,7 +23,7 @@ export const descriptions: INodeProperties[] = [
|
||||||
name: 'Snapshot',
|
name: 'Snapshot',
|
||||||
value: 'snapshot',
|
value: 'snapshot',
|
||||||
description: 'Create a snapshot of the base',
|
description: 'Create a snapshot of the base',
|
||||||
action: 'Create a Snapshot',
|
action: 'Create a snapshot',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Metadata',
|
name: 'Metadata',
|
||||||
|
@ -35,16 +35,16 @@ export const descriptions: INodeProperties[] = [
|
||||||
name: 'API Call',
|
name: 'API Call',
|
||||||
value: 'apiCall',
|
value: 'apiCall',
|
||||||
description: 'Perform an authorized API call (Base Operation)',
|
description: 'Perform an authorized API call (Base Operation)',
|
||||||
action: 'Make an API Call',
|
action: 'Make an api call',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Collaborator',
|
name: 'Collaborator',
|
||||||
value: 'collaborator',
|
value: 'collaborator',
|
||||||
description: 'Get this username from the email or name of a collaborator.',
|
description: 'Get this username from the email or name of a collaborator',
|
||||||
action: 'Get username from email or name',
|
action: 'Get username from email or name',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: '',
|
default: 'snapshot',
|
||||||
},
|
},
|
||||||
...snapshot.description,
|
...snapshot.description,
|
||||||
...metadata.description,
|
...metadata.description,
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { LinkProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const linkAddDescription: LinkProperties = [
|
export const linkAddDescription: LinkProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name (Source)',
|
displayName: 'Table Name (Source)',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,10 +18,13 @@ export const linkAddDescription: LinkProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'If you use an expression, provide it in the way "<table_name>:::<table_id>".',
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Choose from the list, of specify by using an expression. Provide it in the way "table_name:::table_id".',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Link column',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Link Column',
|
||||||
name: 'linkColumn',
|
name: 'linkColumn',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -35,11 +39,12 @@ export const linkAddDescription: LinkProperties = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'If you use an expression, provide it in the way "<column_name>:::<link_id>:::<other_table_id>".',
|
'Choose from the list of specify the Link Column by using an expression. You have to provide it in the way "column_name:::link_id:::other_table_id".',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Row ID from the source table',
|
displayName: 'Row ID From the Source Table',
|
||||||
name: 'linkColumnSourceId',
|
name: 'linkColumnSourceId',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -50,10 +55,10 @@ export const linkAddDescription: LinkProperties = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Provide the row ID of table you selected.',
|
description: 'Provide the row ID of table you selected',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Row ID from the target',
|
displayName: 'Row ID From the Target',
|
||||||
name: 'linkColumnTargetId',
|
name: 'linkColumnTargetId',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -64,6 +69,6 @@ export const linkAddDescription: LinkProperties = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Provide the row ID of table you want to link.',
|
description: 'Provide the row ID of table you want to link',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import * as add from './add';
|
import * as add from './add';
|
||||||
|
import * as list from './list';
|
||||||
import * as remove from './remove';
|
import * as remove from './remove';
|
||||||
import type { INodeProperties } from 'n8n-workflow';
|
import type { INodeProperties } from 'n8n-workflow';
|
||||||
|
|
||||||
export { add, remove };
|
export { add, list, remove };
|
||||||
|
|
||||||
export const descriptions: INodeProperties[] = [
|
export const descriptions: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
|
@ -22,6 +23,12 @@ export const descriptions: INodeProperties[] = [
|
||||||
description: 'Create a link between two rows in a link column',
|
description: 'Create a link between two rows in a link column',
|
||||||
action: 'Add a row link',
|
action: 'Add a row link',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'List',
|
||||||
|
value: 'list',
|
||||||
|
description: 'List all links of a specific row',
|
||||||
|
action: 'List row links',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Remove',
|
name: 'Remove',
|
||||||
value: 'remove',
|
value: 'remove',
|
||||||
|
@ -32,5 +39,6 @@ export const descriptions: INodeProperties[] = [
|
||||||
default: 'add',
|
default: 'add',
|
||||||
},
|
},
|
||||||
...add.description,
|
...add.description,
|
||||||
|
...list.description,
|
||||||
...remove.description,
|
...remove.description,
|
||||||
];
|
];
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
import type { LinkProperties } from '../../Interfaces';
|
||||||
|
|
||||||
|
export const listLinkDescription: LinkProperties = [
|
||||||
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Table Name 32',
|
||||||
|
name: 'tableName',
|
||||||
|
type: 'options',
|
||||||
|
placeholder: 'Select a table',
|
||||||
|
required: true,
|
||||||
|
typeOptions: {
|
||||||
|
loadOptionsMethod: 'getTableNameAndId',
|
||||||
|
},
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: ['link'],
|
||||||
|
operation: ['list'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Choose from the list, of specify by using an expression. Provide it in the way "table_name:::table_id".',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Link Column',
|
||||||
|
name: 'linkColumn',
|
||||||
|
type: 'options',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: ['link'],
|
||||||
|
operation: ['list'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
typeOptions: {
|
||||||
|
loadOptionsDependsOn: ['tableName'],
|
||||||
|
loadOptionsMethod: 'getLinkColumnsWithColumnKey',
|
||||||
|
},
|
||||||
|
required: true,
|
||||||
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Choose from the list of specify the Link Column by using an expression. You have to provide it in the way "column_name:::link_id:::other_table_id:::column_key".',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Row ID',
|
||||||
|
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>',
|
||||||
|
required: true,
|
||||||
|
typeOptions: {
|
||||||
|
loadOptionsDependsOn: ['tableName'],
|
||||||
|
loadOptionsMethod: 'getRowIds',
|
||||||
|
},
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: ['link'],
|
||||||
|
operation: ['list'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
];
|
|
@ -0,0 +1,29 @@
|
||||||
|
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||||
|
import { seaTableApiRequest } from '../../../GenericFunctions';
|
||||||
|
|
||||||
|
export async function list(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]> {
|
||||||
|
// get parameters
|
||||||
|
const tableName = this.getNodeParameter('tableName', index) as string;
|
||||||
|
const linkColumn = this.getNodeParameter('linkColumn', index) as string;
|
||||||
|
const rowId = this.getNodeParameter('rowId', index) as string;
|
||||||
|
|
||||||
|
// get rows
|
||||||
|
let responseData = await seaTableApiRequest.call(
|
||||||
|
this,
|
||||||
|
{},
|
||||||
|
'POST',
|
||||||
|
'/dtable-db/api/v1/linked-records/{{dtable_uuid}}/',
|
||||||
|
{
|
||||||
|
table_id: tableName.split(':::')[1],
|
||||||
|
link_column: linkColumn.split(':::')[3],
|
||||||
|
rows: [
|
||||||
|
{
|
||||||
|
row_id: rowId,
|
||||||
|
offset: 0,
|
||||||
|
limit: 100,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return this.helpers.returnJsonArray(responseData[rowId] as IDataObject[]);
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
import { list as execute } from './execute';
|
||||||
|
import { listLinkDescription as description } from './description';
|
||||||
|
|
||||||
|
export { description, execute };
|
|
@ -2,6 +2,7 @@ import type { LinkProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const linkRemoveDescription: LinkProperties = [
|
export const linkRemoveDescription: LinkProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name (Source)',
|
displayName: 'Table Name (Source)',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,10 +18,13 @@ export const linkRemoveDescription: LinkProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'If you use an expression, provide it in the way "<table_name>:::<table_id>".',
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Choose from the list, of specify by using an expression. Provide it in the way "table_name:::table_id".',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Link column',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Link Column',
|
||||||
name: 'linkColumn',
|
name: 'linkColumn',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -35,10 +39,12 @@ export const linkRemoveDescription: LinkProperties = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
description: 'If you use an expression, provide it in the way "<column_name>:::<link_id>:::<other_table_id>".',
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Choose from the list of specify the Link Column by using an expression. You have to provide it in the way "column_name:::link_id:::other_table_id".',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Row ID from the source table',
|
displayName: 'Row ID From the Source Table',
|
||||||
name: 'linkColumnSourceId',
|
name: 'linkColumnSourceId',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -49,10 +55,10 @@ export const linkRemoveDescription: LinkProperties = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Provide the row ID of table you selected.',
|
description: 'Provide the row ID of table you selected',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Row ID from the target',
|
displayName: 'Row ID From the Target Table',
|
||||||
name: 'linkColumnTargetId',
|
name: 'linkColumnTargetId',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -63,6 +69,6 @@ export const linkRemoveDescription: LinkProperties = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Provide the row ID of table you want to link.',
|
description: 'Provide the row ID of table you want to link',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { RowProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const rowCreateDescription: RowProperties = [
|
export const rowCreateDescription: RowProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,6 +18,7 @@ export const rowCreateDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
|
@ -76,9 +78,11 @@ export const rowCreateDescription: RowProperties = [
|
||||||
name: 'columnValues',
|
name: 'columnValues',
|
||||||
values: [
|
values: [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Column Name',
|
displayName: 'Column Name',
|
||||||
name: 'columnName',
|
name: 'columnName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'Choose from the list, or specify the column name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
'Choose from the list, or specify the column name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
|
@ -105,10 +109,10 @@ export const rowCreateDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
default: {},
|
default: {},
|
||||||
description:
|
description:
|
||||||
'Add destination column with its value. Provide the value in this way:<br>Date: YYYY-MM-DD or YYYY-MM-DD hh:mm<br>Duration: time in seconds<br>Checkbox: true, on or 1<br>Multi-Select: comma separated list',
|
'Add destination column with its value. Provide the value in this way. Date: YYYY-MM-DD or YYYY-MM-DD hh:mm. Duration: time in seconds. Checkbox: true, on or 1. Multi-Select: comma-separated list.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Save to "Big Data" backend',
|
displayName: 'Save to "Big Data" Backend',
|
||||||
name: 'bigdata',
|
name: 'bigdata',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -118,7 +122,8 @@ export const rowCreateDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: false,
|
default: false,
|
||||||
description: 'This requires the activation of the Big Data backend in the base.',
|
description:
|
||||||
|
'Whether write to Big Data backend (true) or not (false). True requires the activation of the Big Data backend in the base.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Hint: Link, files, images or digital signatures have to be added separately.',
|
displayName: 'Hint: Link, files, images or digital signatures have to be added separately.',
|
||||||
|
|
|
@ -64,7 +64,6 @@ export async function create(
|
||||||
// save to normal backend
|
// save to normal backend
|
||||||
else {
|
else {
|
||||||
body.row = rowInput;
|
body.row = rowInput;
|
||||||
|
|
||||||
const responseData = await seaTableApiRequest.call(
|
const responseData = await seaTableApiRequest.call(
|
||||||
this,
|
this,
|
||||||
{},
|
{},
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { RowProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const rowGetDescription: RowProperties = [
|
export const rowGetDescription: RowProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,13 +18,17 @@ export const rowGetDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Row ID',
|
displayName: 'Row ID',
|
||||||
name: 'rowId',
|
name: 'rowId',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
description:
|
||||||
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
required: true,
|
required: true,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsDependsOn: ['tableName'],
|
loadOptionsDependsOn: ['tableName'],
|
||||||
|
@ -38,7 +43,7 @@ export const rowGetDescription: RowProperties = [
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Simplify output',
|
displayName: 'Simplify',
|
||||||
name: 'simple',
|
name: 'simple',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -48,7 +53,6 @@ export const rowGetDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: true,
|
default: true,
|
||||||
description:
|
description: 'Whether to return a simplified version of the response instead of the raw data',
|
||||||
'Simplified returns only the columns of your base. Non-simplified will return additional columns like _ctime (=creation time), _mtime (=modification time) etc.',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -28,6 +28,12 @@ export const descriptions: INodeProperties[] = [
|
||||||
description: 'Create a new row',
|
description: 'Create a new row',
|
||||||
action: 'Create a row',
|
action: 'Create a row',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Delete',
|
||||||
|
value: 'remove',
|
||||||
|
description: 'Delete a row',
|
||||||
|
action: 'Delete a row',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Get',
|
name: 'Get',
|
||||||
value: 'get',
|
value: 'get',
|
||||||
|
@ -37,39 +43,33 @@ export const descriptions: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
name: 'Get Many',
|
name: 'Get Many',
|
||||||
value: 'list',
|
value: 'list',
|
||||||
description: 'Get many rows from a table of view',
|
description: 'Get many rows from a table or a table view',
|
||||||
action: 'Get many rows',
|
action: 'Get many rows',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Lock',
|
||||||
|
value: 'lock',
|
||||||
|
description: 'Lock a row to prevent further changes',
|
||||||
|
action: 'Add a row lock',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Search',
|
name: 'Search',
|
||||||
value: 'search',
|
value: 'search',
|
||||||
description: 'Search one or multiple rows',
|
description: 'Search one or multiple rows',
|
||||||
action: 'Search a row by keyword',
|
action: 'Search a row by keyword',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Update',
|
|
||||||
value: 'update',
|
|
||||||
description: 'Update the content of a row',
|
|
||||||
action: 'Update a row',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Delete',
|
|
||||||
value: 'remove',
|
|
||||||
description: 'Delete a row',
|
|
||||||
action: 'Delete a row',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Lock',
|
|
||||||
value: 'lock',
|
|
||||||
description: 'Lock a row to prevent further changes.',
|
|
||||||
action: 'Add a row lock',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'Unlock',
|
name: 'Unlock',
|
||||||
value: 'unlock',
|
value: 'unlock',
|
||||||
description: 'Remove the lock from a row',
|
description: 'Remove the lock from a row',
|
||||||
action: 'Remove a row lock',
|
action: 'Remove a row lock',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Update',
|
||||||
|
value: 'update',
|
||||||
|
description: 'Update the content of a row',
|
||||||
|
action: 'Update a row',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'create',
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,13 +2,14 @@ import type { RowProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const rowListDescription: RowProperties = [
|
export const rowListDescription: RowProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
placeholder: 'Select a table',
|
placeholder: 'Select a table',
|
||||||
required: true,
|
required: true,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getTableNames',
|
loadOptionsMethod: 'getTableNameAndId',
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
@ -17,14 +18,15 @@ export const rowListDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'Choose from the list, or specify by using an expression. Provide it in the way "table_name:::table_id".',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'View Name or ID (optional)',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'View Name',
|
||||||
name: 'viewName',
|
name: 'viewName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
required: false,
|
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: ['row'],
|
resource: ['row'],
|
||||||
|
@ -36,10 +38,12 @@ export const rowListDescription: RowProperties = [
|
||||||
loadOptionsMethod: 'getTableViews',
|
loadOptionsMethod: 'getTableViews',
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The name of SeaTable view to access. Choose from the list, or specify ...',
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'The name of SeaTable view to access, or specify by using an expression. Provide it in the way "col.name:::col.type".',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Simplify output',
|
displayName: 'Simplify',
|
||||||
name: 'simple',
|
name: 'simple',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -49,7 +53,6 @@ export const rowListDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: true,
|
default: true,
|
||||||
description:
|
description: 'Whether to return a simplified version of the response instead of the raw data',
|
||||||
'Simplified returns only the columns of your base. Non-simplified will return additional columns like _ctime (=creation time), _mtime (=modification time) etc.',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { RowProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const rowLockDescription: RowProperties = [
|
export const rowLockDescription: RowProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,13 +18,18 @@ export const rowLockDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Row ID',
|
displayName: 'Row ID',
|
||||||
name: 'rowId',
|
name: 'rowId',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
required: true,
|
required: true,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsDependsOn: ['tableName'],
|
loadOptionsDependsOn: ['tableName'],
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { RowProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const rowRemoveDescription: RowProperties = [
|
export const rowRemoveDescription: RowProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,10 +18,12 @@ export const rowRemoveDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Row ID',
|
displayName: 'Row ID',
|
||||||
name: 'rowId',
|
name: 'rowId',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -36,6 +39,8 @@ export const rowRemoveDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Remove any row from the normal or big data backend based on its unique row ID.',
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Remove any row from the normal or big data backend based on its unique row ID. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { RowProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const rowSearchDescription: RowProperties = [
|
export const rowSearchDescription: RowProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,11 +18,13 @@ export const rowSearchDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Column',
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
|
displayName: 'Column Name',
|
||||||
name: 'searchColumn',
|
name: 'searchColumn',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -36,10 +39,12 @@ export const rowSearchDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Select the column to be searched. Not all column types are supported for search.',
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Select the column to be searched. Not all column types are supported for search. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Search term',
|
displayName: 'Search Term',
|
||||||
name: 'searchTerm',
|
name: 'searchTerm',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -64,10 +69,10 @@ export const rowSearchDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
default: false,
|
default: false,
|
||||||
description:
|
description:
|
||||||
'FALSE: The search distinguish between uppercase and lowercase characters. TRUE: Search ignores case sensitivity.',
|
'Whether the search ignores case sensitivity (true). Otherwise, it distinguishes between uppercase and lowercase characters.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Activate wildcard search',
|
displayName: 'Activate Wildcard Search',
|
||||||
name: 'wildcard',
|
name: 'wildcard',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -78,10 +83,10 @@ export const rowSearchDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
default: false,
|
default: false,
|
||||||
description:
|
description:
|
||||||
'FALSE: The search only results perfect matches. TRUE: Finds a row even if the search value is part of a string.',
|
'Whether the search only results perfect matches (true). Otherwise, it finds a row even if the search value is part of a string (false).',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Simplify output',
|
displayName: 'Simplify',
|
||||||
name: 'simple',
|
name: 'simple',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
|
@ -91,7 +96,6 @@ export const rowSearchDescription: RowProperties = [
|
||||||
operation: ['search'],
|
operation: ['search'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description:
|
description: 'Whether to return a simplified version of the response instead of the raw data',
|
||||||
'Simplified returns only the columns of your base. Non-simplified will return additional columns like _ctime (=creation time), _mtime (=modification time) etc.',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -13,7 +13,8 @@ export async function search(
|
||||||
): Promise<INodeExecutionData[]> {
|
): Promise<INodeExecutionData[]> {
|
||||||
const tableName = this.getNodeParameter('tableName', index) as string;
|
const tableName = this.getNodeParameter('tableName', index) as string;
|
||||||
const searchColumn = this.getNodeParameter('searchColumn', index) as string;
|
const searchColumn = this.getNodeParameter('searchColumn', index) as string;
|
||||||
let searchTerm = this.getNodeParameter('searchTerm', index) as any; // string or integer
|
const searchTerm = this.getNodeParameter('searchTerm', index) as string | number;
|
||||||
|
let searchTermString = String(searchTerm) as string;
|
||||||
const insensitive = this.getNodeParameter('insensitive', index) as boolean;
|
const insensitive = this.getNodeParameter('insensitive', index) as boolean;
|
||||||
const wildcard = this.getNodeParameter('wildcard', index) as boolean;
|
const wildcard = this.getNodeParameter('wildcard', index) as boolean;
|
||||||
const simple = this.getNodeParameter('simple', index) as boolean;
|
const simple = this.getNodeParameter('simple', index) as boolean;
|
||||||
|
@ -25,14 +26,12 @@ export async function search(
|
||||||
let sqlQuery = `SELECT * FROM \`${tableName}\` WHERE \`${searchColumn}\``;
|
let sqlQuery = `SELECT * FROM \`${tableName}\` WHERE \`${searchColumn}\``;
|
||||||
|
|
||||||
if (insensitive) {
|
if (insensitive) {
|
||||||
searchTerm = searchTerm.toLowerCase();
|
searchTermString = searchTermString.toLowerCase();
|
||||||
sqlQuery = `SELECT * FROM \`${tableName}\` WHERE lower(\`${searchColumn}\`)`;
|
sqlQuery = `SELECT * FROM \`${tableName}\` WHERE lower(\`${searchColumn}\`)`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wildcard && isNaN(searchTerm)) sqlQuery = sqlQuery + ' LIKE "%' + searchTerm + '%"';
|
if (wildcard) sqlQuery = sqlQuery + ' LIKE "%' + searchTermString + '%"';
|
||||||
else if (!wildcard && isNaN(searchTerm)) sqlQuery = sqlQuery + ' = "' + searchTerm + '"';
|
else if (!wildcard) sqlQuery = sqlQuery + ' = "' + searchTermString + '"';
|
||||||
else if (wildcard && !isNaN(searchTerm)) sqlQuery = sqlQuery + ' LIKE %' + searchTerm + '%';
|
|
||||||
else if (!wildcard && !isNaN(searchTerm)) sqlQuery = sqlQuery + ' = ' + searchTerm;
|
|
||||||
|
|
||||||
const sqlResult = (await seaTableApiRequest.call(
|
const sqlResult = (await seaTableApiRequest.call(
|
||||||
this,
|
this,
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { RowProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const rowUnlockDescription: RowProperties = [
|
export const rowUnlockDescription: RowProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,13 +18,17 @@ export const rowUnlockDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Row ID',
|
displayName: 'Row ID',
|
||||||
name: 'rowId',
|
name: 'rowId',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
description:
|
||||||
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
required: true,
|
required: true,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsDependsOn: ['tableName'],
|
loadOptionsDependsOn: ['tableName'],
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { RowProperties } from '../../Interfaces';
|
||||||
|
|
||||||
export const rowUpdateDescription: RowProperties = [
|
export const rowUpdateDescription: RowProperties = [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Table Name',
|
displayName: 'Table Name',
|
||||||
name: 'tableName',
|
name: 'tableName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
@ -17,13 +18,18 @@ export const rowUpdateDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
'The name of SeaTable table to access. Choose from the list, or specify a name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Row ID',
|
displayName: 'Row ID',
|
||||||
name: 'rowId',
|
name: 'rowId',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
|
description:
|
||||||
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
required: true,
|
required: true,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsDependsOn: ['tableName'],
|
loadOptionsDependsOn: ['tableName'],
|
||||||
|
@ -93,9 +99,11 @@ export const rowUpdateDescription: RowProperties = [
|
||||||
name: 'columnValues',
|
name: 'columnValues',
|
||||||
values: [
|
values: [
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||||
displayName: 'Column Name',
|
displayName: 'Column Name',
|
||||||
name: 'columnName',
|
name: 'columnName',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options
|
||||||
description:
|
description:
|
||||||
'Choose from the list, or specify the column name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
'Choose from the list, or specify the column name using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
|
@ -122,7 +130,7 @@ export const rowUpdateDescription: RowProperties = [
|
||||||
},
|
},
|
||||||
default: {},
|
default: {},
|
||||||
description:
|
description:
|
||||||
'Add destination column with its value. Provide the value in this way:<br>Date: YYYY-MM-DD or YYYY-MM-DD hh:mm<br>Duration: time in seconds<br>Checkbox: true, on or 1<br>Multi-Select: comma separated list',
|
'Add destination column with its value. Provide the value in this way:Date: YYYY-MM-DD or YYYY-MM-DD hh:mmDuration: time in secondsCheckbox: true, on or 1Multi-Select: comma-separated list.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Hint: Link, files, images or digital signatures have to be added separately.',
|
displayName: 'Hint: Link, files, images or digital signatures have to be added separately.',
|
||||||
|
|
|
@ -110,6 +110,40 @@ export async function getLinkColumns(this: ILoadOptionsFunctions): Promise<INode
|
||||||
return returnData;
|
return returnData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getLinkColumnsWithColumnKey(
|
||||||
|
this: ILoadOptionsFunctions,
|
||||||
|
): Promise<INodePropertyOptions[]> {
|
||||||
|
const returnData: INodePropertyOptions[] = [];
|
||||||
|
const table = this.getCurrentNodeParameter('tableName') as string;
|
||||||
|
|
||||||
|
const tableName = table.split(':::')[0];
|
||||||
|
const tableId = table.split(':::')[1];
|
||||||
|
|
||||||
|
if (tableName) {
|
||||||
|
const columns = await seaTableApiRequest.call(
|
||||||
|
this,
|
||||||
|
{},
|
||||||
|
'GET',
|
||||||
|
'/dtable-server/api/v1/dtables/{{dtable_uuid}}/columns',
|
||||||
|
{},
|
||||||
|
{ table_name: tableName },
|
||||||
|
);
|
||||||
|
for (const col of columns.columns) {
|
||||||
|
if (col.type === 'link') {
|
||||||
|
// make sure that the "other table id" is returned and not the same table id again.
|
||||||
|
const otid =
|
||||||
|
tableId !== col.data.other_table_id ? col.data.other_table_id : col.data.table_id;
|
||||||
|
|
||||||
|
returnData.push({
|
||||||
|
name: col.name,
|
||||||
|
value: col.name + ':::' + col.data.link_id + ':::' + otid + ':::' + col.key,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnData;
|
||||||
|
}
|
||||||
|
|
||||||
export async function getAssetColumns(
|
export async function getAssetColumns(
|
||||||
this: ILoadOptionsFunctions,
|
this: ILoadOptionsFunctions,
|
||||||
): Promise<INodePropertyOptions[]> {
|
): Promise<INodePropertyOptions[]> {
|
||||||
|
@ -179,9 +213,14 @@ export async function getTableUpdateAbleColumns(
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getRowIds(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
export async function getRowIds(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const tableName = this.getNodeParameter('tableName') as string;
|
const table = this.getCurrentNodeParameter('tableName') as string;
|
||||||
const returnData: INodePropertyOptions[] = [];
|
let tableName = table;
|
||||||
|
|
||||||
|
if (table.indexOf(':::') !== -1) {
|
||||||
|
tableName = table.split(':::')[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
const returnData: INodePropertyOptions[] = [];
|
||||||
if (tableName) {
|
if (tableName) {
|
||||||
const sqlResult = await seaTableApiRequest.call(
|
const sqlResult = await seaTableApiRequest.call(
|
||||||
this,
|
this,
|
||||||
|
|
Loading…
Reference in a new issue