2021-05-20 14:31:23 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2022-05-06 14:01:25 -07:00
import {
2021-12-29 14:23:22 -08:00
getConditions ,
getSearchFilters ,
} from './GenericFunctions' ;
2021-05-20 14:31:23 -07:00
import {
blocks ,
text ,
} from './Blocks' ;
import {
filters ,
} from './Filters' ;
2022-07-04 02:12:08 -07:00
export const databasePageOperations : INodeProperties [ ] = [
2021-05-20 14:31:23 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-05-20 14:31:23 -07:00
displayOptions : {
show : {
2021-12-29 14:23:22 -08:00
version : [
2 ,
] ,
2021-05-20 14:31:23 -07:00
resource : [
'databasePage' ,
] ,
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a pages in a database' ,
2022-07-10 13:50:51 -07:00
action : 'Create a database page' ,
2021-05-20 14:31:23 -07:00
} ,
2021-12-29 14:23:22 -08:00
{
name : 'Get' ,
value : 'get' ,
description : 'Get a page in a database' ,
2022-07-10 13:50:51 -07:00
action : 'Get a database page' ,
2021-12-29 14:23:22 -08:00
} ,
2021-05-20 14:31:23 -07:00
{
name : 'Get All' ,
value : 'getAll' ,
description : 'Get all pages in a database' ,
2022-07-10 13:50:51 -07:00
action : 'Get all database pages' ,
2021-05-20 14:31:23 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update pages in a database' ,
2022-07-10 13:50:51 -07:00
action : 'Update a database page' ,
2021-05-20 14:31:23 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-29 14:23:22 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-12-29 14:23:22 -08:00
displayOptions : {
show : {
version : [
1 ,
] ,
resource : [
'databasePage' ,
] ,
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a pages in a database' ,
2022-07-10 13:50:51 -07:00
action : 'Create a database page' ,
2021-12-29 14:23:22 -08:00
} ,
{
name : 'Get All' ,
value : 'getAll' ,
description : 'Get all pages in a database' ,
2022-07-10 13:50:51 -07:00
action : 'Get all database pages' ,
2021-12-29 14:23:22 -08:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update pages in a database' ,
2022-07-10 13:50:51 -07:00
action : 'Update a database page' ,
2021-12-29 14:23:22 -08:00
} ,
] ,
default : 'create' ,
} ,
2022-07-04 02:12:08 -07:00
] ;
2021-05-20 14:31:23 -07:00
2021-12-29 14:23:22 -08:00
export const databasePageFields = [
2021-05-20 14:31:23 -07:00
/* -------------------------------------------------------------------------- */
2021-12-29 14:23:22 -08:00
/* databasePage:create */
2021-05-20 14:31:23 -07:00
/* -------------------------------------------------------------------------- */
{
2021-12-29 14:23:22 -08:00
displayName : 'Database Name or ID' ,
2021-05-20 14:31:23 -07:00
name : 'databaseId' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getDatabases' ,
} ,
required : true ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
2022-07-14 13:05:11 -07:00
description : 'The Database Page URL from Notion\'s \'copy link\' functionality (or just the ID contained within the URL). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-05-20 14:31:23 -07:00
} ,
{
2021-12-29 14:23:22 -08:00
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
default : '' ,
displayOptions : {
show : {
version : [
2 ,
] ,
resource : [
'databasePage' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
2022-04-22 09:29:51 -07:00
description : 'Page title. Appears at the top of the page and can be found via Quick Find.' ,
2021-12-29 14:23:22 -08:00
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Simplify' ,
2021-05-20 14:31:23 -07:00
name : 'simple' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
default : true ,
2021-12-29 14:23:22 -08:00
description : 'Whether to return a simplified version of the response instead of the raw data' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Properties' ,
name : 'propertiesUi' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
2022-04-22 09:29:51 -07:00
default : { } ,
2021-05-20 14:31:23 -07:00
placeholder : 'Add Property' ,
options : [
{
name : 'propertyValues' ,
displayName : 'Property' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Key Name or ID' ,
2021-05-20 14:31:23 -07:00
name : 'key' ,
type : 'options' ,
2022-07-14 13:05:11 -07:00
description : 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2021-05-20 14:31:23 -07:00
typeOptions : {
loadOptionsMethod : 'getDatabaseProperties' ,
loadOptionsDependsOn : [
'databaseId' ,
] ,
} ,
default : '' ,
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'hidden' ,
default : '={{$parameter["&key"].split("|")[1]}}' ,
} ,
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'title' ,
] ,
} ,
} ,
default : '' ,
} ,
{
displayName : 'Rich Text' ,
name : 'richText' ,
type : 'boolean' ,
displayOptions : {
show : {
type : [
'rich_text' ,
] ,
} ,
} ,
default : false ,
} ,
{
displayName : 'Text' ,
name : 'textContent' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'rich_text' ,
] ,
richText : [
false ,
] ,
} ,
} ,
default : '' ,
} ,
. . . text ( {
show : {
type : [
'rich_text' ,
] ,
richText : [
true ,
] ,
} ,
} ) ,
{
displayName : 'Phone Number' ,
name : 'phoneValue' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'phone_number' ,
] ,
} ,
} ,
default : '' ,
2022-04-22 09:29:51 -07:00
description : 'Phone number. No structure is enforced.' ,
2021-05-20 14:31:23 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Option Names or IDs' ,
2021-05-20 14:31:23 -07:00
name : 'multiSelectValue' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getPropertySelectValues' ,
} ,
displayOptions : {
show : {
type : [
'multi_select' ,
] ,
} ,
} ,
default : [ ] ,
2022-07-14 13:05:11 -07:00
description : 'Name of the options you want to set. Multiples can be defined separated by comma. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-05-20 14:31:23 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Option Name or ID' ,
2021-05-20 14:31:23 -07:00
name : 'selectValue' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getPropertySelectValues' ,
} ,
displayOptions : {
show : {
type : [
'select' ,
] ,
} ,
} ,
default : '' ,
2022-07-14 13:05:11 -07:00
description : 'Name of the option you want to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Email' ,
name : 'emailValue' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'email' ,
] ,
} ,
} ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'Email address' ,
2021-05-20 14:31:23 -07:00
} ,
2022-07-20 04:34:52 -07:00
{
displayName : 'Ignore If Empty' ,
name : 'ignoreIfEmpty' ,
type : 'boolean' ,
displayOptions : {
show : {
type : [
'url' ,
] ,
} ,
} ,
default : false ,
} ,
2021-05-20 14:31:23 -07:00
{
displayName : 'URL' ,
name : 'urlValue' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'url' ,
] ,
} ,
} ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'Web address' ,
2021-05-20 14:31:23 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'User Names or IDs' ,
2021-05-20 14:31:23 -07:00
name : 'peopleValue' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
displayOptions : {
show : {
type : [
'people' ,
] ,
} ,
} ,
default : [ ] ,
2022-07-14 13:05:11 -07:00
description : 'List of users. Multiples can be defined separated by comma. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Relation IDs' ,
name : 'relationValue' ,
type : 'string' ,
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
type : [
'relation' ,
] ,
} ,
} ,
default : [ ] ,
2022-04-22 09:29:51 -07:00
description : 'List of databases that belong to another database. Multiples can be defined separated by comma.' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Checked' ,
name : 'checkboxValue' ,
displayOptions : {
show : {
type : [
'checkbox' ,
] ,
} ,
} ,
type : 'boolean' ,
default : false ,
2021-11-25 09:10:06 -08:00
description : 'Whether or not the checkbox is checked. <code>true</code> represents checked. <code>false</code> represents unchecked.' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Number' ,
name : 'numberValue' ,
displayOptions : {
show : {
type : [
'number' ,
] ,
} ,
} ,
type : 'number' ,
default : 0 ,
2021-12-29 14:23:22 -08:00
description : 'Number value' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Range' ,
name : 'range' ,
displayOptions : {
show : {
type : [
'date' ,
] ,
} ,
} ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether or not you want to define a date range' ,
2021-05-20 14:31:23 -07:00
} ,
2021-06-12 09:06:47 -07:00
{
displayName : 'Include Time' ,
name : 'includeTime' ,
displayOptions : {
show : {
type : [
'date' ,
] ,
} ,
} ,
type : 'boolean' ,
default : true ,
2022-06-20 07:54:01 -07:00
description : 'Whether or not to include the time in the date' ,
2021-06-12 09:06:47 -07:00
} ,
2021-05-20 14:31:23 -07:00
{
displayName : 'Date' ,
name : 'date' ,
displayOptions : {
show : {
range : [
false ,
] ,
type : [
'date' ,
] ,
} ,
} ,
type : 'dateTime' ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'An ISO 8601 format date, with optional time' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Date Start' ,
name : 'dateStart' ,
displayOptions : {
show : {
range : [
true ,
] ,
type : [
'date' ,
] ,
} ,
} ,
type : 'dateTime' ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'An ISO 8601 format date, with optional time' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Date End' ,
name : 'dateEnd' ,
displayOptions : {
show : {
range : [
true ,
] ,
type : [
'date' ,
] ,
} ,
} ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'An ISO 8601 formatted date, with optional time. Represents the end of a date range.' ,
2021-05-20 14:31:23 -07:00
} ,
2021-08-13 11:57:18 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Timezone Name or ID' ,
2021-08-13 11:57:18 -07:00
name : 'timezone' ,
type : 'options' ,
displayOptions : {
show : {
type : [
'date' ,
] ,
} ,
} ,
typeOptions : {
loadOptionsMethod : 'getTimezones' ,
} ,
default : 'default' ,
2022-07-14 13:05:11 -07:00
description : 'Time zone to use. By default n8n timezone is used. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-12-29 14:23:22 -08:00
} ,
{
displayName : 'File URLs' ,
name : 'fileUrls' ,
placeholder : 'Add File' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
sortable : true ,
} ,
displayOptions : {
show : {
'/version' : [
2 ,
] ,
type : [
'files' ,
] ,
} ,
} ,
default : { } ,
options : [
{
name : 'fileUrl' ,
displayName : 'File' ,
values : [
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'File URL' ,
name : 'url' ,
type : 'string' ,
default : '' ,
description : 'Link to externally hosted file' ,
} ,
] ,
} ,
] ,
2021-08-13 11:57:18 -07:00
} ,
2021-05-20 14:31:23 -07:00
] ,
} ,
] ,
} ,
. . . blocks ( 'databasePage' , 'create' ) ,
/* -------------------------------------------------------------------------- */
2021-12-29 14:23:22 -08:00
/* databasePage:update */
2021-05-20 14:31:23 -07:00
/* -------------------------------------------------------------------------- */
{
2021-12-29 14:23:22 -08:00
displayName : 'Database Page Link or ID' ,
2021-05-20 14:31:23 -07:00
name : 'pageId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The Database Page URL from Notion\'s \'copy link\' functionality (or just the ID contained within the URL)' ,
2021-05-20 14:31:23 -07:00
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Simplify' ,
2021-05-20 14:31:23 -07:00
name : 'simple' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
default : true ,
2021-12-29 14:23:22 -08:00
description : 'Whether to return a simplified version of the response instead of the raw data' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Properties' ,
name : 'propertiesUi' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
2022-04-22 09:29:51 -07:00
default : { } ,
2021-05-20 14:31:23 -07:00
placeholder : 'Add Property' ,
options : [
{
name : 'propertyValues' ,
displayName : 'Property' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Key Name or ID' ,
2021-05-20 14:31:23 -07:00
name : 'key' ,
type : 'options' ,
2022-07-14 13:05:11 -07:00
description : 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2021-05-20 14:31:23 -07:00
typeOptions : {
loadOptionsMethod : 'getDatabaseIdFromPage' ,
loadOptionsDependsOn : [
'pageId' ,
] ,
} ,
default : '' ,
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'hidden' ,
default : '={{$parameter["&key"].split("|")[1]}}' ,
} ,
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'title' ,
] ,
} ,
} ,
default : '' ,
} ,
{
displayName : 'Rich Text' ,
name : 'richText' ,
type : 'boolean' ,
displayOptions : {
show : {
type : [
'rich_text' ,
] ,
} ,
} ,
default : false ,
} ,
{
displayName : 'Text' ,
name : 'textContent' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'rich_text' ,
] ,
richText : [
false ,
] ,
} ,
} ,
default : '' ,
} ,
. . . text ( {
show : {
type : [
'rich_text' ,
] ,
richText : [
true ,
] ,
} ,
} ) ,
{
displayName : 'Phone Number' ,
name : 'phoneValue' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'phone_number' ,
] ,
} ,
} ,
default : '' ,
2022-04-22 09:29:51 -07:00
description : 'Phone number. No structure is enforced.' ,
2021-05-20 14:31:23 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Option Names or IDs' ,
2021-05-20 14:31:23 -07:00
name : 'multiSelectValue' ,
type : 'multiOptions' ,
2022-07-14 13:05:11 -07:00
description : 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2021-05-20 14:31:23 -07:00
typeOptions : {
loadOptionsMethod : 'getDatabaseOptionsFromPage' ,
} ,
displayOptions : {
show : {
type : [
'multi_select' ,
] ,
} ,
} ,
default : [ ] ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Option Name or ID' ,
2021-05-20 14:31:23 -07:00
name : 'selectValue' ,
type : 'options' ,
2022-07-14 13:05:11 -07:00
description : 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2021-05-20 14:31:23 -07:00
typeOptions : {
loadOptionsMethod : 'getDatabaseOptionsFromPage' ,
} ,
displayOptions : {
show : {
type : [
'select' ,
] ,
} ,
} ,
default : '' ,
} ,
{
displayName : 'Email' ,
name : 'emailValue' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'email' ,
] ,
} ,
} ,
default : '' ,
} ,
2022-07-20 04:34:52 -07:00
{
displayName : 'Ignore If Empty' ,
name : 'ignoreIfEmpty' ,
type : 'boolean' ,
displayOptions : {
show : {
type : [
'url' ,
] ,
} ,
} ,
default : false ,
} ,
2021-05-20 14:31:23 -07:00
{
displayName : 'URL' ,
name : 'urlValue' ,
type : 'string' ,
displayOptions : {
show : {
type : [
'url' ,
] ,
} ,
} ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'Web address' ,
2021-05-20 14:31:23 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'User Names or IDs' ,
2021-05-20 14:31:23 -07:00
name : 'peopleValue' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
displayOptions : {
show : {
type : [
'people' ,
] ,
} ,
} ,
default : [ ] ,
2022-07-14 13:05:11 -07:00
description : 'List of users. Multiples can be defined separated by comma. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Relation IDs' ,
name : 'relationValue' ,
type : 'string' ,
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
type : [
'relation' ,
] ,
} ,
} ,
default : [ ] ,
2022-04-22 09:29:51 -07:00
description : 'List of databases that belong to another database. Multiples can be defined separated by comma.' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Checked' ,
name : 'checkboxValue' ,
displayOptions : {
show : {
type : [
'checkbox' ,
] ,
} ,
} ,
type : 'boolean' ,
default : false ,
2021-11-25 09:10:06 -08:00
description : 'Whether or not the checkbox is checked. <code>true</code> represents checked. <code>false</code> represents unchecked.' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Number' ,
name : 'numberValue' ,
displayOptions : {
show : {
type : [
'number' ,
] ,
} ,
} ,
type : 'number' ,
default : 0 ,
2021-12-29 14:23:22 -08:00
description : 'Number value' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Range' ,
name : 'range' ,
displayOptions : {
show : {
type : [
'date' ,
] ,
} ,
} ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether or not you want to define a date range' ,
2021-05-20 14:31:23 -07:00
} ,
2021-06-12 09:06:47 -07:00
{
displayName : 'Include Time' ,
name : 'includeTime' ,
displayOptions : {
show : {
type : [
'date' ,
] ,
} ,
} ,
type : 'boolean' ,
default : true ,
2022-06-20 07:54:01 -07:00
description : 'Whether or not to include the time in the date' ,
2021-06-12 09:06:47 -07:00
} ,
2021-05-20 14:31:23 -07:00
{
displayName : 'Date' ,
name : 'date' ,
displayOptions : {
show : {
range : [
false ,
] ,
type : [
'date' ,
] ,
} ,
} ,
type : 'dateTime' ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'An ISO 8601 format date, with optional time' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Date Start' ,
name : 'dateStart' ,
displayOptions : {
show : {
range : [
true ,
] ,
type : [
'date' ,
] ,
} ,
} ,
type : 'dateTime' ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'An ISO 8601 format date, with optional time' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Date End' ,
name : 'dateEnd' ,
displayOptions : {
show : {
range : [
true ,
] ,
type : [
'date' ,
] ,
} ,
} ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'An ISO 8601 formatted date, with optional time. Represents the end of a date range.' ,
2021-05-20 14:31:23 -07:00
} ,
2021-08-13 11:57:18 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Timezone Name or ID' ,
2021-08-13 11:57:18 -07:00
name : 'timezone' ,
type : 'options' ,
displayOptions : {
show : {
type : [
'date' ,
] ,
} ,
} ,
typeOptions : {
loadOptionsMethod : 'getTimezones' ,
} ,
default : 'default' ,
2022-07-14 13:05:11 -07:00
description : 'Time zone to use. By default n8n timezone is used. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-12-29 14:23:22 -08:00
} ,
{
displayName : 'File URLs' ,
name : 'fileUrls' ,
placeholder : 'Add File' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
sortable : true ,
} ,
displayOptions : {
show : {
'/version' : [
2 ,
] ,
type : [
'files' ,
] ,
} ,
} ,
default : { } ,
options : [
{
name : 'fileUrl' ,
displayName : 'File' ,
values : [
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'File URL' ,
name : 'url' ,
type : 'string' ,
default : '' ,
description : 'Link to externally hosted file' ,
} ,
] ,
} ,
] ,
2021-08-13 11:57:18 -07:00
} ,
2021-05-20 14:31:23 -07:00
] ,
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
2021-12-29 14:23:22 -08:00
/* databasePage:get */
/* -------------------------------------------------------------------------- */
{
displayName : 'Database Page Link or ID' ,
name : 'pageId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
version : [
2 ,
] ,
resource : [
'databasePage' ,
] ,
operation : [
'get' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The Database Page URL from Notion\'s \'copy link\' functionality (or just the ID contained within the URL)' ,
2021-12-29 14:23:22 -08:00
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Simplify' ,
2021-12-29 14:23:22 -08:00
name : 'simple' ,
type : 'boolean' ,
displayOptions : {
show : {
version : [
2 ,
] ,
resource : [
'databasePage' ,
] ,
operation : [
'get' ,
] ,
} ,
} ,
default : true ,
description : 'Whether to return a simplified version of the response instead of the raw data' ,
} ,
/* -------------------------------------------------------------------------- */
2021-05-20 14:31:23 -07:00
/* databasePage:getAll */
/* -------------------------------------------------------------------------- */
{
2021-12-29 14:23:22 -08:00
displayName : 'Database Name or ID' ,
2021-05-20 14:31:23 -07:00
name : 'databaseId' ,
type : 'options' ,
2022-07-14 13:05:11 -07:00
description : 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2021-05-20 14:31:23 -07:00
typeOptions : {
loadOptionsMethod : 'getDatabases' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
default : false ,
2021-12-29 14:23:22 -08:00
description : 'Whether to return all results or only up to a given limit' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
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' ,
2021-05-20 14:31:23 -07:00
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Simplify' ,
2021-05-20 14:31:23 -07:00
name : 'simple' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'databasePage' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
default : true ,
2021-12-29 14:23:22 -08:00
description : 'Whether to return a simplified version of the response instead of the raw data' ,
2021-05-20 14:31:23 -07:00
} ,
2021-12-29 14:23:22 -08:00
. . . getSearchFilters ( 'databasePage' ) ,
2021-05-20 14:31:23 -07:00
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
displayOptions : {
show : {
operation : [
'getAll' ,
] ,
resource : [
'databasePage' ,
] ,
} ,
} ,
default : { } ,
placeholder : 'Add Field' ,
options : [
2021-12-29 14:23:22 -08:00
{
displayName : 'Download Files' ,
name : 'downloadFiles' ,
type : 'boolean' ,
displayOptions : {
show : {
'/version' : [
2 ,
] ,
'/resource' : [
'databasePage' ,
] ,
'/operation' : [
'getAll' ,
] ,
} ,
} ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether to download a file if a database\'s field contains it' ,
2021-12-29 14:23:22 -08:00
} ,
2021-05-20 14:31:23 -07:00
{
displayName : 'Filters' ,
name : 'filter' ,
placeholder : 'Add Filter' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : false ,
} ,
2021-12-29 14:23:22 -08:00
displayOptions : {
show : {
'/version' : [
1 ,
] ,
} ,
} ,
2021-05-20 14:31:23 -07:00
default : { } ,
options : [
{
displayName : 'Single Condition' ,
name : 'singleCondition' ,
values : [
2021-12-29 14:23:22 -08:00
. . . filters ( getConditions ( ) ) ,
2021-05-20 14:31:23 -07:00
] ,
} ,
{
displayName : 'Multiple Condition' ,
name : 'multipleCondition' ,
values : [
{
displayName : 'Condition' ,
name : 'condition' ,
placeholder : 'Add Condition' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
displayName : 'OR' ,
name : 'or' ,
values : [
2021-12-29 14:23:22 -08:00
. . . filters ( getConditions ( ) ) ,
2021-05-20 14:31:23 -07:00
] ,
} ,
{
displayName : 'AND' ,
name : 'and' ,
values : [
2021-12-29 14:23:22 -08:00
. . . filters ( getConditions ( ) ) ,
2021-05-20 14:31:23 -07:00
] ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Sort' ,
name : 'sort' ,
placeholder : 'Add Sort' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
displayName : 'Sort' ,
name : 'sortValue' ,
values : [
{
displayName : 'Timestamp' ,
name : 'timestamp' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether or not to use the record\'s timestamp to sort the response' ,
2021-05-20 14:31:23 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Property Name or ID' ,
2021-05-20 14:31:23 -07:00
name : 'key' ,
type : 'options' ,
displayOptions : {
show : {
timestamp : [
false ,
] ,
} ,
} ,
typeOptions : {
loadOptionsMethod : 'getFilterProperties' ,
loadOptionsDependsOn : [
'datatabaseId' ,
] ,
} ,
default : '' ,
2022-07-14 13:05:11 -07:00
description : 'The name of the property to filter by. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Property Name' ,
name : 'key' ,
type : 'options' ,
options : [
{
name : 'Created Time' ,
value : 'created_time' ,
} ,
{
name : 'Last Edited Time' ,
value : 'last_edited_time' ,
} ,
] ,
displayOptions : {
show : {
timestamp : [
true ,
] ,
} ,
} ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'The name of the property to filter by' ,
2021-05-20 14:31:23 -07:00
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'hidden' ,
displayOptions : {
show : {
timestamp : [
true ,
] ,
} ,
} ,
default : '={{$parameter["&key"].split("|")[1]}}' ,
} ,
{
displayName : 'Direction' ,
name : 'direction' ,
type : 'options' ,
options : [
{
name : 'Ascending' ,
value : 'ascending' ,
} ,
{
name : 'Descending' ,
value : 'descending' ,
} ,
] ,
default : '' ,
2021-12-29 14:23:22 -08:00
description : 'The direction to sort' ,
2021-05-20 14:31:23 -07:00
} ,
] ,
} ,
] ,
} ,
] ,
} ,
2021-12-29 14:23:22 -08:00
] as INodeProperties [ ] ;