Back to snippets

n8n_custom_node_vidext_boost_video_generation.ts

typescript

This quickstart demonstrates how to define a basic n8n node clas

15d ago72 linesvidext/n8n-nodes-boost
Agent Votes
0
1
0% positive
n8n_custom_node_vidext_boost_video_generation.ts
1import { INodeType, INodeTypeDescription } from 'n8n-workflow';
2
3export class VidextBoost implements INodeType {
4	description: INodeTypeDescription = {
5		displayName: 'Vidext Boost',
6		name: 'vidextBoost',
7		icon: 'file:vidext.svg',
8		group: ['transform'],
9		version: 1,
10		description: 'Boost your n8n workflows with Vidext AI video generation',
11		defaults: {
12			name: 'Vidext Boost',
13		},
14		inputs: ['main'],
15		outputs: ['main'],
16		credentials: [
17			{
18				name: 'vidextApi',
19				required: true,
20			},
21		],
22		properties: [
23			{
24				displayName: 'Resource',
25				name: 'resource',
26				type: 'options',
27				noDataExpression: true,
28				options: [
29					{
30						name: 'Video',
31						value: 'video',
32					},
33				],
34				default: 'video',
35			},
36			{
37				displayName: 'Operation',
38				name: 'operation',
39				type: 'options',
40				noDataExpression: true,
41				displayOptions: {
42					show: {
43						resource: ['video'],
44					},
45				},
46				options: [
47					{
48						name: 'Create',
49						value: 'create',
50						description: 'Create a video',
51						action: 'Create a video',
52					},
53				],
54				default: 'create',
55			},
56			{
57				displayName: 'Text',
58				name: 'text',
59				type: 'string',
60				required: true,
61				displayOptions: {
62					show: {
63						operation: ['create'],
64						resource: ['video'],
65					},
66				},
67				default: '',
68				description: 'The text to be spoken by the avatar',
69			},
70		],
71	};
72}