mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
275 lines
7.0 KiB
TypeScript
275 lines
7.0 KiB
TypeScript
import { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const dataLocationOnSheet: INodeProperties[] = [
|
|
{
|
|
displayName: 'Data Location on Sheet',
|
|
name: 'dataLocationOnSheet',
|
|
type: 'fixedCollection',
|
|
placeholder: 'Select Range',
|
|
default: { values: { rangeDefinition: 'detectAutomatically' } },
|
|
options: [
|
|
{
|
|
displayName: 'Values',
|
|
name: 'values',
|
|
values: [
|
|
{
|
|
displayName: 'Range Definition',
|
|
name: 'rangeDefinition',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
name: 'Detect Automatically',
|
|
value: 'detectAutomatically',
|
|
description: 'Automatically detect the data range',
|
|
},
|
|
{
|
|
name: 'Specify Range (A1 Notation)',
|
|
value: 'specifyRangeA1',
|
|
description: 'Manually specify the data range',
|
|
},
|
|
{
|
|
name: 'Specify Range (Rows)',
|
|
value: 'specifyRange',
|
|
description: 'Manually specify the data range',
|
|
},
|
|
],
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Read Rows Until',
|
|
name: 'readRowsUntil',
|
|
type: 'options',
|
|
default: 'lastRowInSheet',
|
|
options: [
|
|
{
|
|
name: 'First Empty Row',
|
|
value: 'firstEmptyRow',
|
|
},
|
|
{
|
|
name: 'Last Row In Sheet',
|
|
value: 'lastRowInSheet',
|
|
},
|
|
],
|
|
displayOptions: {
|
|
show: {
|
|
rangeDefinition: ['detectAutomatically'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Header Row',
|
|
name: 'headerRow',
|
|
type: 'number',
|
|
typeOptions: {
|
|
minValue: 1,
|
|
},
|
|
default: 1,
|
|
description:
|
|
'Index of the row which contains the keys. Starts at 1. The incoming node data is matched to the keys for assignment. The matching is case sensitive.',
|
|
hint: 'From start of range. First row is row 1',
|
|
displayOptions: {
|
|
show: {
|
|
rangeDefinition: ['specifyRange'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'First Data Row',
|
|
name: 'firstDataRow',
|
|
type: 'number',
|
|
typeOptions: {
|
|
minValue: 1,
|
|
},
|
|
default: 2,
|
|
description:
|
|
'Index of the first row which contains the actual data and not the keys. Starts with 1.',
|
|
hint: 'From start of range. First row is row 1',
|
|
displayOptions: {
|
|
show: {
|
|
rangeDefinition: ['specifyRange'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Range',
|
|
name: 'range',
|
|
type: 'string',
|
|
default: '',
|
|
placeholder: 'A:Z',
|
|
description:
|
|
'The table range to read from or to append data to. See the Google <a href="https://developers.google.com/sheets/api/guides/values#writing">documentation</a> for the details.',
|
|
hint: 'You can specify both the rows and the columns, e.g. C4:E7',
|
|
displayOptions: {
|
|
show: {
|
|
rangeDefinition: ['specifyRangeA1'],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
export const locationDefine: INodeProperties[] = [
|
|
{
|
|
displayName: 'Data Location on Sheet',
|
|
name: 'locationDefine',
|
|
type: 'fixedCollection',
|
|
placeholder: 'Select Range',
|
|
default: { values: {} },
|
|
options: [
|
|
{
|
|
displayName: 'Values',
|
|
name: 'values',
|
|
values: [
|
|
{
|
|
displayName: 'Header Row',
|
|
name: 'headerRow',
|
|
type: 'number',
|
|
typeOptions: {
|
|
minValue: 1,
|
|
},
|
|
default: 1,
|
|
description:
|
|
'Index of the row which contains the keys. Starts at 1. The incoming node data is matched to the keys for assignment. The matching is case sensitive.',
|
|
hint: 'From start of range. First row is row 1',
|
|
},
|
|
{
|
|
displayName: 'First Data Row',
|
|
name: 'firstDataRow',
|
|
type: 'number',
|
|
typeOptions: {
|
|
minValue: 1,
|
|
},
|
|
default: 2,
|
|
description:
|
|
'Index of the first row which contains the actual data and not the keys. Starts with 1.',
|
|
hint: 'From start of range. First row is row 1',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
export const outputFormatting: INodeProperties[] = [
|
|
{
|
|
displayName: 'Output Formatting',
|
|
name: 'outputFormatting',
|
|
type: 'fixedCollection',
|
|
placeholder: 'Add Formatting',
|
|
default: { values: { general: 'UNFORMATTED_VALUE', date: 'FORMATTED_STRING' } },
|
|
options: [
|
|
{
|
|
displayName: 'Values',
|
|
name: 'values',
|
|
values: [
|
|
{
|
|
displayName: 'General Formatting',
|
|
name: 'general',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
name: 'Values (unformatted)',
|
|
value: 'UNFORMATTED_VALUE',
|
|
description:
|
|
'Numbers stay as numbers, but any currency signs or special formatting is lost',
|
|
},
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
name: 'Values (formatted)',
|
|
value: 'FORMATTED_VALUE',
|
|
description:
|
|
'Numbers are turned to text, and displayed as in Google Sheets (e.g. with commas or currency signs)',
|
|
},
|
|
{
|
|
name: 'Formulas',
|
|
value: 'FORMULA',
|
|
},
|
|
],
|
|
default: '',
|
|
description: 'Determines how values should be rendered in the output',
|
|
},
|
|
{
|
|
displayName: 'Date Formatting',
|
|
name: 'date',
|
|
type: 'options',
|
|
default: '',
|
|
options: [
|
|
{
|
|
name: 'Formatted Text',
|
|
value: 'FORMATTED_STRING',
|
|
description: "As displayed in Google Sheets, e.g. '01/01/2022'",
|
|
},
|
|
{
|
|
name: 'Serial Number',
|
|
value: 'SERIAL_NUMBER',
|
|
description: 'A number representing the number of days since Dec 30, 1899',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
export const cellFormat: INodeProperties[] = [
|
|
{
|
|
displayName: 'Cell Format',
|
|
name: 'cellFormat',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
name: 'Let n8n format',
|
|
value: 'RAW',
|
|
description: 'Cells have the same types as the input data',
|
|
},
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
name: 'Let Google Sheets format',
|
|
value: 'USER_ENTERED',
|
|
description: 'Cells are styled as if you typed the values into Google Sheets directly',
|
|
},
|
|
],
|
|
default: 'RAW',
|
|
description: 'Determines how data should be interpreted',
|
|
},
|
|
];
|
|
|
|
export const handlingExtraData: INodeProperties[] = [
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
displayName: 'Handling extra fields in input',
|
|
name: 'handlingExtraData',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
name: 'Insert in New Column(s)',
|
|
value: 'insertInNewColumn',
|
|
description: 'Create a new column for extra data',
|
|
},
|
|
{
|
|
name: 'Ignore Them',
|
|
value: 'ignoreIt',
|
|
description: 'Ignore extra data',
|
|
},
|
|
{
|
|
name: 'Error',
|
|
value: 'error',
|
|
description: 'Throw an error',
|
|
},
|
|
],
|
|
displayOptions: {
|
|
show: {
|
|
'/dataMode': ['autoMapInputData'],
|
|
},
|
|
},
|
|
default: 'insertInNewColumn',
|
|
description: "What do to with fields that don't match any columns in the Google Sheet",
|
|
},
|
|
];
|