2021-05-20 14:31:23 -07:00
|
|
|
import {
|
2021-12-29 14:23:22 -08:00
|
|
|
INodeTypeBaseDescription,
|
|
|
|
INodeVersionedType,
|
2021-05-20 14:31:23 -07:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
import {
|
2021-12-29 14:23:22 -08:00
|
|
|
NotionV1,
|
|
|
|
} from './v1/NotionV1.node';
|
2021-05-20 14:31:23 -07:00
|
|
|
|
|
|
|
import {
|
2021-12-29 14:23:22 -08:00
|
|
|
NotionV2,
|
|
|
|
} from './v2/NotionV2.node';
|
2021-05-20 14:31:23 -07:00
|
|
|
|
|
|
|
import {
|
2021-12-29 14:23:22 -08:00
|
|
|
NodeVersionedType,
|
|
|
|
} from '../../src/NodeVersionedType';
|
2021-05-20 14:31:23 -07:00
|
|
|
|
2021-12-29 14:23:22 -08:00
|
|
|
export class Notion extends NodeVersionedType {
|
|
|
|
constructor() {
|
|
|
|
const baseDescription: INodeTypeBaseDescription = {
|
|
|
|
displayName: 'Notion (Beta)',
|
|
|
|
name: 'notion',
|
|
|
|
icon: 'file:notion.svg',
|
|
|
|
group: ['output'],
|
|
|
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
|
|
description: 'Consume Notion API (Beta)',
|
|
|
|
defaultVersion: 2,
|
|
|
|
};
|
2021-05-20 14:31:23 -07:00
|
|
|
|
2021-12-29 14:23:22 -08:00
|
|
|
const nodeVersions: INodeVersionedType['nodeVersions'] = {
|
|
|
|
1: new NotionV1(baseDescription),
|
|
|
|
2: new NotionV2(baseDescription),
|
|
|
|
};
|
2021-05-20 14:31:23 -07:00
|
|
|
|
2021-12-29 14:23:22 -08:00
|
|
|
super(nodeVersions, baseDescription);
|
2021-05-20 14:31:23 -07:00
|
|
|
}
|
2021-12-29 14:23:22 -08:00
|
|
|
}
|