2020-02-03 16:40:03 -08:00
import { INodeProperties } from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const viewOperations : INodeProperties [ ] = [
2020-02-03 16:40:03 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
} ,
} ,
options : [
2020-02-05 16:47:40 -08:00
{
name : 'Delete Row' ,
value : 'deleteViewRow' ,
description : 'Delete view row' ,
} ,
2020-02-03 16:40:03 -08:00
{
name : 'Get' ,
value : 'get' ,
description : 'Get a view' ,
} ,
{
name : 'Get All' ,
value : 'getAll' ,
description : 'Get all views' ,
} ,
{
name : 'Get Columns' ,
value : 'getAllViewColumns' ,
description : 'Get all views columns' ,
} ,
2020-02-05 16:47:40 -08:00
{
name : 'Get Rows' ,
value : 'getAllViewRows' ,
description : 'Get all views rows' ,
} ,
2020-02-03 16:40:03 -08:00
{
name : 'Update Row' ,
value : 'updateViewRow' ,
description : 'Update row' ,
} ,
{
name : 'Push Button' ,
value : 'pushViewButton' ,
description : 'Push view button' ,
} ,
] ,
default : 'get' ,
description : 'The operation to perform.' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-02-03 16:40:03 -08:00
2021-12-03 00:44:16 -08:00
export const viewFields : INodeProperties [ ] = [
2020-02-03 16:40:03 -08:00
/* -------------------------------------------------------------------------- */
/* view:get */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc' ,
name : 'docId' ,
type : 'options' ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getDocs' ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'get' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of the doc' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'View ID' ,
name : 'viewId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'get' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The view to get the row from' ,
2020-02-03 16:40:03 -08:00
} ,
/* -------------------------------------------------------------------------- */
/* view:getAll */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc' ,
name : 'docId' ,
type : 'options' ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getDocs' ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAll' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of the doc' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAll' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAll' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-02-03 16:40:03 -08:00
} ,
/* -------------------------------------------------------------------------- */
/* view:getAllViewRows */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc' ,
name : 'docId' ,
type : 'options' ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getDocs' ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewRows' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of the doc' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'View' ,
name : 'viewId' ,
type : 'options' ,
typeOptions : {
loadOptionsDependsOn : [
'docId' ,
] ,
loadOptionsMethod : 'getViews' ,
} ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewRows' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The table to get the rows from' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewRows' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewRows' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewRows' ,
] ,
} ,
} ,
options : [
{
displayName : 'Query' ,
name : 'query' ,
type : 'string' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Query used to filter returned rows, specified as <column_id_or_name>:<value>. If you\'d like to use a column name instead of an ID, you must quote it (e.g., "My Column":123). 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").' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Use Column Names' ,
name : 'useColumnNames' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Use column names instead of column IDs in the returned output. This is generally discouraged as it is fragile. If columns are renamed, code using original names may throw errors.' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'ValueFormat' ,
name : 'valueFormat' ,
type : 'options' ,
default : '' ,
options : [
{
name : 'Simple' ,
value : 'simple' ,
} ,
{
name : 'Simple With Arrays' ,
value : 'simpleWithArrays' ,
} ,
{
name : 'Rich' ,
value : 'rich' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The format that cell values are returned as' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'RAW Data' ,
name : 'rawData' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Returns the data exactly in the way it got received from the API' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Sort By' ,
name : 'sortBy' ,
type : 'options' ,
default : '' ,
options : [
{
name : 'Created At' ,
value : 'createdAt' ,
} ,
{
name : 'Natural' ,
value : 'natural' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'Specifies the sort order of the rows returned. If left unspecified, rows are returned by creation time ascending.' ,
2020-02-03 16:40:03 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
/* -------------------------------------------------------------------------- */
/* view:getAllViewColumns */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc' ,
name : 'docId' ,
type : 'options' ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getDocs' ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewColumns' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of the doc' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'View' ,
name : 'viewId' ,
type : 'options' ,
typeOptions : {
loadOptionsDependsOn : [
'docId' ,
] ,
loadOptionsMethod : 'getViews' ,
} ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewColumns' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The table to get the rows from' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewColumns' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'getAllViewColumns' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-02-03 16:40:03 -08:00
} ,
/* -------------------------------------------------------------------------- */
/* view:deleteViewRow */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc' ,
name : 'docId' ,
type : 'options' ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getDocs' ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'deleteViewRow' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of the doc' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'View' ,
name : 'viewId' ,
type : 'options' ,
required : true ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getViews' ,
loadOptionsDependsOn : [
'docId' ,
] ,
} ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'deleteViewRow' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The view to get the row from' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Row' ,
name : 'rowId' ,
type : 'options' ,
required : true ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getViewRows' ,
loadOptionsDependsOn : [
'viewId' ,
] ,
} ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'deleteViewRow' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The view to get the row from' ,
2020-02-03 16:40:03 -08:00
} ,
/* -------------------------------------------------------------------------- */
/* view:pushViewButton */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc' ,
name : 'docId' ,
type : 'options' ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getDocs' ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'pushViewButton' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of the doc' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'View' ,
name : 'viewId' ,
type : 'options' ,
required : true ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getViews' ,
loadOptionsDependsOn : [
'docId' ,
] ,
} ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'pushViewButton' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The view to get the row from' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Row' ,
name : 'rowId' ,
type : 'options' ,
required : true ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getViewRows' ,
loadOptionsDependsOn : [
'viewId' ,
] ,
} ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'pushViewButton' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The view to get the row from' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Column' ,
name : 'columnId' ,
type : 'options' ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getViewColumns' ,
loadOptionsDependsOn : [
'docId' ,
'viewId' ,
] ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'pushViewButton' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
} ,
/* -------------------------------------------------------------------------- */
/* view:updateViewRow */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc' ,
name : 'docId' ,
type : 'options' ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getDocs' ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'updateViewRow' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of the doc' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'View' ,
name : 'viewId' ,
type : 'options' ,
required : true ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getViews' ,
loadOptionsDependsOn : [
'docId' ,
] ,
} ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'updateViewRow' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The view to get the row from' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Row' ,
name : 'rowId' ,
type : 'options' ,
required : true ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getViewRows' ,
loadOptionsDependsOn : [
'viewId' ,
] ,
} ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'updateViewRow' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The view to get the row from' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Key Name' ,
name : 'keyName' ,
type : 'string' ,
required : true ,
default : 'columns' ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'updateViewRow' ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The view to get the row from' ,
2020-02-03 16:40:03 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
resource : [
'view' ,
] ,
operation : [
'updateViewRow' ,
] ,
} ,
} ,
options : [
{
displayName : 'Disable Parsing' ,
name : 'disableParsing' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'If true, the API will not attempt to parse the data in any way' ,
2020-02-03 16:40:03 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-03 16:40:03 -08:00
} ,
2021-12-03 00:44:16 -08:00
] ;