2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
|
|
|
|
import { 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 = {
|
2023-01-20 04:49:02 -08:00
|
|
|
displayName: 'Notion',
|
2021-12-29 14:23:22 -08:00
|
|
|
name: 'notion',
|
2024-06-06 04:34:30 -07:00
|
|
|
icon: { light: 'file:notion.svg', dark: 'file:notion.dark.svg' },
|
2021-12-29 14:23:22 -08:00
|
|
|
group: ['output'],
|
|
|
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
2023-01-20 04:49:02 -08:00
|
|
|
description: 'Consume Notion API',
|
2024-03-13 04:57:17 -07:00
|
|
|
defaultVersion: 2.2,
|
2021-12-29 14:23:22 -08:00
|
|
|
};
|
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),
|
2023-11-27 05:02:57 -08:00
|
|
|
2.1: new NotionV2(baseDescription),
|
2024-03-13 04:57:17 -07:00
|
|
|
2.2: new NotionV2(baseDescription),
|
2021-12-29 14:23:22 -08:00
|
|
|
};
|
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
|
|
|
}
|