mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
ce066a160f
* introduce analytics * add user survey backend * add user survey backend * set answers on survey submit Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * change name to personalization * lint Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * N8n 2495 add personalization modal (#2280) * update modals * add onboarding modal * implement questions * introduce analytics * simplify impl * implement survey handling * add personalized cateogry * update modal behavior * add thank you view * handle empty cases * rename modal * standarize modal names * update image, add tags to headings * remove unused file * remove unused interfaces * clean up footer spacing * introduce analytics * refactor to fix bug * update endpoint * set min height * update stories * update naming from questions to survey * remove spacing after core categories * fix bug in logic * sort nodes * rename types * merge with be * rename userSurvey * clean up rest api * use constants for keys * use survey keys * clean up types * move personalization to its own file Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> * update parameter inputs to be multiline * update spacing * Survey new options (#2300) * split up options * fix quotes * remove unused import * refactor node credentials * add user created workflow event (#2301) * update multi params * simplify env vars * fix versionCli on FE * update personalization env * clean up node detail settings * fix event User opened Credentials panel * fix font sizes across modals * clean up input spacing * fix select modal spacing * increase spacing * fix input copy * fix webhook, tab spacing, retry button * fix button sizes * fix button size * add mini xlarge sizes * fix webhook spacing * fix nodes panel event * fix workflow id in workflow execute event * improve telemetry error logging * fix config and stop process events * add flush call on n8n stop * ready for release * fix input error highlighting * revert change * update toggle spacing * fix delete positioning * keep tooltip while focused * set strict size * increase left spacing * fix sort icons * remove unnessasry <br/> * remove unnessary break * remove unnessary margin * clean unused functionality * remove unnessary css * remove duplicate tracking * only show tooltip when hovering over label * remove extra space * add br * remove extra space * clean up commas * clean up commas * remove extra space * remove extra space * rewrite desc * add commas * add space * remove extra space * add space * add dot * update credentials section * use includes Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
765 lines
14 KiB
TypeScript
765 lines
14 KiB
TypeScript
import { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const tableOperations = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create Row',
|
|
value: 'createRow',
|
|
description: 'Create/Insert a row',
|
|
},
|
|
{
|
|
name: 'Delete Row',
|
|
value: 'deleteRow',
|
|
description: 'Delete one or multiple rows',
|
|
},
|
|
{
|
|
name: 'Get All Columns',
|
|
value: 'getAllColumns',
|
|
description: 'Get all columns',
|
|
},
|
|
{
|
|
name: 'Get All Rows',
|
|
value: 'getAllRows',
|
|
description: 'Get all the rows',
|
|
},
|
|
{
|
|
name: 'Get Column',
|
|
value: 'getColumn',
|
|
description: 'Get a column',
|
|
},
|
|
{
|
|
name: 'Get Row',
|
|
value: 'getRow',
|
|
description: 'Get a row',
|
|
},
|
|
{
|
|
name: 'Push Button',
|
|
value: 'pushButton',
|
|
description: 'Pushes a button',
|
|
},
|
|
],
|
|
default: 'createRow',
|
|
description: 'The operation to perform.',
|
|
},
|
|
] as INodeProperties[];
|
|
|
|
export const tableFields = [
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* table:createRow */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Doc',
|
|
name: 'docId',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDocs',
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'createRow',
|
|
],
|
|
},
|
|
},
|
|
description: 'ID of the doc.',
|
|
},
|
|
{
|
|
displayName: 'Table',
|
|
name: 'tableId',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsDependsOn: [
|
|
'docId',
|
|
],
|
|
loadOptionsMethod: 'getTables',
|
|
},
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'createRow',
|
|
],
|
|
},
|
|
},
|
|
description: 'The table to create the row in.',
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'options',
|
|
type: 'collection',
|
|
placeholder: 'Add Option',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'createRow',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Disable Parsing',
|
|
name: 'disableParsing',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: `If true, the API will not attempt to parse the data in any way.`,
|
|
},
|
|
{
|
|
displayName: 'Key Columns',
|
|
name: 'keyColumns',
|
|
type: 'string',
|
|
default: '',
|
|
description: `Optional column IDs, URLs, or names (fragile and discouraged),
|
|
specifying columns to be used as upsert keys. If more than one separate by a comma (,)`,
|
|
},
|
|
],
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* table:get */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Doc',
|
|
name: 'docId',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDocs',
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getRow',
|
|
],
|
|
},
|
|
},
|
|
description: 'ID of the doc.',
|
|
},
|
|
{
|
|
displayName: 'Table',
|
|
name: 'tableId',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsDependsOn: [
|
|
'docId',
|
|
],
|
|
loadOptionsMethod: 'getTables',
|
|
},
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getRow',
|
|
],
|
|
},
|
|
},
|
|
description: 'The table to get the row from.',
|
|
},
|
|
{
|
|
displayName: 'Row ID',
|
|
name: 'rowId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getRow',
|
|
],
|
|
},
|
|
},
|
|
description: `ID or name of the row. Names are discouraged because
|
|
they're easily prone to being changed by users. If you're
|
|
using a name, be sure to URI-encode it. If there are
|
|
multiple rows with the same value in the identifying column,
|
|
an arbitrary one will be selected`,
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'options',
|
|
type: 'collection',
|
|
placeholder: 'Add Option',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getRow',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'RAW Data',
|
|
name: 'rawData',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: `Returns the data exactly in the way it got received from the API.`,
|
|
},
|
|
{
|
|
displayName: 'Use Column Names',
|
|
name: 'useColumnNames',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: `Use column names instead of column IDs in the returned output.</br>
|
|
This is generally discouraged as it is fragile. If columns are renamed,</br>
|
|
code using original names may throw errors.`,
|
|
},
|
|
{
|
|
displayName: 'ValueFormat',
|
|
name: 'valueFormat',
|
|
type: 'options',
|
|
default: '',
|
|
options: [
|
|
{
|
|
name: 'Simple',
|
|
value: 'simple',
|
|
},
|
|
{
|
|
name: 'Simple With Arrays',
|
|
value: 'simpleWithArrays',
|
|
},
|
|
{
|
|
name: 'Rich',
|
|
value: 'rich',
|
|
},
|
|
],
|
|
description: `The format that cell values are returned as.`,
|
|
},
|
|
],
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* table:getAll */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Doc',
|
|
name: 'docId',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDocs',
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllRows',
|
|
],
|
|
},
|
|
},
|
|
description: 'ID of the doc.',
|
|
},
|
|
{
|
|
displayName: 'Table',
|
|
name: 'tableId',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsDependsOn: [
|
|
'docId',
|
|
],
|
|
loadOptionsMethod: 'getTables',
|
|
},
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllRows',
|
|
],
|
|
},
|
|
},
|
|
description: 'The table to get the rows from.',
|
|
},
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllRows',
|
|
],
|
|
},
|
|
},
|
|
default: false,
|
|
description: 'If all results should be returned or only up to a given limit.',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllRows',
|
|
],
|
|
returnAll: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 100,
|
|
},
|
|
default: 50,
|
|
description: 'How many results to return.',
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'options',
|
|
type: 'collection',
|
|
placeholder: 'Add Option',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllRows',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Query',
|
|
name: 'query',
|
|
type: 'string',
|
|
typeOptions: {
|
|
alwaysOpenEditWindow: true,
|
|
},
|
|
default: '',
|
|
description: `Query used to filter returned rows, specified as <column_id_or_name>:<value>. <br/>
|
|
If you'd like to use a column name instead of an ID, you must quote it (e.g., "My Column":123).<br/>
|
|
Also note that value is a JSON value; if you'd like to use a string, you must surround it in quotes (e.g., "groceries").`,
|
|
},
|
|
{
|
|
displayName: 'RAW Data',
|
|
name: 'rawData',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: `Returns the data exactly in the way it got received from the API.`,
|
|
},
|
|
{
|
|
displayName: 'Sort By',
|
|
name: 'sortBy',
|
|
type: 'options',
|
|
default: '',
|
|
options: [
|
|
{
|
|
name: 'Created At',
|
|
value: 'createdAt',
|
|
},
|
|
{
|
|
name: 'Natural',
|
|
value: 'natural',
|
|
},
|
|
],
|
|
description: `Specifies the sort order of the rows returned.<br />
|
|
If left unspecified, rows are returned by creation time ascending.`,
|
|
},
|
|
{
|
|
displayName: 'Use Column Names',
|
|
name: 'useColumnNames',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: `Use column names instead of column IDs in the returned output.</br>
|
|
This is generally discouraged as it is fragile. If columns
|
|
are renamed, code using original names may throw errors.`,
|
|
},
|
|
{
|
|
displayName: 'ValueFormat',
|
|
name: 'valueFormat',
|
|
type: 'options',
|
|
default: '',
|
|
options: [
|
|
{
|
|
name: 'Simple',
|
|
value: 'simple',
|
|
},
|
|
{
|
|
name: 'Simple With Arrays',
|
|
value: 'simpleWithArrays',
|
|
},
|
|
{
|
|
name: 'Rich',
|
|
value: 'rich',
|
|
},
|
|
],
|
|
description: `The format that cell values are returned as.`,
|
|
},
|
|
{
|
|
displayName: 'Visible Only',
|
|
name: 'visibleOnly',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: `If true, returns only visible rows and columns for the table.`,
|
|
},
|
|
],
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* row:delete */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Doc',
|
|
name: 'docId',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDocs',
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'deleteRow',
|
|
],
|
|
},
|
|
},
|
|
description: 'ID of the doc.',
|
|
},
|
|
{
|
|
displayName: 'Table',
|
|
name: 'tableId',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsDependsOn: [
|
|
'docId',
|
|
],
|
|
loadOptionsMethod: 'getTables',
|
|
},
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'deleteRow',
|
|
],
|
|
},
|
|
},
|
|
description: 'The table to delete the row in.',
|
|
},
|
|
{
|
|
displayName: 'Row ID',
|
|
name: 'rowId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'deleteRow',
|
|
],
|
|
},
|
|
},
|
|
description: 'Row IDs to delete.',
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* table:pushButton */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Doc',
|
|
name: 'docId',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDocs',
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'pushButton',
|
|
],
|
|
},
|
|
},
|
|
description: 'ID of the doc.',
|
|
},
|
|
{
|
|
displayName: 'Table',
|
|
name: 'tableId',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsDependsOn: [
|
|
'docId',
|
|
],
|
|
loadOptionsMethod: 'getTables',
|
|
},
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'pushButton',
|
|
],
|
|
},
|
|
},
|
|
description: 'The table to get the row from.',
|
|
},
|
|
{
|
|
displayName: 'Row ID',
|
|
name: 'rowId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'pushButton',
|
|
],
|
|
},
|
|
},
|
|
description: `ID or name of the row. Names are discouraged because
|
|
they're easily prone to being changed by users. If you're
|
|
using a name, be sure to URI-encode it. If there are multiple
|
|
rows with the same value in the identifying column, an arbitrary
|
|
one will be selected`,
|
|
},
|
|
{
|
|
displayName: 'Column',
|
|
name: 'columnId',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getColumns',
|
|
loadOptionsDependsOn: [
|
|
'docId',
|
|
'tableId',
|
|
],
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'pushButton',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* table:getColumn */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Doc',
|
|
name: 'docId',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDocs',
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getColumn',
|
|
],
|
|
},
|
|
},
|
|
description: 'ID of the doc.',
|
|
},
|
|
{
|
|
displayName: 'Table',
|
|
name: 'tableId',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsDependsOn: [
|
|
'docId',
|
|
],
|
|
loadOptionsMethod: 'getTables',
|
|
},
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getColumn',
|
|
],
|
|
},
|
|
},
|
|
description: 'The table to get the row from.',
|
|
},
|
|
{
|
|
displayName: 'Column ID',
|
|
name: 'columnId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getColumn',
|
|
],
|
|
},
|
|
},
|
|
description: 'The table to get the row from.',
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* table:getAllColumns */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Doc',
|
|
name: 'docId',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDocs',
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllColumns',
|
|
],
|
|
},
|
|
},
|
|
description: 'ID of the doc.',
|
|
},
|
|
{
|
|
displayName: 'Table',
|
|
name: 'tableId',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsDependsOn: [
|
|
'docId',
|
|
],
|
|
loadOptionsMethod: 'getTables',
|
|
},
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllColumns',
|
|
],
|
|
},
|
|
},
|
|
description: 'The table to get the row from.',
|
|
},
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllColumns',
|
|
],
|
|
},
|
|
},
|
|
default: false,
|
|
description: 'If all results should be returned or only up to a given limit.',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'table',
|
|
],
|
|
operation: [
|
|
'getAllColumns',
|
|
],
|
|
returnAll: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 100,
|
|
},
|
|
default: 50,
|
|
description: 'How many results to return.',
|
|
},
|
|
] as INodeProperties[];
|