2022-07-04 02:12:08 -07:00
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
2023-01-27 03:22:44 -08:00
import type { INodeTypeDescription } from 'n8n-workflow' ;
2022-08-17 08:50:24 -07:00
import { databaseFields , databaseOperations } from '../DatabaseDescription' ;
2021-12-29 14:23:22 -08:00
2022-08-17 08:50:24 -07:00
import { userFields , userOperations } from '../UserDescription' ;
2021-12-29 14:23:22 -08:00
2022-08-17 08:50:24 -07:00
import { pageFields , pageOperations } from '../PageDescription' ;
2021-12-29 14:23:22 -08:00
2022-08-17 08:50:24 -07:00
import { blockFields , blockOperations } from '../BlockDescription' ;
2021-12-29 14:23:22 -08:00
2022-08-17 08:50:24 -07:00
import { databasePageFields , databasePageOperations } from '../DatabasePageDescription' ;
2021-12-29 14:23:22 -08:00
export const versionDescription : INodeTypeDescription = {
2023-01-20 04:49:02 -08:00
displayName : 'Notion' ,
2022-08-17 08:50:24 -07:00
name : 'notion' ,
icon : 'file:notion.svg' ,
group : [ 'output' ] ,
version : 1 ,
subtitle : '={{$parameter["operation"] + ": " + $parameter["resource"]}}' ,
2023-01-20 04:49:02 -08:00
description : 'Consume Notion API' ,
2022-08-17 08:50:24 -07:00
defaults : {
2023-05-18 09:33:08 -07:00
name : 'Notion' ,
2022-08-17 08:50:24 -07:00
} ,
inputs : [ 'main' ] ,
outputs : [ 'main' ] ,
credentials : [
{
name : 'notionApi' ,
required : true ,
// displayOptions: {
// show: {
// authentication: [
// 'apiKey',
// ],
2021-12-29 14:23:22 -08:00
// },
// },
2022-08-17 08:50:24 -07:00
} ,
// {
// name: 'notionOAuth2Api',
// required: true,
// displayOptions: {
// show: {
// authentication: [
// 'oAuth2',
// ],
// },
// },
// },
] ,
properties : [
// {
// displayName: 'Authentication',
// name: 'authentication',
// type: 'options',
// options: [
// {
// name: 'API Key',
// value: 'apiKey',
// },
// {
// name: 'OAuth2',
// value: 'oAuth2',
// },
// ],
// default: 'apiKey',
// description: 'The resource to operate on.',
// },
{
2023-01-20 04:49:02 -08:00
displayName :
'In Notion, make sure to <a href="https://www.notion.so/help/add-and-manage-connections-with-the-api" target="_blank">add your connection</a> to the pages you want to access.' ,
2022-08-17 08:50:24 -07:00
name : 'notionNotice' ,
type : 'notice' ,
default : '' ,
} ,
{
displayName : 'Resource' ,
name : 'resource' ,
type : 'options' ,
noDataExpression : true ,
options : [
{
name : 'Block' ,
value : 'block' ,
} ,
{
name : 'Database' ,
value : 'database' ,
} ,
{
name : 'Database Page' ,
value : 'databasePage' ,
} ,
{
name : 'Page' ,
value : 'page' ,
} ,
{
name : 'User' ,
value : 'user' ,
} ,
] ,
default : 'page' ,
} ,
. . . blockOperations ,
. . . blockFields ,
. . . databaseOperations ,
. . . databaseFields ,
. . . databasePageOperations ,
. . . databasePageFields ,
. . . pageOperations ,
. . . pageFields ,
. . . userOperations ,
. . . userFields ,
] ,
} ;