mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
c5a0c049ea
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
90 lines
2 KiB
TypeScript
90 lines
2 KiB
TypeScript
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
|
import type { INodeTypeDescription } from 'n8n-workflow';
|
|
|
|
import * as sheet from './sheet/Sheet.resource';
|
|
import * as spreadsheet from './spreadsheet/SpreadSheet.resource';
|
|
|
|
export const versionDescription: INodeTypeDescription = {
|
|
displayName: 'Google Sheets',
|
|
name: 'googleSheets',
|
|
icon: 'file:googleSheets.svg',
|
|
group: ['input', 'output'],
|
|
version: [3, 4, 4.1, 4.2, 4.3, 4.4],
|
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
description: 'Read, update and write data to Google Sheets',
|
|
defaults: {
|
|
name: 'Google Sheets',
|
|
},
|
|
inputs: ['main'],
|
|
outputs: ['main'],
|
|
hints: [
|
|
{
|
|
message:
|
|
"Use the 'Minimise API Calls' option for greater efficiency if your sheet is uniformly formatted without gaps between columns or rows",
|
|
displayCondition:
|
|
'={{$parameter["operation"] === "append" && !$parameter["options"]["useAppend"]}}',
|
|
whenToDisplay: 'beforeExecution',
|
|
location: 'outputPane',
|
|
},
|
|
],
|
|
credentials: [
|
|
{
|
|
name: 'googleApi',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
authentication: ['serviceAccount'],
|
|
},
|
|
},
|
|
testedBy: 'googleApiCredentialTest',
|
|
},
|
|
{
|
|
name: 'googleSheetsOAuth2Api',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
authentication: ['oAuth2'],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
properties: [
|
|
{
|
|
displayName: 'Authentication',
|
|
name: 'authentication',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
name: 'Service Account',
|
|
value: 'serviceAccount',
|
|
},
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
name: 'OAuth2 (recommended)',
|
|
value: 'oAuth2',
|
|
},
|
|
],
|
|
default: 'oAuth2',
|
|
},
|
|
{
|
|
displayName: 'Resource',
|
|
name: 'resource',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
options: [
|
|
{
|
|
name: 'Document',
|
|
value: 'spreadsheet',
|
|
},
|
|
{
|
|
name: 'Sheet Within Document',
|
|
value: 'sheet',
|
|
},
|
|
],
|
|
default: 'sheet',
|
|
},
|
|
...sheet.descriptions,
|
|
...spreadsheet.descriptions,
|
|
],
|
|
};
|