n8n/packages/nodes-base/nodes/Notion/v1/VersionDescription.ts

117 lines
2.4 KiB
TypeScript
Raw Normal View History

refactor: Apply more `eslint-plugin-n8n-nodes-base` rules (#3624) * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :wrench: Adjust renamed filesystem rules * :pencil2: Alphabetize ruleset * :zap: Categorize overrides * :zap: Set renamings in lint exceptions * :zap: Run baseline `lintfix` * :zap: Update linting scripts * :shirt: Apply `node-param-description-missing-from-dynamic-multi-options` * :shirt: Apply `cred-class-field-name-missing-oauth2` (#3627) * Rule working as intended * Removed comments * Move cred rule to different rule set * :shirt: Apply `node-param-array-type-assertion` * :shirt: Apply `node-dirname-against-convention` * Apply `cred-class-field-display-name-oauth2` (#3628) * Apply `node-execute-block-wrong-error-thrown` * Apply `node-class-description-display-name-unsuffixed-trigger-node` * Apply `node-class-description-name-unsuffixed-trigger-node` * Apply `cred-class-name-missing-oauth2-suffix` (#3636) * Rule working as intended, add exception to existing nodes * :shirt: Apply `cred-class-field-name-uppercase-first-char` (#3638) * :arrow_up: Upgrade to plugin version 1.2.28 * :package: Update `package-lock.json` * :shirt: Update lintings with 1.2.8 change * :shirt: Apply `cred-class-field-name-unsuffixed` * :shirt: Apply `cred-class-name-unsuffixed` * :shirt: Apply `node-class-description-credentials-name-unsuffixed` * :pencil2: Alphabetize rules * :heavy_minus_sign: Remove `nodelinter` package * :package: Update `package-lock.json` * :zap: Consolidate `lint` and `lintfix` scripts Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com>
2022-07-04 02:12:08 -07:00
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
import { databaseFields, databaseOperations } from '../DatabaseDescription';
import { userFields, userOperations } from '../UserDescription';
import { pageFields, pageOperations } from '../PageDescription';
import { blockFields, blockOperations } from '../BlockDescription';
import { databasePageFields, databasePageOperations } from '../DatabasePageDescription';
import type { INodeTypeDescription } from 'n8n-workflow';
export const versionDescription: INodeTypeDescription = {
displayName: 'Notion',
name: 'notion',
icon: 'file:notion.svg',
group: ['output'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Notion API',
defaults: {
name: 'Notion',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'notionApi',
required: true,
// displayOptions: {
// show: {
// authentication: [
// 'apiKey',
// ],
// },
// },
},
// {
// 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.',
// },
{
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.',
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,
],
};