2022-10-25 12:33:12 -07:00
|
|
|
import { INodeTypeBaseDescription, IVersionedNodeType, VersionedNodeType } from 'n8n-workflow';
|
2021-05-20 14:31:23 -07:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { NotionV1 } from './v1/NotionV1.node';
|
|
|
|
import { NotionV2 } from './v2/NotionV2.node';
|
2021-05-20 14:31:23 -07:00
|
|
|
|
2022-10-25 12:33:12 -07:00
|
|
|
export class Notion extends VersionedNodeType {
|
2021-12-29 14:23:22 -08:00
|
|
|
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
|
|
|
|
2022-10-25 12:33:12 -07:00
|
|
|
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
2021-12-29 14:23:22 -08:00
|
|
|
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
|
|
|
}
|
2022-08-17 08:50:24 -07:00
|
|
|
}
|