Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Notion node #2344

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/cli/BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# n8n Breaking Changes

This list shows all the versions which include breaking changes and how to upgrade.
## 0.149.0

### What changed?

Previously, in Notion, empty properties of date, email, number, and rollup types were omitted from the page response. Now, these empty properties are returned with null values.

### When is action necessary?

1 - If you are using the Notion node with any of the operations below and you are working with property types: date, email, number or rollup.

| Resource | Operation |
|--|--|
| Database Page | Create |
| Database Page | Update |
| Database Page | Get All |

2 - If you are using the Notion Trigger node and you are working with property types: date, email, number or rollup.

### How to upgrade:

Run a test to make sure the new returned values do not break the logic of your workflow.

## 0.139.0

Expand Down
15 changes: 8 additions & 7 deletions packages/nodes-base/nodes/Notion/BlockDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export const blockOperations = [
},
options: [
{
name: 'Append',
name: 'Append After',
value: 'append',
description: 'Append a block',
},
{
name: 'Get All',
name: 'Get Child Blocks',
value: 'getAll',
description: 'Get all children blocks',
},
Expand All @@ -41,7 +41,7 @@ export const blockFields = [
/* block:append */
/* -------------------------------------------------------------------------- */
{
displayName: 'Block ID',
displayName: 'Block ID or Link',
name: 'blockId',
type: 'string',
default: '',
Expand All @@ -56,14 +56,14 @@ export const blockFields = [
],
},
},
description: `The ID of block. A page it is also considered a block. Hence, a Page ID can be used as well.`,
description: `The Block URL from Notion's 'copy link' functionality (or just the ID contained within the URL). Pages are also blocks, so you can use a page URL/ID here too`,
},
...blocks('block', 'append'),
/* -------------------------------------------------------------------------- */
/* block:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Block ID',
displayName: 'Block ID or Link',
name: 'blockId',
type: 'string',
default: '',
Expand All @@ -78,6 +78,7 @@ export const blockFields = [
],
},
},
description: `The Block URL from Notion's 'copy link' functionality (or just the ID contained within the URL). Pages are also blocks, so you can use a page URL/ID here too`,
},
{
displayName: 'Return All',
Expand All @@ -94,7 +95,7 @@ export const blockFields = [
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
description: 'If all results should be returned or only up to a given limit',
},
{
displayName: 'Limit',
Expand All @@ -118,6 +119,6 @@ export const blockFields = [
maxValue: 100,
},
default: 50,
description: 'How many results to return.',
description: 'How many results to return',
},
] as INodeProperties[];
41 changes: 20 additions & 21 deletions packages/nodes-base/nodes/Notion/Blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,46 +95,46 @@ const annotation = [
name: 'bold',
type: 'boolean',
default: false,
description: 'Whether the text is bolded.',
description: 'Whether the text is bolded',
},
{
displayName: 'Italic',
name: 'italic',
type: 'boolean',
default: false,
description: 'Whether the text is italicized.',
description: 'Whether the text is italicized',
},
{
displayName: 'Strikethrough',
name: 'strikethrough',
type: 'boolean',
default: false,
description: 'Whether the text is struck through.',
description: 'Whether the text is struck through',
},
{
displayName: 'Underline',
name: 'underline',
type: 'boolean',
default: false,
description: 'Whether the text is underlined.',
description: 'Whether the text is underlined',
},
{
displayName: 'Code',
name: 'code',
type: 'boolean',
default: false,
description: 'Whether the text is code style.',
description: 'Whether the text is code style',
},
{
displayName: 'Color',
name: 'color',
type: 'options',
options: colors,
default: '',
description: 'Color of the text.',
description: 'Color of the text',
},
],
description: 'All annotations that apply to this rich text.',
description: 'All annotations that apply to this rich text',
},
] as INodeProperties[];

Expand Down Expand Up @@ -170,7 +170,7 @@ const typeMention = [
],
default: '',
description: `An inline mention of a user, page, database, or date. In the app these are</br>
created by typing @ followed by the name of a user, page, database, or a date.`,
created by typing @ followed by the name of a user, page, database, or a date`,
},
{
displayName: 'User ID',
Expand All @@ -187,7 +187,7 @@ const typeMention = [
},
},
default: '',
description: 'The id of the user being mentioned.',
description: 'The id of the user being mentioned',
},
{
displayName: 'Page ID',
Expand All @@ -201,7 +201,7 @@ const typeMention = [
},
},
default: '',
description: 'The id of the page being mentioned.',
description: 'The id of the page being mentioned',
},
{
displayName: 'Database ID',
Expand All @@ -218,7 +218,7 @@ const typeMention = [
},
},
default: '',
description: 'The id of the database being mentioned.',
description: 'The id of the database being mentioned',
},
{
displayName: 'Range',
Expand All @@ -232,7 +232,7 @@ const typeMention = [
},
type: 'boolean',
default: false,
description: 'Weather or not you want to define a date range.',
description: 'Weather or not you want to define a date range',
},
{
displayName: 'Date',
Expand All @@ -249,7 +249,7 @@ const typeMention = [
},
type: 'dateTime',
default: '',
description: 'An ISO 8601 format date, with optional time.',
description: 'An ISO 8601 format date, with optional time',
},
{
displayName: 'Date Start',
Expand All @@ -266,7 +266,7 @@ const typeMention = [
},
type: 'dateTime',
default: '',
description: 'An ISO 8601 format date, with optional time.',
description: 'An ISO 8601 format date, with optional time',
},
{
displayName: 'Date End',
Expand All @@ -283,7 +283,7 @@ const typeMention = [
},
type: 'dateTime',
default: '',
description: `An ISO 8601 formatted date, with optional time. Represents the end of a date range.`,
description: `An ISO 8601 formatted date, with optional time. Represents the end of a date range`,
},
] as INodeProperties[];

Expand Down Expand Up @@ -318,7 +318,7 @@ const typeText = [
type: 'string',
default: '',
description: `Text content. This field contains the actual content</br>
of your text and is probably the field you'll use most often.`,
of your text and is probably the field you'll use most often`,
},
{
displayName: 'Is Link',
Expand Down Expand Up @@ -348,7 +348,7 @@ const typeText = [
},
type: 'string',
default: '',
description: 'The URL that this link points to.',
description: 'The URL that this link points to',
},
] as INodeProperties[];

Expand Down Expand Up @@ -397,7 +397,7 @@ export const text = (displayOptions: IDisplayOptions) => [
],
},
],
description: 'Rich text in the block.',
description: 'Rich text in the block',
}] as INodeProperties[];


Expand All @@ -413,7 +413,7 @@ const todo = (type: string) => [{
],
},
},
description: 'Whether the to_do is checked or not.',
description: 'Whether the to_do is checked or not',
}] as INodeProperties[];

const title = (type: string) => [{
Expand All @@ -428,7 +428,7 @@ const title = (type: string) => [{
],
},
},
description: 'Plain text of page title.',
description: 'Plain text of page title',
}] as INodeProperties[];

const richText = (displayOptions: IDisplayOptions) => [
Expand Down Expand Up @@ -551,7 +551,6 @@ export const blocks = (resource: string, operation: string) => [{
typeOptions: {
loadOptionsMethod: 'getBlockTypes',
},
description: 'Type of block',
default: 'paragraph',
},
...block('paragraph'),
Expand Down
25 changes: 22 additions & 3 deletions packages/nodes-base/nodes/Notion/DatabaseDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const databaseFields = [
/* database:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Database ID',
displayName: 'Database Link or ID',
name: 'databaseId',
type: 'string',
default: '',
Expand All @@ -52,6 +52,7 @@ export const databaseFields = [
],
},
},
description: `The URL from Notion's 'copy link' functionality (or just the ID contained within the URL)`,
},
/* -------------------------------------------------------------------------- */
/* database:getAll */
Expand All @@ -71,7 +72,7 @@ export const databaseFields = [
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
description: 'If all results should be returned or only up to a given limit',
},
{
displayName: 'Limit',
Expand All @@ -95,6 +96,24 @@ export const databaseFields = [
maxValue: 100,
},
default: 50,
description: 'How many results to return.',
description: 'How many results to return',
},
{
displayName: 'Simplify Output',
name: 'simple',
type: 'boolean',
displayOptions: {
show: {
resource: [
'database',
],
operation: [
'getAll',
'get',
],
},
},
default: false,
description: 'Whether to return a simplified version of the response instead of the raw data',
},
] as INodeProperties[];
Loading