2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
|
|
|
|
import { VersionedNodeType } from 'n8n-workflow';
|
2020-08-18 03:40:19 -07:00
|
|
|
|
2022-09-08 05:44:34 -07:00
|
|
|
import { GmailV1 } from './v1/GmailV1.node';
|
|
|
|
import { GmailV2 } from './v2/GmailV2.node';
|
2020-08-18 03:40:19 -07:00
|
|
|
|
2022-10-25 12:33:12 -07:00
|
|
|
export class Gmail extends VersionedNodeType {
|
2022-09-08 05:44:34 -07:00
|
|
|
constructor() {
|
|
|
|
const baseDescription: INodeTypeBaseDescription = {
|
|
|
|
displayName: 'Gmail',
|
|
|
|
name: 'gmail',
|
|
|
|
icon: 'file:gmail.svg',
|
|
|
|
group: ['transform'],
|
|
|
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
|
|
description: 'Consume the Gmail API',
|
|
|
|
defaultVersion: 2,
|
|
|
|
};
|
2020-08-18 03:40:19 -07:00
|
|
|
|
2022-10-25 12:33:12 -07:00
|
|
|
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
2022-09-08 05:44:34 -07:00
|
|
|
1: new GmailV1(baseDescription),
|
|
|
|
2: new GmailV2(baseDescription),
|
|
|
|
};
|
2020-08-18 03:40:19 -07:00
|
|
|
|
2022-09-08 05:44:34 -07:00
|
|
|
super(nodeVersions, baseDescription);
|
2020-08-18 03:40:19 -07:00
|
|
|
}
|
|
|
|
}
|