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

Notion node V2 #2437

Merged
merged 27 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a90fc1e
:zap: Add versioning
RicardoE105 Nov 15, 2021
5bb4b46
:zap: Add credentials verification
RicardoE105 Nov 15, 2021
d430134
:zap: Add folmula filtering
RicardoE105 Nov 15, 2021
ff81b86
:zap: Add file support
RicardoE105 Nov 17, 2021
9d40cff
:zap: Apply internal review
RicardoE105 Nov 18, 2021
decc3b8
:zap: Improvements
RicardoE105 Nov 18, 2021
7c1c2c3
:zap: Add page updated event to trigger
RicardoE105 Nov 18, 2021
afc80ef
:zap: Use name instead of id when setting expression in select type
RicardoE105 Nov 18, 2021
b6c1469
:zap: improvements
RicardoE105 Nov 19, 2021
1617fb4
:zap: Improvements
RicardoE105 Nov 19, 2021
2d18662
:zap: Improvement to descriptions
RicardoE105 Nov 19, 2021
ff82ad7
:zap: Add filter to databasePage:getAll
RicardoE105 Nov 19, 2021
b353c11
Merge 'master' into 'notion-v2'
RicardoE105 Nov 24, 2021
58ed92a
:zap: Improvements
RicardoE105 Nov 25, 2021
0c469aa
:zap: Add database:search operation
RicardoE105 Nov 25, 2021
062bd5c
🔀Merge 'master' into 'notion-v2'
RicardoE105 Nov 25, 2021
6007b44
:zap: Add page:archive operation
RicardoE105 Nov 29, 2021
83e8759
:zap: Allow clearing fields date type
RicardoE105 Dec 21, 2021
4104ac0
:zap: Allow setting single value in people type field
RicardoE105 Dec 21, 2021
d96df0f
asasas
RicardoE105 Dec 22, 2021
7b4f0a8
asasas
RicardoE105 Dec 22, 2021
8a16d36
aaaaa
RicardoE105 Dec 23, 2021
6405251
:zap: Improvements
RicardoE105 Dec 27, 2021
6b43e20
🔀 Merge 'master' into 'feature/notion-v2'
RicardoE105 Dec 27, 2021
e0940d4
:zap: Fix merging issues
RicardoE105 Dec 27, 2021
b171e6b
:bug: Fix filename
janober Dec 29, 2021
56e4586
:zap: Minor fix
janober Dec 29, 2021
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
2 changes: 1 addition & 1 deletion packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ class App {
const testFunctionSearch =
credential.name === credentialType && !!credential.testedBy;
if (testFunctionSearch) {
foundTestFunction = (node as unknown as INodeType).methods!.credentialTest![
foundTestFunction = (nodeType as unknown as INodeType).methods!.credentialTest![
credential.testedBy!
];
}
Expand Down
24 changes: 12 additions & 12 deletions packages/nodes-base/nodes/Notion/BlockDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
blocks,
} from './Blocks';

export const blockOperations: INodeProperties[] = [
export const blockOperations = [
{
displayName: 'Operation',
name: 'operation',
Expand All @@ -20,28 +20,27 @@ export const blockOperations: INodeProperties[] = [
},
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',
},
],
default: 'append',
description: 'The operation to perform.',
},
];
] as INodeProperties[];

export const blockFields: INodeProperties[] = [
export const blockFields = [

/* -------------------------------------------------------------------------- */
/* block:append */
/* -------------------------------------------------------------------------- */
{
displayName: 'Block ID',
displayName: 'Block ID or Link',
name: 'blockId',
type: 'string',
default: '',
Expand All @@ -56,14 +55,14 @@ export const blockFields: INodeProperties[] = [
],
},
},
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 +77,7 @@ export const blockFields: INodeProperties[] = [
],
},
},
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 +94,7 @@ export const blockFields: INodeProperties[] = [
},
},
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 +118,6 @@ export const blockFields: INodeProperties[] = [
maxValue: 100,
},
default: 50,
description: 'How many results to return.',
description: 'How many results to return',
},
];
] as INodeProperties[];
51 changes: 25 additions & 26 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: INodeProperties[] = [
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',
},
];

Expand Down Expand Up @@ -169,7 +169,7 @@ const typeMention: INodeProperties[] = [
},
],
default: '',
description: `An inline mention of a user, page, database, or date. In the app these are created by typing @ followed by the name of a user, page, database, or a date.`,
description: `An inline mention of a user, page, database, or date. In the app these are created by typing @ followed by the name of a user, page, database, or a date`,
},
{
displayName: 'User ID',
Expand All @@ -186,7 +186,7 @@ const typeMention: INodeProperties[] = [
},
},
default: '',
description: 'The id of the user being mentioned.',
description: 'The ID of the user being mentioned',
},
{
displayName: 'Page ID',
Expand All @@ -200,7 +200,7 @@ const typeMention: INodeProperties[] = [
},
},
default: '',
description: 'The id of the page being mentioned.',
description: 'The ID of the page being mentioned',
},
{
displayName: 'Database ID',
Expand All @@ -217,7 +217,7 @@ const typeMention: INodeProperties[] = [
},
},
default: '',
description: 'The id of the database being mentioned.',
description: 'The ID of the database being mentioned',
},
{
displayName: 'Range',
Expand All @@ -231,7 +231,7 @@ const typeMention: INodeProperties[] = [
},
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 @@ -248,7 +248,7 @@ const typeMention: INodeProperties[] = [
},
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 @@ -265,7 +265,7 @@ const typeMention: INodeProperties[] = [
},
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 @@ -282,7 +282,7 @@ const typeMention: INodeProperties[] = [
},
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`,
},
];

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

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


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

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

const richText = (displayOptions: IDisplayOptions): INodeProperties[] => [
{
Expand All @@ -449,7 +450,7 @@ const textContent = (displayOptions: IDisplayOptions): INodeProperties[] => [
},
];

const block = (blockType: string) => {
const block = (blockType: string): INodeProperties[] => {
const data: INodeProperties[] = [];
switch (blockType) {
case 'to_do':
Expand Down Expand Up @@ -549,7 +550,6 @@ export const blocks = (resource: string, operation: string): INodeProperties[] =
typeOptions: {
loadOptionsMethod: 'getBlockTypes',
},
description: 'Type of block',
default: 'paragraph',
},
...block('paragraph'),
Expand All @@ -566,4 +566,3 @@ export const blocks = (resource: string, operation: string): INodeProperties[] =
],
},
];

Loading